neingeist
/
arduinisten
Archived
1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

527 lines
23 KiB
HTML

<HTML>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!-- Created on March, 27 2008 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="SEC646"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC608"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC647"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_4.html#SEC14"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_27.html#SEC654"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <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_38.html#SEC764">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1> 25. GDB Annotations </H1>
<!--docid::SEC646::-->
<P>
This chapter describes annotations in GDB. Annotations were
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>
The annotation mechanism has largely been superseded by GDB/MI
(see section <A HREF="gdb_25.html#SEC242">24. The GDB/MI Interface</A>).
</P><P>
<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_26.html#SEC647">25.1 What is an Annotation?</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">What annotations are; the general syntax.</TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_26.html#SEC648">25.2 The Server Prefix</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Issuing a command without affecting user state.</TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_26.html#SEC649">25.3 Annotation for GDB Input</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Annotations marking GDB's need for input.</TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_26.html#SEC650">25.4 Errors</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Annotations for error messages.</TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_26.html#SEC651">25.5 Invalidation Notices</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Some annotations describe things now invalid.</TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_26.html#SEC652">25.6 Running the Program</A></TD><TD>&nbsp;&nbsp;</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_26.html#SEC653">25.7 Displaying Source</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP">Annotations describing source code.</TD></TR>
</TABLE></BLOCKQUOTE>
<P>
<A NAME="Annotations Overview"></A>
<HR SIZE="6">
<A NAME="SEC647"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC646"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC648"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC646"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC646"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_27.html#SEC654"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <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_38.html#SEC764">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 25.1 What is an Annotation? </H2>
<!--docid::SEC647::-->
<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>
The annotation <VAR>level</VAR>, which is specified using the
<SAMP>`--annotate'</SAMP> command line option (see section <A HREF="gdb_3.html#SEC9">2.1.2 Choosing Modes</A>), controls
how much information GDB prints together with its prompt,
values of expressions, source lines, and other types of output. Level 0
is for no annotations, level 1 is for use when GDB is run as a
subprocess of GNU Emacs, level 3 is the maximum annotation suitable
for programs that control GDB, and level 2 annotations have
been made obsolete (see section `Limitations of the Annotation Interface' in <CITE>GDB's Obsolete Annotations</CITE>).
</P><P>
<DL COMPACT>
<A NAME="IDX1290"></A>
<DT><CODE>set annotate <VAR>level</VAR></CODE>
<DD>The GDB command <CODE>set annotate</CODE> sets the level of
annotations to the specified <VAR>level</VAR>.
<P>
<DT><CODE>show annotate</CODE>
<DD><A NAME="IDX1291"></A>
Show the current annotation level.
</DL>
<P>
This chapter describes level 3 annotations.
</P><P>
A simple example of starting up GDB with annotations is:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>$ <KBD>gdb --annotate=3</KBD>
GNU gdb 6.0
Copyright 2003 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 "i386-pc-linux-gnu"
^Z^Zpre-prompt
(gdb)
^Z^Zprompt
<KBD>quit</KBD>
^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="SEC648"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC647"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC649"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC649"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC646"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_27.html#SEC654"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <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_38.html#SEC764">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 25.2 The Server Prefix </H2>
<!--docid::SEC648::-->
<P>
If you prefix a command with <SAMP>`server '</SAMP> then it 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. This
means that commands can be run behind a user's back by a front-end in
a transparent manner.
</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="Prompting"></A>
<HR SIZE="6">
<A NAME="SEC649"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC648"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC650"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC650"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC646"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_27.html#SEC654"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <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_38.html#SEC764">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 25.3 Annotation for GDB Input </H2>
<!--docid::SEC649::-->
<P>
<A NAME="IDX1292"></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>&nbsp;</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="IDX1293"></A>
<A NAME="IDX1294"></A>
<A NAME="IDX1295"></A>
<DT><CODE>prompt</CODE>
<DD>When GDB is prompting for a command (the main GDB prompt).
<P>
<A NAME="IDX1296"></A>
<A NAME="IDX1297"></A>
<A NAME="IDX1298"></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="IDX1299"></A>
<A NAME="IDX1300"></A>
<A NAME="IDX1301"></A>
<DT><CODE>overload-choice</CODE>
<DD>When GDB wants the user to select between various overloaded functions.
<P>
<A NAME="IDX1302"></A>
<A NAME="IDX1303"></A>
<A NAME="IDX1304"></A>
<DT><CODE>query</CODE>
<DD>When GDB wants the user to confirm a potentially dangerous operation.
<P>
<A NAME="IDX1305"></A>
<A NAME="IDX1306"></A>
<A NAME="IDX1307"></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="SEC650"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC649"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC651"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC651"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC646"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_27.html#SEC654"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <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_38.html#SEC764">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 25.4 Errors </H2>
<!--docid::SEC650::-->
<P>
<A NAME="IDX1308"></A>
<TABLE><tr><td>&nbsp;</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="IDX1309"></A>
<TABLE><tr><td>&nbsp;</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="IDX1310"></A>
A quit or error annotation may be preceded by
</P><P>
<TABLE><tr><td>&nbsp;</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="Invalidation"></A>
<HR SIZE="6">
<A NAME="SEC651"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC650"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC652"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC652"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC646"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_27.html#SEC654"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <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_38.html#SEC764">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 25.5 Invalidation Notices </H2>
<!--docid::SEC651::-->
<P>
<A NAME="IDX1311"></A>
The following annotations say that certain pieces of state may have
changed.
</P><P>
<DL COMPACT>
<A NAME="IDX1312"></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="IDX1313"></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="SEC652"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC651"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC653"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC653"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC646"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_27.html#SEC654"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <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_38.html#SEC764">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 25.6 Running the Program </H2>
<!--docid::SEC652::-->
<P>
<A NAME="IDX1314"></A>
<A NAME="IDX1315"></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>&nbsp;</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>&nbsp;</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="IDX1316"></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="IDX1317"></A>
<A NAME="IDX1318"></A>
<A NAME="IDX1319"></A>
<A NAME="IDX1320"></A>
<A NAME="IDX1321"></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>&nbsp;</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="IDX1322"></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="IDX1323"></A>
<DT><CODE>^Z^Zbreakpoint <VAR>number</VAR></CODE>
<DD>The program hit breakpoint number <VAR>number</VAR>.
<P>
<A NAME="IDX1324"></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="SEC653"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC652"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_27.html#SEC654"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC646"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC646"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_27.html#SEC654"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <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_38.html#SEC764">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 25.7 Displaying Source </H2>
<!--docid::SEC653::-->
<P>
<A NAME="IDX1325"></A>
The following annotation is used instead of displaying source code:
</P><P>
<TABLE><tr><td>&nbsp;</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="GDB Bugs"></A>
<HR SIZE="6">
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC646"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_27.html#SEC654"> &gt;&gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <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_38.html#SEC764">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 &amp; GNU inquiries &amp; 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>March, 27 2008</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
</BODY>
</HTML>