Debugging with GDB (September 2007)

Chapter 20: GDB Annotations 259
^Z^Zarray-section-begin array-index value-flags
where array-index is the index of the first element being annotated and value-flags has
the same meaning as in a value-history-begin annotation. This is followed by any
numb e r of elements, where the element can be either a single element or a repeate d element
as shown in the examples below:
‘,’ whitespace ; omitted for the first element
the-value
^Z^Zelt
‘,’ whitespace ; omitted for the first element
the-value
^Z^Zelt-rep number-of-repititions
repetition-string
^Z^Zelt-rep-end
In both cases, the-value is the output for the value of the element and whitespace can
contain spaces, tabs, and newlines. In the repeated case, number-of-repititons is the number
of consecutive array elements which contain that value, and rep e tition-string is a string
which is designed to convey to the user that repitition is being depicted.
Once all the array elements have been output, the array annotation is ended with
^Z^Zarray-section-end
20.4 Frames
Whenever GDB prints a frame, it annotates it. For example, this applies to frames
printed when GDB stops, output from commands such as backtrace or up, etc.
The frame annotation begins with
^Z^Zframe-begin level address
level-string
where level is the number of the frame (0 is the innermost frame, and other frames have
positive numbers), address is the address of the code executing in that frame, and level-
string is a string designed to convey the level to the user. address is in the form 0x followed
by one or more lowercase hex digits (note that this does not depend on the language). The
frame ends with
^Z^Zframe-end
Between these annotations is the main b ody of the frame, which can consist of
^Z^Zfunction-call
function-call-string
where function-call-string is text designed to convey to the user that this frame is
associated with a function call made by GDB to a function in the program being
debugged.
^Z^Zsignal-handler-caller
signal-handler-caller-string
where signal-handler-caller-string is text designed to convey to the user that this frame
is associated with whatever mechanism is used by this operating system to call a signal
handler (it is the frame which calls the signal handler, not the frame for the signal
handler itself).