As it does for other languages, GDB makes certain generic extensions to Ada (see Expressions):
E@
N
displays the values of
E and the N-1 adjacent variables following it in memory as an array.
In Ada, this operator is generally not necessary, since its prime use
is in displaying parts of an array, and slicing will usually do this in Ada.
However, there are occasional uses when debugging programs
in which certain debugging information has been optimized away.
B::
var
means "the variable named var that appears
in function or file B." When B is a file name, you must typically
surround it in single quotes.
{
type}
addr
means "the variable of type
type that appears at address addr."
$
is a convenience variable
(see Convenience Vars) or a machine register (see Registers).
In addition, GDB provides a few other shortcuts and outright additions specific to Ada:
set x := y + 3 print A(tmp := y + 1)
break f condition 1 (report(i); k += 1; A(k) > 100)
["
XX"]
within a string or character literal denotes the
(single) character whose numeric encoding is XX in hexadecimal. The
sequence of characters ["""]
also denotes a single quotation mark
in strings. For example,
"One line.["0a"]Next line.["0a"]"Contains an ASCII newline character (Ada.Characters.Latin_1.LF) after each period.
print 'max(x, y)
(3 => 10, 17, 1)
That is, in contrast to valid Ada, only the first component has a =>
clause.
a'len
, a'gth
, or a'lh
in place of a'length
.
(gdb) print <JMPBUF_SAVE>[0]