966 lines
41 KiB
HTML
966 lines
41 KiB
HTML
<HTML>
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<!-- Created on November, 11 2002 by texi2html 1.64 -->
|
|
<!--
|
|
Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
|
|
Karl Berry <karl@freefriends.org>
|
|
Olaf Bachmann <obachman@mathematik.uni-kl.de>
|
|
and many others.
|
|
Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>
|
|
Send bugs and suggestions to <texi2html@mathematik.uni-kl.de>
|
|
|
|
-->
|
|
<HEAD>
|
|
<TITLE>Debugging with GDB: Annotations</TITLE>
|
|
|
|
<META NAME="description" CONTENT="Debugging with GDB: Annotations">
|
|
<META NAME="keywords" CONTENT="Debugging with GDB: Annotations">
|
|
<META NAME="resource-type" CONTENT="document">
|
|
<META NAME="distribution" CONTENT="global">
|
|
<META NAME="Generator" CONTENT="texi2html 1.64">
|
|
|
|
</HEAD>
|
|
|
|
<BODY LANG="" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#800080" ALINK="#FF0000">
|
|
|
|
<A NAME="SEC204"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_23.html#SEC203"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC205"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_4.html#SEC12"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H1> 23. GDB Annotations </H1>
|
|
<!--docid::SEC204::-->
|
|
<P>
|
|
|
|
This chapter describes annotations in GDB. Annotations are
|
|
designed to interface GDB to graphical user interfaces or
|
|
other similar programs which want to interact with GDB at a
|
|
relatively high level.
|
|
</P><P>
|
|
|
|
<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_24.html#SEC205">23.1 What is an Annotation?</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">What annotations are; the general syntax.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_24.html#SEC206">23.2 The Server Prefix</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Issuing a command without affecting user state.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_24.html#SEC207">23.3 Values</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Values are marked as such.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_24.html#SEC208">23.4 Frames</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Stack frames are annotated.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_24.html#SEC209">23.5 Displays</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">GDB can be told to display something periodically.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_24.html#SEC210">23.6 Annotation for GDB Input</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Annotations marking GDB's need for input.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_24.html#SEC211">23.7 Errors</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Annotations for error messages.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_24.html#SEC212">23.8 Information on Breakpoints</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Information on breakpoints.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_24.html#SEC213">23.9 Invalidation Notices</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Some annotations describe things now invalid.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_24.html#SEC214">23.10 Running the Program</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Whether the program is running, how it stopped, etc.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_24.html#SEC215">23.11 Displaying Source</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Annotations describing source code.</TD></TR>
|
|
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_24.html#SEC216">23.12 Annotations We Might Want in the Future</A></TD><TD> </TD><TD ALIGN="left" VALIGN="TOP">Annotations which might be added in the future.</TD></TR>
|
|
</TABLE></BLOCKQUOTE>
|
|
<P>
|
|
|
|
<A NAME="Annotations Overview"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC205"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC206"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 23.1 What is an Annotation? </H2>
|
|
<!--docid::SEC205::-->
|
|
<P>
|
|
|
|
To produce annotations, start GDB with the <CODE>--annotate=2</CODE> option.
|
|
</P><P>
|
|
|
|
Annotations start with a newline character, two <SAMP>`control-z'</SAMP>
|
|
characters, and the name of the annotation. If there is no additional
|
|
information associated with this annotation, the name of the annotation
|
|
is followed immediately by a newline. If there is additional
|
|
information, the name of the annotation is followed by a space, the
|
|
additional information, and a newline. The additional information
|
|
cannot contain newline characters.
|
|
</P><P>
|
|
|
|
Any output not beginning with a newline and two <SAMP>`control-z'</SAMP>
|
|
characters denotes literal output from GDB. Currently there is
|
|
no need for GDB to output a newline followed by two
|
|
<SAMP>`control-z'</SAMP> characters, but if there was such a need, the
|
|
annotations could be extended with an <SAMP>`escape'</SAMP> annotation which
|
|
means those three characters as output.
|
|
</P><P>
|
|
|
|
A simple example of starting up GDB with annotations is:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>$ gdb --annotate=2
|
|
GNU GDB 5.0
|
|
Copyright 2000 Free Software Foundation, Inc.
|
|
GDB is free software, covered by the GNU General Public License,
|
|
and you are welcome to change it and/or distribute copies of it
|
|
under certain conditions.
|
|
Type "show copying" to see the conditions.
|
|
There is absolutely no warranty for GDB. Type "show warranty"
|
|
for details.
|
|
This GDB was configured as "sparc-sun-sunos4.1.3"
|
|
|
|
^Z^Zpre-prompt
|
|
(gdb)
|
|
^Z^Zprompt
|
|
quit
|
|
|
|
^Z^Zpost-prompt
|
|
$
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
Here <SAMP>`quit'</SAMP> is input to GDB; the rest is output from
|
|
GDB. The three lines beginning <SAMP>`^Z^Z'</SAMP> (where <SAMP>`^Z'</SAMP>
|
|
denotes a <SAMP>`control-z'</SAMP> character) are annotations; the rest is
|
|
output from GDB.
|
|
</P><P>
|
|
|
|
<A NAME="Server Prefix"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC206"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC205"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC207"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC207"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 23.2 The Server Prefix </H2>
|
|
<!--docid::SEC206::-->
|
|
<P>
|
|
|
|
To issue a command to GDB without affecting certain aspects of
|
|
the state which is seen by users, prefix it with <SAMP>`server '</SAMP>. This
|
|
means that this command will not affect the command history, nor will it
|
|
affect GDB's notion of which command to repeat if <KBD>RET</KBD> is
|
|
pressed on a line by itself.
|
|
</P><P>
|
|
|
|
The server prefix does not affect the recording of values into the value
|
|
history; to print a value without recording it into the value history,
|
|
use the <CODE>output</CODE> command instead of the <CODE>print</CODE> command.
|
|
</P><P>
|
|
|
|
<A NAME="Value Annotations"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC207"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC206"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC208"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC208"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 23.3 Values </H2>
|
|
<!--docid::SEC207::-->
|
|
<P>
|
|
|
|
<A NAME="IDX925"></A>
|
|
When a value is printed in various contexts, GDB uses
|
|
annotations to delimit the value from the surrounding text.
|
|
</P><P>
|
|
|
|
<A NAME="IDX926"></A>
|
|
<A NAME="IDX927"></A>
|
|
<A NAME="IDX928"></A>
|
|
If a value is printed using <CODE>print</CODE> and added to the value history,
|
|
the annotation looks like
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zvalue-history-begin <VAR>history-number</VAR> <VAR>value-flags</VAR>
|
|
<VAR>history-string</VAR>
|
|
^Z^Zvalue-history-value
|
|
<VAR>the-value</VAR>
|
|
^Z^Zvalue-history-end
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
where <VAR>history-number</VAR> is the number it is getting in the value
|
|
history, <VAR>history-string</VAR> is a string, such as <SAMP>`$5 = '</SAMP>, which
|
|
introduces the value to the user, <VAR>the-value</VAR> is the output
|
|
corresponding to the value itself, and <VAR>value-flags</VAR> is <SAMP>`*'</SAMP> for
|
|
a value which can be dereferenced and <SAMP>`-'</SAMP> for a value which cannot.
|
|
</P><P>
|
|
|
|
<A NAME="IDX929"></A>
|
|
<A NAME="IDX930"></A>
|
|
If the value is not added to the value history (it is an invalid float
|
|
or it is printed with the <CODE>output</CODE> command), the annotation is similar:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zvalue-begin <VAR>value-flags</VAR>
|
|
<VAR>the-value</VAR>
|
|
^Z^Zvalue-end
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
<A NAME="IDX931"></A>
|
|
<A NAME="IDX932"></A>
|
|
<A NAME="IDX933"></A>
|
|
<A NAME="IDX934"></A>
|
|
When GDB prints an argument to a function (for example, in the output
|
|
from the <CODE>backtrace</CODE> command), it annotates it as follows:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zarg-begin
|
|
<VAR>argument-name</VAR>
|
|
^Z^Zarg-name-end
|
|
<VAR>separator-string</VAR>
|
|
^Z^Zarg-value <VAR>value-flags</VAR>
|
|
<VAR>the-value</VAR>
|
|
^Z^Zarg-end
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
where <VAR>argument-name</VAR> is the name of the argument,
|
|
<VAR>separator-string</VAR> is text which separates the name from the value
|
|
for the user's benefit (such as <SAMP>`='</SAMP>), and <VAR>value-flags</VAR> and
|
|
<VAR>the-value</VAR> have the same meanings as in a
|
|
<CODE>value-history-begin</CODE> annotation.
|
|
</P><P>
|
|
|
|
<A NAME="IDX935"></A>
|
|
<A NAME="IDX936"></A>
|
|
<A NAME="IDX937"></A>
|
|
<A NAME="IDX938"></A>
|
|
When printing a structure, GDB annotates it as follows:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zfield-begin <VAR>value-flags</VAR>
|
|
<VAR>field-name</VAR>
|
|
^Z^Zfield-name-end
|
|
<VAR>separator-string</VAR>
|
|
^Z^Zfield-value
|
|
<VAR>the-value</VAR>
|
|
^Z^Zfield-end
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
where <VAR>field-name</VAR> is the name of the field, <VAR>separator-string</VAR>
|
|
is text which separates the name from the value for the user's benefit
|
|
(such as <SAMP>`='</SAMP>), and <VAR>value-flags</VAR> and <VAR>the-value</VAR> have the
|
|
same meanings as in a <CODE>value-history-begin</CODE> annotation.
|
|
</P><P>
|
|
|
|
When printing an array, GDB annotates it as follows:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zarray-section-begin <VAR>array-index</VAR> <VAR>value-flags</VAR>
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
where <VAR>array-index</VAR> is the index of the first element being
|
|
annotated and <VAR>value-flags</VAR> has the same meaning as in a
|
|
<CODE>value-history-begin</CODE> annotation. This is followed by any number
|
|
of elements, where is element can be either a single element:
|
|
</P><P>
|
|
|
|
<A NAME="IDX939"></A>
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre><SAMP>`,'</SAMP> <VAR>whitespace</VAR> ; omitted for the first element
|
|
<VAR>the-value</VAR>
|
|
^Z^Zelt
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
or a repeated element
|
|
</P><P>
|
|
|
|
<A NAME="IDX940"></A>
|
|
<A NAME="IDX941"></A>
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre><SAMP>`,'</SAMP> <VAR>whitespace</VAR> ; omitted for the first element
|
|
<VAR>the-value</VAR>
|
|
^Z^Zelt-rep <VAR>number-of-repititions</VAR>
|
|
<VAR>repetition-string</VAR>
|
|
^Z^Zelt-rep-end
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
In both cases, <VAR>the-value</VAR> is the output for the value of the
|
|
element and <VAR>whitespace</VAR> can contain spaces, tabs, and newlines. In
|
|
the repeated case, <VAR>number-of-repititons</VAR> is the number of
|
|
consecutive array elements which contain that value, and
|
|
<VAR>repetition-string</VAR> is a string which is designed to convey to the
|
|
user that repitition is being depicted.
|
|
</P><P>
|
|
|
|
<A NAME="IDX942"></A>
|
|
Once all the array elements have been output, the array annotation is
|
|
ended with
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zarray-section-end
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
<A NAME="Frame Annotations"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC208"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC207"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC209"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC209"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 23.4 Frames </H2>
|
|
<!--docid::SEC208::-->
|
|
<P>
|
|
|
|
<A NAME="IDX943"></A>
|
|
Whenever GDB prints a frame, it annotates it. For example, this applies
|
|
to frames printed when GDB stops, output from commands such as
|
|
<CODE>backtrace</CODE> or <CODE>up</CODE>, etc.
|
|
</P><P>
|
|
|
|
<A NAME="IDX944"></A>
|
|
The frame annotation begins with
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zframe-begin <VAR>level</VAR> <VAR>address</VAR>
|
|
<VAR>level-string</VAR>
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
where <VAR>level</VAR> is the number of the frame (0 is the innermost frame,
|
|
and other frames have positive numbers), <VAR>address</VAR> is the address of
|
|
the code executing in that frame, and <VAR>level-string</VAR> is a string
|
|
designed to convey the level to the user. <VAR>address</VAR> is in the form
|
|
<SAMP>`0x'</SAMP> followed by one or more lowercase hex digits (note that this
|
|
does not depend on the language). The frame ends with
|
|
</P><P>
|
|
|
|
<A NAME="IDX945"></A>
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zframe-end
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
Between these annotations is the main body of the frame, which can
|
|
consist of
|
|
</P><P>
|
|
|
|
<UL>
|
|
<LI>
|
|
<A NAME="IDX946"></A>
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zfunction-call
|
|
<VAR>function-call-string</VAR>
|
|
</FONT></pre></td></tr></table><P>
|
|
|
|
where <VAR>function-call-string</VAR> 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.
|
|
</P><P>
|
|
|
|
<LI>
|
|
<A NAME="IDX947"></A>
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zsignal-handler-caller
|
|
<VAR>signal-handler-caller-string</VAR>
|
|
</FONT></pre></td></tr></table><P>
|
|
|
|
where <VAR>signal-handler-caller-string</VAR> 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).
|
|
</P><P>
|
|
|
|
<LI>
|
|
A normal frame.
|
|
<P>
|
|
|
|
<A NAME="IDX948"></A>
|
|
<A NAME="IDX949"></A>
|
|
This can optionally (depending on whether this is thought of as
|
|
interesting information for the user to see) begin with
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zframe-address
|
|
<VAR>address</VAR>
|
|
^Z^Zframe-address-end
|
|
<VAR>separator-string</VAR>
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
where <VAR>address</VAR> is the address executing in the frame (the same
|
|
address as in the <CODE>frame-begin</CODE> annotation, but printed in a form
|
|
which is intended for user consumption--in particular, the syntax varies
|
|
depending on the language), and <VAR>separator-string</VAR> is a string
|
|
intended to separate this address from what follows for the user's
|
|
benefit.
|
|
</P><P>
|
|
|
|
<A NAME="IDX950"></A>
|
|
<A NAME="IDX951"></A>
|
|
Then comes
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zframe-function-name
|
|
<VAR>function-name</VAR>
|
|
^Z^Zframe-args
|
|
<VAR>arguments</VAR>
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
where <VAR>function-name</VAR> is the name of the function executing in the
|
|
frame, or <SAMP>`??'</SAMP> if not known, and <VAR>arguments</VAR> are the arguments
|
|
to the frame, with parentheses around them (each argument is annotated
|
|
individually as well, see section <A HREF="gdb_24.html#SEC207">23.3 Values</A>).
|
|
</P><P>
|
|
|
|
<A NAME="IDX952"></A>
|
|
<A NAME="IDX953"></A>
|
|
<A NAME="IDX954"></A>
|
|
<A NAME="IDX955"></A>
|
|
<A NAME="IDX956"></A>
|
|
If source information is available, a reference to it is then printed:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zframe-source-begin
|
|
<VAR>source-intro-string</VAR>
|
|
^Z^Zframe-source-file
|
|
<VAR>filename</VAR>
|
|
^Z^Zframe-source-file-end
|
|
:
|
|
^Z^Zframe-source-line
|
|
<VAR>line-number</VAR>
|
|
^Z^Zframe-source-end
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
where <VAR>source-intro-string</VAR> separates for the user's benefit the
|
|
reference from the text which precedes it, <VAR>filename</VAR> is the name of
|
|
the source file, and <VAR>line-number</VAR> is the line number within that
|
|
file (the first line is line 1).
|
|
</P><P>
|
|
|
|
<A NAME="IDX957"></A>
|
|
If GDB prints some information about where the frame is from (which
|
|
library, which load segment, etc.; currently only done on the RS/6000),
|
|
it is annotated with
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zframe-where
|
|
<VAR>information</VAR>
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
Then, if source is to actually be displayed for this frame (for example,
|
|
this is not true for output from the <CODE>backtrace</CODE> command), then a
|
|
<CODE>source</CODE> annotation (see section <A HREF="gdb_24.html#SEC215">23.11 Displaying Source</A>) is displayed. Unlike
|
|
most annotations, this is output instead of the normal text which would be
|
|
output, not in addition.
|
|
</UL>
|
|
<P>
|
|
|
|
<A NAME="Displays"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC209"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC208"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC210"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC210"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 23.5 Displays </H2>
|
|
<!--docid::SEC209::-->
|
|
<P>
|
|
|
|
<A NAME="IDX958"></A>
|
|
<A NAME="IDX959"></A>
|
|
<A NAME="IDX960"></A>
|
|
<A NAME="IDX961"></A>
|
|
<A NAME="IDX962"></A>
|
|
<A NAME="IDX963"></A>
|
|
<A NAME="IDX964"></A>
|
|
<A NAME="IDX965"></A>
|
|
When GDB is told to display something using the <CODE>display</CODE> command,
|
|
the results of the display are annotated:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zdisplay-begin
|
|
<VAR>number</VAR>
|
|
^Z^Zdisplay-number-end
|
|
<VAR>number-separator</VAR>
|
|
^Z^Zdisplay-format
|
|
<VAR>format</VAR>
|
|
^Z^Zdisplay-expression
|
|
<VAR>expression</VAR>
|
|
^Z^Zdisplay-expression-end
|
|
<VAR>expression-separator</VAR>
|
|
^Z^Zdisplay-value
|
|
<VAR>value</VAR>
|
|
^Z^Zdisplay-end
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
where <VAR>number</VAR> is the number of the display, <VAR>number-separator</VAR>
|
|
is intended to separate the number from what follows for the user,
|
|
<VAR>format</VAR> includes information such as the size, format, or other
|
|
information about how the value is being displayed, <VAR>expression</VAR> is
|
|
the expression being displayed, <VAR>expression-separator</VAR> is intended
|
|
to separate the expression from the text that follows for the user,
|
|
and <VAR>value</VAR> is the actual value being displayed.
|
|
</P><P>
|
|
|
|
<A NAME="Prompting"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC210"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC209"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC211"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC211"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 23.6 Annotation for GDB Input </H2>
|
|
<!--docid::SEC210::-->
|
|
<P>
|
|
|
|
<A NAME="IDX966"></A>
|
|
When GDB prompts for input, it annotates this fact so it is possible
|
|
to know when to send output, when the output from a given command is
|
|
over, etc.
|
|
</P><P>
|
|
|
|
Different kinds of input each have a different <EM>input type</EM>. Each
|
|
input type has three annotations: a <CODE>pre-</CODE> annotation, which
|
|
denotes the beginning of any prompt which is being output, a plain
|
|
annotation, which denotes the end of the prompt, and then a <CODE>post-</CODE>
|
|
annotation which denotes the end of any echo which may (or may not) be
|
|
associated with the input. For example, the <CODE>prompt</CODE> input type
|
|
features the following annotations:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zpre-prompt
|
|
^Z^Zprompt
|
|
^Z^Zpost-prompt
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
The input types are
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<A NAME="IDX967"></A>
|
|
<A NAME="IDX968"></A>
|
|
<A NAME="IDX969"></A>
|
|
<DT><CODE>prompt</CODE>
|
|
<DD>When GDB is prompting for a command (the main GDB prompt).
|
|
<P>
|
|
|
|
<A NAME="IDX970"></A>
|
|
<A NAME="IDX971"></A>
|
|
<A NAME="IDX972"></A>
|
|
<DT><CODE>commands</CODE>
|
|
<DD>When GDB prompts for a set of commands, like in the <CODE>commands</CODE>
|
|
command. The annotations are repeated for each command which is input.
|
|
<P>
|
|
|
|
<A NAME="IDX973"></A>
|
|
<A NAME="IDX974"></A>
|
|
<A NAME="IDX975"></A>
|
|
<DT><CODE>overload-choice</CODE>
|
|
<DD>When GDB wants the user to select between various overloaded functions.
|
|
<P>
|
|
|
|
<A NAME="IDX976"></A>
|
|
<A NAME="IDX977"></A>
|
|
<A NAME="IDX978"></A>
|
|
<DT><CODE>query</CODE>
|
|
<DD>When GDB wants the user to confirm a potentially dangerous operation.
|
|
<P>
|
|
|
|
<A NAME="IDX979"></A>
|
|
<A NAME="IDX980"></A>
|
|
<A NAME="IDX981"></A>
|
|
<DT><CODE>prompt-for-continue</CODE>
|
|
<DD>When GDB is asking the user to press return to continue. Note: Don't
|
|
expect this to work well; instead use <CODE>set height 0</CODE> to disable
|
|
prompting. This is because the counting of lines is buggy in the
|
|
presence of annotations.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Errors"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC211"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC210"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC212"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC212"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 23.7 Errors </H2>
|
|
<!--docid::SEC211::-->
|
|
<P>
|
|
|
|
<A NAME="IDX982"></A>
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zquit
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
This annotation occurs right before GDB responds to an interrupt.
|
|
</P><P>
|
|
|
|
<A NAME="IDX983"></A>
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zerror
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
This annotation occurs right before GDB responds to an error.
|
|
</P><P>
|
|
|
|
Quit and error annotations indicate that any annotations which GDB was
|
|
in the middle of may end abruptly. For example, if a
|
|
<CODE>value-history-begin</CODE> annotation is followed by a <CODE>error</CODE>, one
|
|
cannot expect to receive the matching <CODE>value-history-end</CODE>. One
|
|
cannot expect not to receive it either, however; an error annotation
|
|
does not necessarily mean that GDB is immediately returning all the way
|
|
to the top level.
|
|
</P><P>
|
|
|
|
<A NAME="IDX984"></A>
|
|
A quit or error annotation may be preceded by
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zerror-begin
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
Any output between that and the quit or error annotation is the error
|
|
message.
|
|
</P><P>
|
|
|
|
Warning messages are not yet annotated.
|
|
</P><P>
|
|
|
|
<A NAME="Breakpoint Info"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC212"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC211"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC213"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC213"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 23.8 Information on Breakpoints </H2>
|
|
<!--docid::SEC212::-->
|
|
<P>
|
|
|
|
<A NAME="IDX985"></A>
|
|
The output from the <CODE>info breakpoints</CODE> command is annotated as follows:
|
|
</P><P>
|
|
|
|
<A NAME="IDX986"></A>
|
|
<A NAME="IDX987"></A>
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zbreakpoints-headers
|
|
<VAR>header-entry</VAR>
|
|
^Z^Zbreakpoints-table
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
where <VAR>header-entry</VAR> has the same syntax as an entry (see below) but
|
|
instead of containing data, it contains strings which are intended to
|
|
convey the meaning of each field to the user. This is followed by any
|
|
number of entries. If a field does not apply for this entry, it is
|
|
omitted. Fields may contain trailing whitespace. Each entry consists
|
|
of:
|
|
</P><P>
|
|
|
|
<A NAME="IDX988"></A>
|
|
<A NAME="IDX989"></A>
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zrecord
|
|
^Z^Zfield 0
|
|
<VAR>number</VAR>
|
|
^Z^Zfield 1
|
|
<VAR>type</VAR>
|
|
^Z^Zfield 2
|
|
<VAR>disposition</VAR>
|
|
^Z^Zfield 3
|
|
<VAR>enable</VAR>
|
|
^Z^Zfield 4
|
|
<VAR>address</VAR>
|
|
^Z^Zfield 5
|
|
<VAR>what</VAR>
|
|
^Z^Zfield 6
|
|
<VAR>frame</VAR>
|
|
^Z^Zfield 7
|
|
<VAR>condition</VAR>
|
|
^Z^Zfield 8
|
|
<VAR>ignore-count</VAR>
|
|
^Z^Zfield 9
|
|
<VAR>commands</VAR>
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
Note that <VAR>address</VAR> is intended for user consumption--the syntax
|
|
varies depending on the language.
|
|
</P><P>
|
|
|
|
The output ends with
|
|
</P><P>
|
|
|
|
<A NAME="IDX990"></A>
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zbreakpoints-table-end
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
<A NAME="Invalidation"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC213"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC212"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC214"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 23.9 Invalidation Notices </H2>
|
|
<!--docid::SEC213::-->
|
|
<P>
|
|
|
|
<A NAME="IDX991"></A>
|
|
The following annotations say that certain pieces of state may have
|
|
changed.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<A NAME="IDX992"></A>
|
|
<DT><CODE>^Z^Zframes-invalid</CODE>
|
|
<DD><P>
|
|
|
|
The frames (for example, output from the <CODE>backtrace</CODE> command) may
|
|
have changed.
|
|
</P><P>
|
|
|
|
<A NAME="IDX993"></A>
|
|
<DT><CODE>^Z^Zbreakpoints-invalid</CODE>
|
|
<DD><P>
|
|
|
|
The breakpoints may have changed. For example, the user just added or
|
|
deleted a breakpoint.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Annotations for Running"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC214"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC213"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC215"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC206"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 23.10 Running the Program </H2>
|
|
<!--docid::SEC214::-->
|
|
<P>
|
|
|
|
<A NAME="IDX994"></A>
|
|
<A NAME="IDX995"></A>
|
|
When the program starts executing due to a GDB command such as
|
|
<CODE>step</CODE> or <CODE>continue</CODE>,
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zstarting
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
is output. When the program stops,
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zstopped
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
is output. Before the <CODE>stopped</CODE> annotation, a variety of
|
|
annotations describe how the program stopped.
|
|
</P><P>
|
|
|
|
<DL COMPACT>
|
|
<A NAME="IDX996"></A>
|
|
<DT><CODE>^Z^Zexited <VAR>exit-status</VAR></CODE>
|
|
<DD>The program exited, and <VAR>exit-status</VAR> is the exit status (zero for
|
|
successful exit, otherwise nonzero).
|
|
<P>
|
|
|
|
<A NAME="IDX997"></A>
|
|
<A NAME="IDX998"></A>
|
|
<A NAME="IDX999"></A>
|
|
<A NAME="IDX1000"></A>
|
|
<A NAME="IDX1001"></A>
|
|
<DT><CODE>^Z^Zsignalled</CODE>
|
|
<DD>The program exited with a signal. After the <CODE>^Z^Zsignalled</CODE>, the
|
|
annotation continues:
|
|
<P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre><VAR>intro-text</VAR>
|
|
^Z^Zsignal-name
|
|
<VAR>name</VAR>
|
|
^Z^Zsignal-name-end
|
|
<VAR>middle-text</VAR>
|
|
^Z^Zsignal-string
|
|
<VAR>string</VAR>
|
|
^Z^Zsignal-string-end
|
|
<VAR>end-text</VAR>
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
where <VAR>name</VAR> is the name of the signal, such as <CODE>SIGILL</CODE> or
|
|
<CODE>SIGSEGV</CODE>, and <VAR>string</VAR> is the explanation of the signal, such
|
|
as <CODE>Illegal Instruction</CODE> or <CODE>Segmentation fault</CODE>.
|
|
<VAR>intro-text</VAR>, <VAR>middle-text</VAR>, and <VAR>end-text</VAR> are for the
|
|
user's benefit and have no particular format.
|
|
</P><P>
|
|
|
|
<A NAME="IDX1002"></A>
|
|
<DT><CODE>^Z^Zsignal</CODE>
|
|
<DD>The syntax of this annotation is just like <CODE>signalled</CODE>, but GDB is
|
|
just saying that the program received the signal, not that it was
|
|
terminated with it.
|
|
<P>
|
|
|
|
<A NAME="IDX1003"></A>
|
|
<DT><CODE>^Z^Zbreakpoint <VAR>number</VAR></CODE>
|
|
<DD>The program hit breakpoint number <VAR>number</VAR>.
|
|
<P>
|
|
|
|
<A NAME="IDX1004"></A>
|
|
<DT><CODE>^Z^Zwatchpoint <VAR>number</VAR></CODE>
|
|
<DD>The program hit watchpoint number <VAR>number</VAR>.
|
|
</DL>
|
|
<P>
|
|
|
|
<A NAME="Source Annotations"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC215"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC214"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC216"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC206"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 23.11 Displaying Source </H2>
|
|
<!--docid::SEC215::-->
|
|
<P>
|
|
|
|
<A NAME="IDX1005"></A>
|
|
The following annotation is used instead of displaying source code:
|
|
</P><P>
|
|
|
|
<TABLE><tr><td> </td><td class=smallexample><FONT SIZE=-1><pre>^Z^Zsource <VAR>filename</VAR>:<VAR>line</VAR>:<VAR>character</VAR>:<VAR>middle</VAR>:<VAR>addr</VAR>
|
|
</FONT></pre></td></tr></table></P><P>
|
|
|
|
where <VAR>filename</VAR> is an absolute file name indicating which source
|
|
file, <VAR>line</VAR> is the line number within that file (where 1 is the
|
|
first line in the file), <VAR>character</VAR> is the character position
|
|
within the file (where 0 is the first character in the file) (for most
|
|
debug formats this will necessarily point to the beginning of a line),
|
|
<VAR>middle</VAR> is <SAMP>`middle'</SAMP> if <VAR>addr</VAR> is in the middle of the
|
|
line, or <SAMP>`beg'</SAMP> if <VAR>addr</VAR> is at the beginning of the line, and
|
|
<VAR>addr</VAR> is the address in the target program associated with the
|
|
source which is being displayed. <VAR>addr</VAR> is in the form <SAMP>`0x'</SAMP>
|
|
followed by one or more lowercase hex digits (note that this does not
|
|
depend on the language).
|
|
</P><P>
|
|
|
|
<A NAME="TODO"></A>
|
|
<HR SIZE="6">
|
|
<A NAME="SEC216"></A>
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC215"> < </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> > </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC206"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC204"> Up </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<H2> 23.12 Annotations We Might Want in the Future </H2>
|
|
<!--docid::SEC216::-->
|
|
<P>
|
|
|
|
<TABLE><tr><td> </td><td class=display><pre style="font-family: serif"> - target-invalid
|
|
the target might have changed (registers, heap contents, or
|
|
execution status). For performance, we might eventually want
|
|
to hit `registers-invalid' and `all-registers-invalid' with
|
|
greater precision
|
|
|
|
- systematic annotation for set/show parameters (including
|
|
invalidation notices).
|
|
|
|
- similarly, `info' returns a list of candidates for invalidation
|
|
notices.
|
|
</pre></td></tr></table></P><P>
|
|
|
|
<A NAME="GDB/MI"></A>
|
|
<HR SIZE="6">
|
|
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
|
|
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC206"> << </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> >> </A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT"> <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top">Top</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_toc.html#SEC_Contents">Contents</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_35.html#SEC643">Index</A>]</TD>
|
|
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
|
|
</TR></TABLE>
|
|
<BR>
|
|
<FONT SIZE="-1">
|
|
|
|
<address>
|
|
|
|
<p>Please send FSF & GNU inquiries & questions to <a
|
|
href="mailto:gnu@gnu.org">gnu@gnu.org</a>. There are also <a
|
|
href="http://www.gnu.org/home.html#ContactInfo">other ways to
|
|
contact</a> the FSF.</p>
|
|
|
|
<p>These pages are maintained by <a
|
|
href="http://www.gnu.org/software/gdb/">the GDB developers</a>.</p>
|
|
|
|
<p>Copyright Free Software Foundation, Inc., 59 Temple Place - Suite
|
|
330, Boston, MA 02111, USA.</p>
|
|
|
|
<p>Verbatim copying and distribution of this entire article is
|
|
permitted in any medium, provided this notice is preserved.</p>
|
|
|
|
</address>
|
|
|
|
This document was generated
|
|
by <I>GDB Administrator</I> on <I>November, 11 2002</I>
|
|
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
|
|
"><I>texi2html</I></A>
|
|
|
|
</BODY>
|
|
</HTML>
|