3 <title>Debugging with GDB
</title>
4 <meta http-equiv=
"Content-Type" content=
"text/html">
5 <meta name=
"description" content=
"Debugging with GDB">
6 <meta name=
"generator" content=
"makeinfo 4.3">
7 <link href=
"http://www.gnu.org/software/texinfo/" rel=
"generator-home">
12 Node:
<a name=
"Frame%20Annotations">Frame Annotations
</a>,
13 Next:
<a rel=
"next" accesskey=
"n" href=
"Displays.html#Displays">Displays
</a>,
14 Previous:
<a rel=
"previous" accesskey=
"p" href=
"Value-Annotations.html#Value%20Annotations">Value Annotations
</a>,
15 Up:
<a rel=
"up" accesskey=
"u" href=
"Annotations.html#Annotations">Annotations
</a>
19 <h3 class=
"section">Frames
</h3>
21 <p>Whenever GDB prints a frame, it annotates it. For example, this applies
22 to frames printed when GDB stops, output from commands such as
23 <code>backtrace
</code> or
<code>up
</code>, etc.
25 <p>The frame annotation begins with
27 <pre class=
"smallexample"> ^Z^Zframe-begin
<var>level
</var> <var>address
</var>
28 <var>level-string
</var>
31 <p>where
<var>level
</var> is the number of the frame (
0 is the innermost frame,
32 and other frames have positive numbers),
<var>address
</var> is the address of
33 the code executing in that frame, and
<var>level-string
</var> is a string
34 designed to convey the level to the user.
<var>address
</var> is in the form
35 <code>0x
</code> followed by one or more lowercase hex digits (note that this
36 does not depend on the language). The frame ends with
38 <pre class=
"smallexample"> ^Z^Zframe-end
41 <p>Between these annotations is the main body of the frame, which can
46 <pre class=
"smallexample"> ^Z^Zfunction-call
47 <var>function-call-string
</var>
50 <p>where
<var>function-call-string
</var> is text designed to convey to the user
51 that this frame is associated with a function call made by GDB to a
52 function in the program being debugged.
55 <pre class=
"smallexample"> ^Z^Zsignal-handler-caller
56 <var>signal-handler-caller-string
</var>
59 <p>where
<var>signal-handler-caller-string
</var> is text designed to convey to
60 the user that this frame is associated with whatever mechanism is used
61 by this operating system to call a signal handler (it is the frame which
62 calls the signal handler, not the frame for the signal handler itself).
64 </p><li>A normal frame.
66 <p>This can optionally (depending on whether this is thought of as
67 interesting information for the user to see) begin with
69 <pre class=
"smallexample"> ^Z^Zframe-address
72 <var>separator-string
</var>
75 <p>where
<var>address
</var> is the address executing in the frame (the same
76 address as in the
<code>frame-begin
</code> annotation, but printed in a form
77 which is intended for user consumption--in particular, the syntax varies
78 depending on the language), and
<var>separator-string
</var> is a string
79 intended to separate this address from what follows for the user's
84 <pre class=
"smallexample"> ^Z^Zframe-function-name
85 <var>function-name
</var>
90 <p>where
<var>function-name
</var> is the name of the function executing in the
91 frame, or
<code>??
</code> if not known, and
<var>arguments
</var> are the arguments
92 to the frame, with parentheses around them (each argument is annotated
93 individually as well, see
<a href=
"Value-Annotations.html#Value%20Annotations">Value Annotations
</a>).
95 <p>If source information is available, a reference to it is then printed:
97 <pre class=
"smallexample"> ^Z^Zframe-source-begin
98 <var>source-intro-string
</var>
101 ^Z^Zframe-source-file-end
103 ^Z^Zframe-source-line
104 <var>line-number
</var>
108 <p>where
<var>source-intro-string
</var> separates for the user's benefit the
109 reference from the text which precedes it,
<var>filename
</var> is the name of
110 the source file, and
<var>line-number
</var> is the line number within that
111 file (the first line is line
1).
113 <p>If GDB prints some information about where the frame is from (which
114 library, which load segment, etc.; currently only done on the RS/
6000),
117 <pre class=
"smallexample"> ^Z^Zframe-where
118 <var>information
</var>
121 <p>Then, if source is to actually be displayed for this frame (for example,
122 this is not true for output from the
<code>backtrace
</code> command), then a
123 <code>source
</code> annotation (see
<a href=
"Source-Annotations.html#Source%20Annotations">Source Annotations
</a>) is displayed. Unlike
124 most annotations, this is output instead of the normal text which would be
125 output, not in addition.