Files
oldlinux-files/Ref-docs/manual gdb/gdb/gdb_25.html
2024-02-19 00:21:47 -05:00

5111 lines
158 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: GDB/MI</TITLE>
<META NAME="description" CONTENT="Debugging with GDB: GDB/MI">
<META NAME="keywords" CONTENT="Debugging with GDB: GDB/MI">
<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="SEC217"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_24.html#SEC216"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC218"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_4.html#SEC12"> &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_26.html#SEC595"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H1> 24. The GDB/MI Interface </H1>
<!--docid::SEC217::-->
<P>
<HR SIZE="6">
<A NAME="SEC218"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC219"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> Function and Purpose </H2>
<!--docid::SEC218::-->
<P>
<A NAME="IDX1006"></A>
GDB/MI is a line based machine oriented text interface to GDB. It is
specifically intended to support the development of systems which use
the debugger as just one small component of a larger system.
</P><P>
This chapter is a specification of the GDB/MI interface. It is written
in the form of a reference manual.
</P><P>
Note that GDB/MI is still under construction, so some of the
features described below are incomplete and subject to change.
</P><P>
<HR SIZE="6">
<A NAME="SEC219"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC218"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC221"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[ &lt;&lt; ]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb.html#SEC_Top"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[ &gt;&gt; ]</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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> Notation and Terminology </H2>
<!--docid::SEC219::-->
<P>
<A NAME="IDX1007"></A>
This chapter uses the following notation:
</P><P>
<UL>
<LI>
<CODE>|</CODE> separates two alternatives.
<P>
<LI>
<CODE>[ <VAR>something</VAR> ]</CODE> indicates that <VAR>something</VAR> is optional:
it may or may not be given.
<P>
<LI>
<CODE>( <VAR>group</VAR> )*</CODE> means that <VAR>group</VAR> inside the parentheses
may repeat zero or more times.
<P>
<LI>
<CODE>( <VAR>group</VAR> )+</CODE> means that <VAR>group</VAR> inside the parentheses
may repeat one or more times.
<P>
<LI>
<CODE>"<VAR>string</VAR>"</CODE> means a literal <VAR>string</VAR>.
</UL>
<P>
<A NAME="SEC220"></A>
<H2> Acknowledgments </H2>
<!--docid::SEC220::-->
<P>
In alphabetic order: Andrew Cagney, Fernando Nasser, Stan Shebs and
Elena Zannoni.
</P><P>
<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC221">24.1 GDB/MI Command Syntax</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC229">24.2 GDB/MI Compatibility with CLI</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC230">24.3 GDB/MI Output Records</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC234">24.4 GDB/MI Command Description Format</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC244">24.5 GDB/MI Breakpoint table commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC282">24.6 GDB/MI Data Manipulation</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC344">24.7 GDB/MI Program control</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC427">24.8 Miscellaneous GDB commands in GDB/MI</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC444">24.9 GDB/MI Stack Manipulation Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC469">24.10 GDB/MI Symbol Query Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC510">24.11 GDB/MI Target Manipulation Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC547">24.12 GDB/MI Thread Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC564">24.13 GDB/MI Tracepoint Commands</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC565">24.14 GDB/MI Variable Objects</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
</TABLE></BLOCKQUOTE>
<P>
<A NAME="GDB/MI Command Syntax"></A>
<HR SIZE="6">
<A NAME="SEC221"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC219"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC222"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC229"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 24.1 GDB/MI Command Syntax </H2>
<!--docid::SEC221::-->
<P>
<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC222">24.1.1 GDB/MI Input Syntax</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC223">24.1.2 GDB/MI Output Syntax</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC224">24.1.3 Simple Examples of GDB/MI Interaction</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
</TABLE></BLOCKQUOTE>
<P>
<A NAME="GDB/MI Input Syntax"></A>
<HR SIZE="6">
<A NAME="SEC222"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC221"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC223"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC221"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC229"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 24.1.1 GDB/MI Input Syntax </H3>
<!--docid::SEC222::-->
<P>
<A NAME="IDX1008"></A>
<A NAME="IDX1009"></A>
<DL COMPACT>
<DT><CODE><VAR>command</VAR> ==></CODE>
<DD><CODE><VAR>cli-command</VAR> | <VAR>mi-command</VAR></CODE>
<P>
<DT><CODE><VAR>cli-command</VAR> ==></CODE>
<DD><CODE>[ <VAR>token</VAR> ] <VAR>cli-command</VAR> <VAR>nl</VAR></CODE>, where
<VAR>cli-command</VAR> is any existing GDB CLI command.
<P>
<DT><CODE><VAR>mi-command</VAR> ==></CODE>
<DD><CODE>[ <VAR>token</VAR> ] "-" <VAR>operation</VAR> ( " " <VAR>option</VAR> )*
<CODE>[</CODE> " --" <CODE>]</CODE> ( " " <VAR>parameter</VAR> )* <VAR>nl</VAR></CODE>
<P>
<DT><CODE><VAR>token</VAR> ==></CODE>
<DD>"any sequence of digits"
<P>
<DT><CODE><VAR>option</VAR> ==></CODE>
<DD><CODE>"-" <VAR>parameter</VAR> [ " " <VAR>parameter</VAR> ]</CODE>
<P>
<DT><CODE><VAR>parameter</VAR> ==></CODE>
<DD><CODE><VAR>non-blank-sequence</VAR> | <VAR>c-string</VAR></CODE>
<P>
<DT><CODE><VAR>operation</VAR> ==></CODE>
<DD><EM>any of the operations described in this chapter</EM>
<P>
<DT><CODE><VAR>non-blank-sequence</VAR> ==></CODE>
<DD><EM>anything, provided it doesn't contain special characters such as
"-", <VAR>nl</VAR>, """ and of course " "</EM>
<P>
<DT><CODE><VAR>c-string</VAR> ==></CODE>
<DD><CODE>""" <VAR>seven-bit-iso-c-string-content</VAR> """</CODE>
<P>
<DT><CODE><VAR>nl</VAR> ==></CODE>
<DD><CODE>CR | CR-LF</CODE>
</DL>
<P>
Notes:
</P><P>
<UL>
<LI>
The CLI commands are still handled by the MI interpreter; their
output is described below.
<P>
<LI>
The <CODE><VAR>token</VAR></CODE>, when present, is passed back when the command
finishes.
<P>
<LI>
Some MI commands accept optional arguments as part of the parameter
list. Each option is identified by a leading <SAMP>`-'</SAMP> (dash) and may be
followed by an optional argument parameter. Options occur first in the
parameter list and can be delimited from normal parameters using
<SAMP>`--'</SAMP> (this is useful when some parameters begin with a dash).
</UL>
<P>
Pragmatics:
</P><P>
<UL>
<LI>
We want easy access to the existing CLI syntax (for debugging).
<P>
<LI>
We want it to be easy to spot a MI operation.
</UL>
<P>
<A NAME="GDB/MI Output Syntax"></A>
<HR SIZE="6">
<A NAME="SEC223"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC222"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC224"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC224"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC221"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC229"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 24.1.2 GDB/MI Output Syntax </H3>
<!--docid::SEC223::-->
<P>
<A NAME="IDX1010"></A>
<A NAME="IDX1011"></A>
The output from GDB/MI consists of zero or more out-of-band records
followed, optionally, by a single result record. This result record
is for the most recent command. The sequence of output records is
terminated by <SAMP>`(gdb)'</SAMP>.
</P><P>
If an input command was prefixed with a <CODE><VAR>token</VAR></CODE> then the
corresponding output for that command will also be prefixed by that same
<VAR>token</VAR>.
</P><P>
<DL COMPACT>
<DT><CODE><VAR>output</VAR> ==></CODE>
<DD><CODE>( <VAR>out-of-band-record</VAR> )* [ <VAR>result-record</VAR> ] "(gdb)" <VAR>nl</VAR></CODE>
<P>
<DT><CODE><VAR>result-record</VAR> ==></CODE>
<DD><CODE> [ <VAR>token</VAR> ] "^" <VAR>result-class</VAR> ( "," <VAR>result</VAR> )* <VAR>nl</VAR></CODE>
<P>
<DT><CODE><VAR>out-of-band-record</VAR> ==></CODE>
<DD><CODE><VAR>async-record</VAR> | <VAR>stream-record</VAR></CODE>
<P>
<DT><CODE><VAR>async-record</VAR> ==></CODE>
<DD><CODE><VAR>exec-async-output</VAR> | <VAR>status-async-output</VAR> | <VAR>notify-async-output</VAR></CODE>
<P>
<DT><CODE><VAR>exec-async-output</VAR> ==></CODE>
<DD><CODE>[ <VAR>token</VAR> ] "*" <VAR>async-output</VAR></CODE>
<P>
<DT><CODE><VAR>status-async-output</VAR> ==></CODE>
<DD><CODE>[ <VAR>token</VAR> ] "+" <VAR>async-output</VAR></CODE>
<P>
<DT><CODE><VAR>notify-async-output</VAR> ==></CODE>
<DD><CODE>[ <VAR>token</VAR> ] "=" <VAR>async-output</VAR></CODE>
<P>
<DT><CODE><VAR>async-output</VAR> ==></CODE>
<DD><CODE><VAR>async-class</VAR> ( "," <VAR>result</VAR> )* <VAR>nl</VAR></CODE>
<P>
<DT><CODE><VAR>result-class</VAR> ==></CODE>
<DD><CODE>"done" | "running" | "connected" | "error" | "exit"</CODE>
<P>
<DT><CODE><VAR>async-class</VAR> ==></CODE>
<DD><CODE>"stopped" | <VAR>others</VAR></CODE> (where <VAR>others</VAR> will be added
depending on the needs--this is still in development).
<P>
<DT><CODE><VAR>result</VAR> ==></CODE>
<DD><CODE> <VAR>variable</VAR> "=" <VAR>value</VAR></CODE>
<P>
<DT><CODE><VAR>variable</VAR> ==></CODE>
<DD><CODE> <VAR>string</VAR> </CODE>
<P>
<DT><CODE><VAR>value</VAR> ==></CODE>
<DD><CODE> <VAR>const</VAR> | <VAR>tuple</VAR> | <VAR>list</VAR> </CODE>
<P>
<DT><CODE><VAR>const</VAR> ==></CODE>
<DD><CODE><VAR>c-string</VAR></CODE>
<P>
<DT><CODE><VAR>tuple</VAR> ==></CODE>
<DD><CODE> "{}" | "{" <VAR>result</VAR> ( "," <VAR>result</VAR> )* "}" </CODE>
<P>
<DT><CODE><VAR>list</VAR> ==></CODE>
<DD><CODE> "[]" | "[" <VAR>value</VAR> ( "," <VAR>value</VAR> )* "]" | "["
<VAR>result</VAR> ( "," <VAR>result</VAR> )* "]" </CODE>
<P>
<DT><CODE><VAR>stream-record</VAR> ==></CODE>
<DD><CODE><VAR>console-stream-output</VAR> | <VAR>target-stream-output</VAR> | <VAR>log-stream-output</VAR></CODE>
<P>
<DT><CODE><VAR>console-stream-output</VAR> ==></CODE>
<DD><CODE>"~" <VAR>c-string</VAR></CODE>
<P>
<DT><CODE><VAR>target-stream-output</VAR> ==></CODE>
<DD><CODE>"@" <VAR>c-string</VAR></CODE>
<P>
<DT><CODE><VAR>log-stream-output</VAR> ==></CODE>
<DD><CODE>"&#38;" <VAR>c-string</VAR></CODE>
<P>
<DT><CODE><VAR>nl</VAR> ==></CODE>
<DD><CODE>CR | CR-LF</CODE>
<P>
<DT><CODE><VAR>token</VAR> ==></CODE>
<DD><EM>any sequence of digits</EM>.
</DL>
<P>
Notes:
</P><P>
<UL>
<LI>
All output sequences end in a single line containing a period.
<P>
<LI>
The <CODE><VAR>token</VAR></CODE> is from the corresponding request. If an execution
command is interrupted by the <SAMP>`-exec-interrupt'</SAMP> command, the
<VAR>token</VAR> associated with the <SAMP>`*stopped'</SAMP> message is the one of the
original execution command, not the one of the interrupt command.
<P>
<LI>
<A NAME="IDX1012"></A>
<VAR>status-async-output</VAR> contains on-going status information about the
progress of a slow operation. It can be discarded. All status output is
prefixed by <SAMP>`+'</SAMP>.
<P>
<LI>
<A NAME="IDX1013"></A>
<VAR>exec-async-output</VAR> contains asynchronous state change on the target
(stopped, started, disappeared). All async output is prefixed by
<SAMP>`*'</SAMP>.
<P>
<LI>
<A NAME="IDX1014"></A>
<VAR>notify-async-output</VAR> contains supplementary information that the
client should handle (e.g., a new breakpoint information). All notify
output is prefixed by <SAMP>`='</SAMP>.
<P>
<LI>
<A NAME="IDX1015"></A>
<VAR>console-stream-output</VAR> is output that should be displayed as is in the
console. It is the textual response to a CLI command. All the console
output is prefixed by <SAMP>`~'</SAMP>.
<P>
<LI>
<A NAME="IDX1016"></A>
<VAR>target-stream-output</VAR> is the output produced by the target program.
All the target output is prefixed by <SAMP>`@'</SAMP>.
<P>
<LI>
<A NAME="IDX1017"></A>
<VAR>log-stream-output</VAR> is output text coming from GDB's internals, for
instance messages that should be displayed as part of an error log. All
the log output is prefixed by <SAMP>`&#38;'</SAMP>.
<P>
<LI>
<A NAME="IDX1018"></A>
New GDB/MI commands should only output <VAR>lists</VAR> containing
<VAR>values</VAR>.
<P>
</UL>
<P>
See section <A HREF="gdb_25.html#SEC232">GDB/MI Stream Records</A>, for more
details about the various output records.
</P><P>
<A NAME="GDB/MI Simple Examples"></A>
<HR SIZE="6">
<A NAME="SEC224"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC223"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC229"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC221"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC229"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 24.1.3 Simple Examples of GDB/MI Interaction </H3>
<!--docid::SEC224::-->
<P>
This subsection presents several simple examples of interaction using
the GDB/MI interface. In these examples, <SAMP>`-&#62;'</SAMP> means that the
following line is passed to GDB/MI as input, while <SAMP>`&#60;-'</SAMP> means
the output received from GDB/MI.
</P><P>
<A NAME="SEC225"></A>
<H4> Target Stop </H4>
<!--docid::SEC225::-->
Here's an example of stopping the inferior process:
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre>-&#62; -stop
&#60;- (gdb)
</pre></td></tr></table></P><P>
and later:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre>&#60;- *stop,reason="stop",address="0x123",source="a.c:123"
&#60;- (gdb)
</pre></td></tr></table></P><P>
<A NAME="SEC226"></A>
<H4> Simple CLI Command </H4>
<!--docid::SEC226::-->
<P>
Here's an example of a simple CLI command being passed through
GDB/MI and on to the CLI.
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre>-&#62; print 1+2
&#60;- &#38;"print 1+2\n"
&#60;- ~"$1 = 3\n"
&#60;- ^done
&#60;- (gdb)
</pre></td></tr></table></P><P>
<A NAME="SEC227"></A>
<H4> Command With Side Effects </H4>
<!--docid::SEC227::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre>-&#62; -symbol-file xyz.exe
&#60;- *breakpoint,nr="3",address="0x123",source="a.c:123"
&#60;- (gdb)
</pre></td></tr></table></P><P>
<A NAME="SEC228"></A>
<H4> A Bad Command </H4>
<!--docid::SEC228::-->
<P>
Here's what happens if you pass a non-existent command:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre>-&#62; -rubbish
&#60;- ^error,msg="Undefined MI command: rubbish"
&#60;- (gdb)
</pre></td></tr></table></P><P>
<A NAME="GDB/MI Compatibility with CLI"></A>
<HR SIZE="6">
<A NAME="SEC229"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC224"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC230"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC230"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC595"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 24.2 GDB/MI Compatibility with CLI </H2>
<!--docid::SEC229::-->
<P>
<A NAME="IDX1019"></A>
<A NAME="IDX1020"></A>
To help users familiar with GDB's existing CLI interface, GDB/MI
accepts existing CLI commands. As specified by the syntax, such
commands can be directly entered into the GDB/MI interface and GDB will
respond.
</P><P>
This mechanism is provided as an aid to developers of GDB/MI
clients and not as a reliable interface into the CLI. Since the command
is being interpreteted in an environment that assumes GDB/MI
behaviour, the exact output of such commands is likely to end up being
an un-supported hybrid of GDB/MI and CLI output.
</P><P>
<A NAME="GDB/MI Output Records"></A>
<HR SIZE="6">
<A NAME="SEC230"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC229"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC231"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC234"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC234"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 24.3 GDB/MI Output Records </H2>
<!--docid::SEC230::-->
<P>
<BLOCKQUOTE><TABLE BORDER=0 CELLSPACING=0>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC231">24.3.1 GDB/MI Result Records</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC232">24.3.2 GDB/MI Stream Records</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
<TR><TD ALIGN="left" VALIGN="TOP"><A HREF="gdb_25.html#SEC233">24.3.3 GDB/MI Out-of-band Records</A></TD><TD>&nbsp;&nbsp;</TD><TD ALIGN="left" VALIGN="TOP"></TD></TR>
</TABLE></BLOCKQUOTE>
<P>
<A NAME="GDB/MI Result Records"></A>
<HR SIZE="6">
<A NAME="SEC231"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC230"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC232"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC234"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC230"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC234"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 24.3.1 GDB/MI Result Records </H3>
<!--docid::SEC231::-->
<P>
<A NAME="IDX1021"></A>
<A NAME="IDX1022"></A>
In addition to a number of out-of-band notifications, the response to a
GDB/MI command includes one of the following result indications:
</P><P>
<DL COMPACT>
<A NAME="IDX1023"></A>
<DT><CODE>"^done" [ "," <VAR>results</VAR> ]</CODE>
<DD>The synchronous operation was successful, <CODE><VAR>results</VAR></CODE> are the return
values.
<P>
<DT><CODE>"^running"</CODE>
<DD><A NAME="IDX1024"></A>
The asynchronous operation was successfully started. The target is
running.
<P>
<DT><CODE>"^error" "," <VAR>c-string</VAR></CODE>
<DD><A NAME="IDX1025"></A>
The operation failed. The <CODE><VAR>c-string</VAR></CODE> contains the corresponding
error message.
</DL>
<P>
<A NAME="GDB/MI Stream Records"></A>
<HR SIZE="6">
<A NAME="SEC232"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC231"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC233"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC233"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC230"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC234"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 24.3.2 GDB/MI Stream Records </H3>
<!--docid::SEC232::-->
<P>
<A NAME="IDX1026"></A>
<A NAME="IDX1027"></A>
GDB internally maintains a number of output streams: the console, the
target, and the log. The output intended for each of these streams is
funneled through the GDB/MI interface using <EM>stream records</EM>.
</P><P>
Each stream record begins with a unique <EM>prefix character</EM> which
identifies its stream (see section <A HREF="gdb_25.html#SEC223">GDB/MI Output Syntax</A>). In addition to the prefix, each stream record contains a
<CODE><VAR>string-output</VAR></CODE>. This is either raw text (with an implicit new
line) or a quoted C string (which does not contain an implicit newline).
</P><P>
<DL COMPACT>
<DT><CODE>"~" <VAR>string-output</VAR></CODE>
<DD>The console output stream contains text that should be displayed in the
CLI console window. It contains the textual responses to CLI commands.
<P>
<DT><CODE>"@" <VAR>string-output</VAR></CODE>
<DD>The target output stream contains any textual output from the running
target.
<P>
<DT><CODE>"&#38;" <VAR>string-output</VAR></CODE>
<DD>The log stream contains debugging messages being produced by GDB's
internals.
</DL>
<P>
<A NAME="GDB/MI Out-of-band Records"></A>
<HR SIZE="6">
<A NAME="SEC233"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC232"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC234"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC234"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC230"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC234"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H3> 24.3.3 GDB/MI Out-of-band Records </H3>
<!--docid::SEC233::-->
<P>
<A NAME="IDX1028"></A>
<A NAME="IDX1029"></A>
<EM>Out-of-band</EM> records are used to notify the GDB/MI client of
additional changes that have occurred. Those changes can either be a
consequence of GDB/MI (e.g., a breakpoint modified) or a result of
target activity (e.g., target stopped).
</P><P>
The following is a preliminary list of possible out-of-band records.
</P><P>
<DL COMPACT>
<DT><CODE>"*" "stop"</CODE>
<DD></DL>
<P>
<A NAME="GDB/MI Command Description Format"></A>
<HR SIZE="6">
<A NAME="SEC234"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC233"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC244"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC244"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC595"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 24.4 GDB/MI Command Description Format </H2>
<!--docid::SEC234::-->
<P>
The remaining sections describe blocks of commands. Each block of
commands is laid out in a fashion similar to this section.
</P><P>
Note the the line breaks shown in the examples are here only for
readability. They don't appear in the real output.
Also note that the commands with a non-available example (N.A.) are
not yet implemented.
</P><P>
<A NAME="SEC235"></A>
<H3> Motivation </H3>
<!--docid::SEC235::-->
<P>
The motivation for this collection of commands.
</P><P>
<A NAME="SEC236"></A>
<H3> Introduction </H3>
<!--docid::SEC236::-->
<P>
A brief introduction to this collection of commands as a whole.
</P><P>
<A NAME="SEC237"></A>
<H3> Commands </H3>
<!--docid::SEC237::-->
<P>
For each command in the block, the following is described:
</P><P>
<A NAME="SEC238"></A>
<H4> Synopsis </H4>
<!--docid::SEC238::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -command <VAR>args</VAR><small>...</small>
</pre></td></tr></table></P><P>
<A NAME="SEC239"></A>
<H4> GDB Command </H4>
<!--docid::SEC239::-->
<P>
The corresponding GDB CLI command.
</P><P>
<A NAME="SEC240"></A>
<H4> Result </H4>
<!--docid::SEC240::-->
<P>
<A NAME="SEC241"></A>
<H4> Out-of-band </H4>
<!--docid::SEC241::-->
<P>
<A NAME="SEC242"></A>
<H4> Notes </H4>
<!--docid::SEC242::-->
<P>
<A NAME="SEC243"></A>
<H4> Example </H4>
<!--docid::SEC243::-->
<P>
<A NAME="GDB/MI Breakpoint Table Commands"></A>
<HR SIZE="6">
<A NAME="SEC244"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC234"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC282"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC282"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC595"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 24.5 GDB/MI Breakpoint table commands </H2>
<!--docid::SEC244::-->
<P>
<A NAME="IDX1030"></A>
<A NAME="IDX1031"></A>
This section documents GDB/MI commands for manipulating
breakpoints.
</P><P>
<A NAME="SEC245"></A>
<H3> The <CODE>-break-after</CODE> Command </H3>
<!--docid::SEC245::-->
<P>
<A NAME="SEC246"></A>
<H4> Synopsis </H4>
<!--docid::SEC246::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -break-after <VAR>number</VAR> <VAR>count</VAR>
</pre></td></tr></table></P><P>
The breakpoint number <VAR>number</VAR> is not in effect until it has been
hit <VAR>count</VAR> times. To see how this is reflected in the output of
the <SAMP>`-break-list'</SAMP> command, see the description of the
<SAMP>`-break-list'</SAMP> command below.
</P><P>
<A NAME="SEC247"></A>
<H4> GDB Command </H4>
<!--docid::SEC247::-->
<P>
The corresponding GDB command is <SAMP>`ignore'</SAMP>.
</P><P>
<A NAME="SEC248"></A>
<H4> Example </H4>
<!--docid::SEC248::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-break-insert main
^done,bkpt={number="1",addr="0x000100d0",file="hello.c",line="5"}
(gdb)
-break-after 1 3
~
^done
(gdb)
-break-list
^done,BreakpointTable={nr_rows="1",nr_cols="6",
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0",
ignore="3"}]}
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC249"></A>
<H3> The <CODE>-break-condition</CODE> Command </H3>
<!--docid::SEC249::-->
<P>
<A NAME="SEC250"></A>
<H4> Synopsis </H4>
<!--docid::SEC250::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -break-condition <VAR>number</VAR> <VAR>expr</VAR>
</pre></td></tr></table></P><P>
Breakpoint <VAR>number</VAR> will stop the program only if the condition in
<VAR>expr</VAR> is true. The condition becomes part of the
<SAMP>`-break-list'</SAMP> output (see the description of the <SAMP>`-break-list'</SAMP>
command below).
</P><P>
<A NAME="SEC251"></A>
<H4> GDB Command </H4>
<!--docid::SEC251::-->
<P>
The corresponding GDB command is <SAMP>`condition'</SAMP>.
</P><P>
<A NAME="SEC252"></A>
<H4> Example </H4>
<!--docid::SEC252::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-break-condition 1 1
^done
(gdb)
-break-list
^done,BreakpointTable={nr_rows="1",nr_cols="6",
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",cond="1",
times="0",ignore="3"}]}
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC253"></A>
<H3> The <CODE>-break-delete</CODE> Command </H3>
<!--docid::SEC253::-->
<P>
<A NAME="SEC254"></A>
<H4> Synopsis </H4>
<!--docid::SEC254::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -break-delete ( <VAR>breakpoint</VAR> )+
</pre></td></tr></table></P><P>
Delete the breakpoint(s) whose number(s) are specified in the argument
list. This is obviously reflected in the breakpoint list.
</P><P>
<A NAME="SEC255"></A>
<H4> GDB command </H4>
<!--docid::SEC255::-->
<P>
The corresponding GDB command is <SAMP>`delete'</SAMP>.
</P><P>
<A NAME="SEC256"></A>
<H4> Example </H4>
<!--docid::SEC256::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre>(gdb)
-break-delete 1
^done
(gdb)
-break-list
^done,BreakpointTable={nr_rows="0",nr_cols="6",
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],
body=[]}
(gdb)
</pre></td></tr></table></P><P>
<A NAME="SEC257"></A>
<H3> The <CODE>-break-disable</CODE> Command </H3>
<!--docid::SEC257::-->
<P>
<A NAME="SEC258"></A>
<H4> Synopsis </H4>
<!--docid::SEC258::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -break-disable ( <VAR>breakpoint</VAR> )+
</pre></td></tr></table></P><P>
Disable the named <VAR>breakpoint</VAR>(s). The field <SAMP>`enabled'</SAMP> in the
break list is now set to <SAMP>`n'</SAMP> for the named <VAR>breakpoint</VAR>(s).
</P><P>
<A NAME="SEC259"></A>
<H4> GDB Command </H4>
<!--docid::SEC259::-->
<P>
The corresponding GDB command is <SAMP>`disable'</SAMP>.
</P><P>
<A NAME="SEC260"></A>
<H4> Example </H4>
<!--docid::SEC260::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-break-disable 2
^done
(gdb)
-break-list
^done,BreakpointTable={nr_rows="1",nr_cols="6",
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],
body=[bkpt={number="2",type="breakpoint",disp="keep",enabled="n",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"}]}
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC261"></A>
<H3> The <CODE>-break-enable</CODE> Command </H3>
<!--docid::SEC261::-->
<P>
<A NAME="SEC262"></A>
<H4> Synopsis </H4>
<!--docid::SEC262::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -break-enable ( <VAR>breakpoint</VAR> )+
</pre></td></tr></table></P><P>
Enable (previously disabled) <VAR>breakpoint</VAR>(s).
</P><P>
<A NAME="SEC263"></A>
<H4> GDB Command </H4>
<!--docid::SEC263::-->
<P>
The corresponding GDB command is <SAMP>`enable'</SAMP>.
</P><P>
<A NAME="SEC264"></A>
<H4> Example </H4>
<!--docid::SEC264::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-break-enable 2
^done
(gdb)
-break-list
^done,BreakpointTable={nr_rows="1",nr_cols="6",
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],
body=[bkpt={number="2",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"}]}
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC265"></A>
<H3> The <CODE>-break-info</CODE> Command </H3>
<!--docid::SEC265::-->
<P>
<A NAME="SEC266"></A>
<H4> Synopsis </H4>
<!--docid::SEC266::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -break-info <VAR>breakpoint</VAR>
</pre></td></tr></table></P><P>
Get information about a single breakpoint.
</P><P>
<A NAME="SEC267"></A>
<H4> GDB command </H4>
<!--docid::SEC267::-->
<P>
The corresponding GDB command is <SAMP>`info break <VAR>breakpoint</VAR>'</SAMP>.
</P><P>
<A NAME="SEC268"></A>
<H4> Example </H4>
<!--docid::SEC268::-->
N.A.
<P>
<A NAME="SEC269"></A>
<H3> The <CODE>-break-insert</CODE> Command </H3>
<!--docid::SEC269::-->
<P>
<A NAME="SEC270"></A>
<H4> Synopsis </H4>
<!--docid::SEC270::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -break-insert [ -t ] [ -h ] [ -r ]
[ -c <VAR>condition</VAR> ] [ -i <VAR>ignore-count</VAR> ]
[ -p <VAR>thread</VAR> ] [ <VAR>line</VAR> | <VAR>addr</VAR> ]
</pre></td></tr></table></P><P>
If specified, <VAR>line</VAR>, can be one of:
</P><P>
<UL>
<LI>function
<LI>filename:linenum
<LI>filename:function
<LI>*address
</UL>
<P>
The possible optional parameters of this command are:
</P><P>
<DL COMPACT>
<DT><SAMP>`-t'</SAMP>
<DD>Insert a tempoary breakpoint.
<DT><SAMP>`-h'</SAMP>
<DD>Insert a hardware breakpoint.
<DT><SAMP>`-c <VAR>condition</VAR>'</SAMP>
<DD>Make the breakpoint conditional on <VAR>condition</VAR>.
<DT><SAMP>`-i <VAR>ignore-count</VAR>'</SAMP>
<DD>Initialize the <VAR>ignore-count</VAR>.
<DT><SAMP>`-r'</SAMP>
<DD>Insert a regular breakpoint in all the functions whose names match the
given regular expression. Other flags are not applicable to regular
expresson.
</DL>
<P>
<A NAME="SEC271"></A>
<H4> Result </H4>
<!--docid::SEC271::-->
<P>
The result is in the form:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> ^done,bkptno="<VAR>number</VAR>",func="<VAR>funcname</VAR>",
file="<VAR>filename</VAR>",line="<VAR>lineno</VAR>"
</pre></td></tr></table></P><P>
where <VAR>number</VAR> is the GDB number for this breakpoint, <VAR>funcname</VAR>
is the name of the function where the breakpoint was inserted,
<VAR>filename</VAR> is the name of the source file which contains this
function, and <VAR>lineno</VAR> is the source line number within that file.
</P><P>
Note: this format is open to change.
</P><P>
<A NAME="SEC272"></A>
<H4> GDB Command </H4>
<!--docid::SEC272::-->
<P>
The corresponding GDB commands are <SAMP>`break'</SAMP>, <SAMP>`tbreak'</SAMP>,
<SAMP>`hbreak'</SAMP>, <SAMP>`thbreak'</SAMP>, and <SAMP>`rbreak'</SAMP>.
</P><P>
<A NAME="SEC273"></A>
<H4> Example </H4>
<!--docid::SEC273::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-break-insert main
^done,bkpt={number="1",addr="0x0001072c",file="recursive2.c",line="4"}
(gdb)
-break-insert -t foo
^done,bkpt={number="2",addr="0x00010774",file="recursive2.c",line="11"}
(gdb)
-break-list
^done,BreakpointTable={nr_rows="2",nr_cols="6",
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x0001072c", func="main",file="recursive2.c",line="4",times="0"},
bkpt={number="2",type="breakpoint",disp="del",enabled="y",
addr="0x00010774",func="foo",file="recursive2.c",line="11",times="0"}]}
(gdb)
-break-insert -r foo.*
~int foo(int, int);
^done,bkpt={number="3",addr="0x00010774",file="recursive2.c",line="11"}
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC274"></A>
<H3> The <CODE>-break-list</CODE> Command </H3>
<!--docid::SEC274::-->
<P>
<A NAME="SEC275"></A>
<H4> Synopsis </H4>
<!--docid::SEC275::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -break-list
</pre></td></tr></table></P><P>
Displays the list of inserted breakpoints, showing the following fields:
</P><P>
<DL COMPACT>
<DT><SAMP>`Number'</SAMP>
<DD>number of the breakpoint
<DT><SAMP>`Type'</SAMP>
<DD>type of the breakpoint: <SAMP>`breakpoint'</SAMP> or <SAMP>`watchpoint'</SAMP>
<DT><SAMP>`Disposition'</SAMP>
<DD>should the breakpoint be deleted or disabled when it is hit: <SAMP>`keep'</SAMP>
or <SAMP>`nokeep'</SAMP>
<DT><SAMP>`Enabled'</SAMP>
<DD>is the breakpoint enabled or no: <SAMP>`y'</SAMP> or <SAMP>`n'</SAMP>
<DT><SAMP>`Address'</SAMP>
<DD>memory location at which the breakpoint is set
<DT><SAMP>`What'</SAMP>
<DD>logical location of the breakpoint, expressed by function name, file
name, line number
<DT><SAMP>`Times'</SAMP>
<DD>number of times the breakpoint has been hit
</DL>
<P>
If there are no breakpoints or watchpoints, the <CODE>BreakpointTable</CODE>
<CODE>body</CODE> field is an empty list.
</P><P>
<A NAME="SEC276"></A>
<H4> GDB Command </H4>
<!--docid::SEC276::-->
<P>
The corresponding GDB command is <SAMP>`info break'</SAMP>.
</P><P>
<A NAME="SEC277"></A>
<H4> Example </H4>
<!--docid::SEC277::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-break-list
^done,BreakpointTable={nr_rows="2",nr_cols="6",
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"},
bkpt={number="2",type="breakpoint",disp="keep",enabled="y",
addr="0x00010114",func="foo",file="hello.c",line="13",times="0"}]}
(gdb)
</FONT></pre></td></tr></table></P><P>
Here's an example of the result when there are no breakpoints:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-break-list
^done,BreakpointTable={nr_rows="0",nr_cols="6",
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],
body=[]}
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC278"></A>
<H3> The <CODE>-break-watch</CODE> Command </H3>
<!--docid::SEC278::-->
<P>
<A NAME="SEC279"></A>
<H4> Synopsis </H4>
<!--docid::SEC279::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -break-watch [ -a | -r ]
</pre></td></tr></table></P><P>
Create a watchpoint. With the <SAMP>`-a'</SAMP> option it will create an
<EM>access</EM> watchpoint, i.e. a watchpoint that triggers either on a
read from or on a write to the memory location. With the <SAMP>`-r'</SAMP>
option, the watchpoint created is a <EM>read</EM> watchpoint, i.e. it will
trigger only when the memory location is accessed for reading. Without
either of the options, the watchpoint created is a regular watchpoint,
i.e. it will trigger when the memory location is accessed for writing.
See section <A HREF="gdb_6.html#SEC30">Setting watchpoints</A>.
</P><P>
Note that <SAMP>`-break-list'</SAMP> will report a single list of watchpoints and
breakpoints inserted.
</P><P>
<A NAME="SEC280"></A>
<H4> GDB Command </H4>
<!--docid::SEC280::-->
<P>
The corresponding GDB commands are <SAMP>`watch'</SAMP>, <SAMP>`awatch'</SAMP>, and
<SAMP>`rwatch'</SAMP>.
</P><P>
<A NAME="SEC281"></A>
<H4> Example </H4>
<!--docid::SEC281::-->
<P>
Setting a watchpoint on a variable in the <CODE>main</CODE> function:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-break-watch x
^done,wpt={number="2",exp="x"}
(gdb)
-exec-continue
^running
^done,reason="watchpoint-trigger",wpt={number="2",exp="x"},
value={old="-268439212",new="55"},
frame={func="main",args=[],file="recursive2.c",line="5"}
(gdb)
</FONT></pre></td></tr></table></P><P>
Setting a watchpoint on a variable local to a function. GDB will stop
the program execution twice: first for the variable changing value, then
for the watchpoint going out of scope.
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-break-watch C
^done,wpt={number="5",exp="C"}
(gdb)
-exec-continue
^running
^done,reason="watchpoint-trigger",
wpt={number="5",exp="C"},value={old="-276895068",new="3"},
frame={func="callee4",args=[],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"}
(gdb)
-exec-continue
^running
^done,reason="watchpoint-scope",wpnum="5",
frame={func="callee3",args=[{name="strarg",
value="0x11940 \"A string argument.\""}],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"}
(gdb)
</FONT></pre></td></tr></table></P><P>
Listing breakpoints and watchpoints, at different points in the program
execution. Note that once the watchpoint goes out of scope, it is
deleted.
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-break-watch C
^done,wpt={number="2",exp="C"}
(gdb)
-break-list
^done,BreakpointTable={nr_rows="2",nr_cols="6",
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"},
bkpt={number="2",type="watchpoint",disp="keep",
enabled="y",addr="",what="C",times="0"}]}
(gdb)
-exec-continue
^running
^done,reason="watchpoint-trigger",wpt={number="2",exp="C"},
value={old="-276895068",new="3"},
frame={func="callee4",args=[],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"}
(gdb)
-break-list
^done,BreakpointTable={nr_rows="2",nr_cols="6",
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"},
bkpt={number="2",type="watchpoint",disp="keep",
enabled="y",addr="",what="C",times="-5"}]}
(gdb)
-exec-continue
^running
^done,reason="watchpoint-scope",wpnum="2",
frame={func="callee3",args=[{name="strarg",
value="0x11940 \"A string argument.\""}],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"}
(gdb)
-break-list
^done,BreakpointTable={nr_rows="1",nr_cols="6",
hdr=[{width="3",alignment="-1",col_name="number",colhdr="Num"},
{width="14",alignment="-1",col_name="type",colhdr="Type"},
{width="4",alignment="-1",col_name="disp",colhdr="Disp"},
{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},
{width="10",alignment="-1",col_name="addr",colhdr="Address"},
{width="40",alignment="2",col_name="what",colhdr="What"}],
body=[bkpt={number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"}]}
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="GDB/MI Data Manipulation"></A>
<HR SIZE="6">
<A NAME="SEC282"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC244"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC344"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC344"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC595"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 24.6 GDB/MI Data Manipulation </H2>
<!--docid::SEC282::-->
<P>
<A NAME="IDX1032"></A>
<A NAME="IDX1033"></A>
This section describes the GDB/MI commands that manipulate data:
examine memory and registers, evaluate expressions, etc.
</P><P>
<A NAME="SEC283"></A>
<H3> The <CODE>-data-disassemble</CODE> Command </H3>
<!--docid::SEC283::-->
<P>
<A NAME="SEC284"></A>
<H4> Synopsis </H4>
<!--docid::SEC284::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -data-disassemble
[ -s <VAR>start-addr</VAR> -e <VAR>end-addr</VAR> ]
| [ -f <VAR>filename</VAR> -l <VAR>linenum</VAR> [ -n <VAR>lines</VAR> ] ]
-- <VAR>mode</VAR>
</pre></td></tr></table></P><P>
Where:
</P><P>
<DL COMPACT>
<DT><SAMP>`<VAR>start-addr</VAR>'</SAMP>
<DD>is the beginning address (or <CODE>$pc</CODE>)
<DT><SAMP>`<VAR>end-addr</VAR>'</SAMP>
<DD>is the end address
<DT><SAMP>`<VAR>filename</VAR>'</SAMP>
<DD>is the name of the file to disassemble
<DT><SAMP>`<VAR>linenum</VAR>'</SAMP>
<DD>is the line number to disassemble around
<DT><SAMP>`<VAR>lines</VAR>'</SAMP>
<DD>is the the number of disassembly lines to be produced. If it is -1,
the whole function will be disassembled, in case no <VAR>end-addr</VAR> is
specified. If <VAR>end-addr</VAR> is specified as a non-zero value, and
<VAR>lines</VAR> is lower than the number of disassembly lines between
<VAR>start-addr</VAR> and <VAR>end-addr</VAR>, only <VAR>lines</VAR> lines are
displayed; if <VAR>lines</VAR> is higher than the number of lines between
<VAR>start-addr</VAR> and <VAR>end-addr</VAR>, only the lines up to <VAR>end-addr</VAR>
are displayed.
<DT><SAMP>`<VAR>mode</VAR>'</SAMP>
<DD>is either 0 (meaning only disassembly) or 1 (meaning mixed source and
disassembly).
</DL>
<P>
<A NAME="SEC285"></A>
<H4> Result </H4>
<!--docid::SEC285::-->
<P>
The output for each instruction is composed of four fields:
</P><P>
<UL>
<LI>Address
<LI>Func-name
<LI>Offset
<LI>Instruction
</UL>
<P>
Note that whatever included in the instruction field, is not manipulated
directely by GDB/MI, i.e. it is not possible to adjust its format.
</P><P>
<A NAME="SEC286"></A>
<H4> GDB Command </H4>
<!--docid::SEC286::-->
<P>
There's no direct mapping from this command to the CLI.
</P><P>
<A NAME="SEC287"></A>
<H4> Example </H4>
<!--docid::SEC287::-->
<P>
Disassemble from the current value of <CODE>$pc</CODE> to <CODE>$pc + 20</CODE>:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-data-disassemble -s $pc -e "$pc + 20" -- 0
^done,
asm_insns=[
{address="0x000107c0",func-name="main",offset="4",
inst="mov 2, %o0"},
{address="0x000107c4",func-name="main",offset="8",
inst="sethi %hi(0x11800), %o2"},
{address="0x000107c8",func-name="main",offset="12",
inst="or %o2, 0x140, %o1\t! 0x11940 <_lib_version+8>"},
{address="0x000107cc",func-name="main",offset="16",
inst="sethi %hi(0x11800), %o2"},
{address="0x000107d0",func-name="main",offset="20",
inst="or %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"}]
(gdb)
</FONT></pre></td></tr></table></P><P>
Disassemble the whole <CODE>main</CODE> function. Line 32 is part of
<CODE>main</CODE>.
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>-data-disassemble -f basics.c -l 32 -- 0
^done,asm_insns=[
{address="0x000107bc",func-name="main",offset="0",
inst="save %sp, -112, %sp"},
{address="0x000107c0",func-name="main",offset="4",
inst="mov 2, %o0"},
{address="0x000107c4",func-name="main",offset="8",
inst="sethi %hi(0x11800), %o2"},
[<small>...</small>]
{address="0x0001081c",func-name="main",offset="96",inst="ret "},
{address="0x00010820",func-name="main",offset="100",inst="restore "}]
(gdb)
</FONT></pre></td></tr></table></P><P>
Disassemble 3 instructions from the start of <CODE>main</CODE>:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-data-disassemble -f basics.c -l 32 -n 3 -- 0
^done,asm_insns=[
{address="0x000107bc",func-name="main",offset="0",
inst="save %sp, -112, %sp"},
{address="0x000107c0",func-name="main",offset="4",
inst="mov 2, %o0"},
{address="0x000107c4",func-name="main",offset="8",
inst="sethi %hi(0x11800), %o2"}]
(gdb)
</FONT></pre></td></tr></table></P><P>
Disassemble 3 instructions from the start of <CODE>main</CODE> in mixed mode:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-data-disassemble -f basics.c -l 32 -n 3 -- 1
^done,asm_insns=[
src_and_asm_line={line="31",
file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
testsuite/gdb.mi/basics.c",line_asm_insn=[
{address="0x000107bc",func-name="main",offset="0",
inst="save %sp, -112, %sp"}]},
src_and_asm_line={line="32",
file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
testsuite/gdb.mi/basics.c",line_asm_insn=[
{address="0x000107c0",func-name="main",offset="4",
inst="mov 2, %o0"},
{address="0x000107c4",func-name="main",offset="8",
inst="sethi %hi(0x11800), %o2"}]}]
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC288"></A>
<H3> The <CODE>-data-evaluate-expression</CODE> Command </H3>
<!--docid::SEC288::-->
<P>
<A NAME="SEC289"></A>
<H4> Synopsis </H4>
<!--docid::SEC289::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -data-evaluate-expression <VAR>expr</VAR>
</pre></td></tr></table></P><P>
Evaluate <VAR>expr</VAR> as an expression. The expression could contain an
inferior function call. The function call will execute synchronously.
If the expression contains spaces, it must be enclosed in double quotes.
</P><P>
<A NAME="SEC290"></A>
<H4> GDB Command </H4>
<!--docid::SEC290::-->
<P>
The corresponding GDB commands are <SAMP>`print'</SAMP>, <SAMP>`output'</SAMP>, and
<SAMP>`call'</SAMP>. In <CODE>gdbtk</CODE> only, there's a corresponding
<SAMP>`gdb_eval'</SAMP> command.
</P><P>
<A NAME="SEC291"></A>
<H4> Example </H4>
<!--docid::SEC291::-->
<P>
In the following example, the numbers that precede the commands are the
<EM>tokens</EM> described in <A HREF="gdb_25.html#SEC221">GDB/MI Command Syntax</A>. Notice how GDB/MI returns the same tokens in its
output.
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>211-data-evaluate-expression A
211^done,value="1"
(gdb)
311-data-evaluate-expression &#38;A
311^done,value="0xefffeb7c"
(gdb)
411-data-evaluate-expression A+3
411^done,value="4"
(gdb)
511-data-evaluate-expression "A + 3"
511^done,value="4"
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC292"></A>
<H3> The <CODE>-data-list-changed-registers</CODE> Command </H3>
<!--docid::SEC292::-->
<P>
<A NAME="SEC293"></A>
<H4> Synopsis </H4>
<!--docid::SEC293::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -data-list-changed-registers
</pre></td></tr></table></P><P>
Display a list of the registers that have changed.
</P><P>
<A NAME="SEC294"></A>
<H4> GDB Command </H4>
<!--docid::SEC294::-->
<P>
GDB doesn't have a direct analog for this command; <CODE>gdbtk</CODE>
has the corresponding command <SAMP>`gdb_changed_register_list'</SAMP>.
</P><P>
<A NAME="SEC295"></A>
<H4> Example </H4>
<!--docid::SEC295::-->
<P>
On a PPC MBX board:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-exec-continue
^running
(gdb)
*stopped,reason="breakpoint-hit",bkptno="1",frame={func="main",
args=[],file="try.c",line="5"}
(gdb)
-data-list-changed-registers
^done,changed-registers=["0","1","2","4","5","6","7","8","9",
"10","11","13","14","15","16","17","18","19","20","21","22","23",
"24","25","26","27","28","30","31","64","65","66","67","69"]
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC296"></A>
<H3> The <CODE>-data-list-register-names</CODE> Command </H3>
<!--docid::SEC296::-->
<P>
<A NAME="SEC297"></A>
<H4> Synopsis </H4>
<!--docid::SEC297::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -data-list-register-names [ ( <VAR>regno</VAR> )+ ]
</pre></td></tr></table></P><P>
Show a list of register names for the current target. If no arguments
are given, it shows a list of the names of all the registers. If
integer numbers are given as arguments, it will print a list of the
names of the registers corresponding to the arguments. To ensure
consistency between a register name and its number, the output list may
include empty register names.
</P><P>
<A NAME="SEC298"></A>
<H4> GDB Command </H4>
<!--docid::SEC298::-->
<P>
GDB does not have a command which corresponds to
<SAMP>`-data-list-register-names'</SAMP>. In <CODE>gdbtk</CODE> there is a
corresponding command <SAMP>`gdb_regnames'</SAMP>.
</P><P>
<A NAME="SEC299"></A>
<H4> Example </H4>
<!--docid::SEC299::-->
<P>
For the PPC MBX board:
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-data-list-register-names
^done,register-names=["r0","r1","r2","r3","r4","r5","r6","r7",
"r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18",
"r19","r20","r21","r22","r23","r24","r25","r26","r27","r28","r29",
"r30","r31","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9",
"f10","f11","f12","f13","f14","f15","f16","f17","f18","f19","f20",
"f21","f22","f23","f24","f25","f26","f27","f28","f29","f30","f31",
"", "pc","ps","cr","lr","ctr","xer"]
(gdb)
-data-list-register-names 1 2 3
^done,register-names=["r1","r2","r3"]
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC300"></A>
<H3> The <CODE>-data-list-register-values</CODE> Command </H3>
<!--docid::SEC300::-->
<P>
<A NAME="SEC301"></A>
<H4> Synopsis </H4>
<!--docid::SEC301::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -data-list-register-values <VAR>fmt</VAR> [ ( <VAR>regno</VAR> )*]
</pre></td></tr></table></P><P>
Display the registers' contents. <VAR>fmt</VAR> is the format according to
which the registers' contents are to be returned, followed by an optional
list of numbers specifying the registers to display. A missing list of
numbers indicates that the contents of all the registers must be returned.
</P><P>
Allowed formats for <VAR>fmt</VAR> are:
</P><P>
<DL COMPACT>
<DT><CODE>x</CODE>
<DD>Hexadecimal
<DT><CODE>o</CODE>
<DD>Octal
<DT><CODE>t</CODE>
<DD>Binary
<DT><CODE>d</CODE>
<DD>Decimal
<DT><CODE>r</CODE>
<DD>Raw
<DT><CODE>N</CODE>
<DD>Natural
</DL>
<P>
<A NAME="SEC302"></A>
<H4> GDB Command </H4>
<!--docid::SEC302::-->
<P>
The corresponding GDB commands are <SAMP>`info reg'</SAMP>, <SAMP>`info
all-reg'</SAMP>, and (in <CODE>gdbtk</CODE>) <SAMP>`gdb_fetch_registers'</SAMP>.
</P><P>
<A NAME="SEC303"></A>
<H4> Example </H4>
<!--docid::SEC303::-->
<P>
For a PPC MBX board (note: line breaks are for readability only, they
don't appear in the actual output):
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-data-list-register-values r 64 65
^done,register-values=[{number="64",value="0xfe00a300"},
{number="65",value="0x00029002"}]
(gdb)
-data-list-register-values x
^done,register-values=[{number="0",value="0xfe0043c8"},
{number="1",value="0x3fff88"},{number="2",value="0xfffffffe"},
{number="3",value="0x0"},{number="4",value="0xa"},
{number="5",value="0x3fff68"},{number="6",value="0x3fff58"},
{number="7",value="0xfe011e98"},{number="8",value="0x2"},
{number="9",value="0xfa202820"},{number="10",value="0xfa202808"},
{number="11",value="0x1"},{number="12",value="0x0"},
{number="13",value="0x4544"},{number="14",value="0xffdfffff"},
{number="15",value="0xffffffff"},{number="16",value="0xfffffeff"},
{number="17",value="0xefffffed"},{number="18",value="0xfffffffe"},
{number="19",value="0xffffffff"},{number="20",value="0xffffffff"},
{number="21",value="0xffffffff"},{number="22",value="0xfffffff7"},
{number="23",value="0xffffffff"},{number="24",value="0xffffffff"},
{number="25",value="0xffffffff"},{number="26",value="0xfffffffb"},
{number="27",value="0xffffffff"},{number="28",value="0xf7bfffff"},
{number="29",value="0x0"},{number="30",value="0xfe010000"},
{number="31",value="0x0"},{number="32",value="0x0"},
{number="33",value="0x0"},{number="34",value="0x0"},
{number="35",value="0x0"},{number="36",value="0x0"},
{number="37",value="0x0"},{number="38",value="0x0"},
{number="39",value="0x0"},{number="40",value="0x0"},
{number="41",value="0x0"},{number="42",value="0x0"},
{number="43",value="0x0"},{number="44",value="0x0"},
{number="45",value="0x0"},{number="46",value="0x0"},
{number="47",value="0x0"},{number="48",value="0x0"},
{number="49",value="0x0"},{number="50",value="0x0"},
{number="51",value="0x0"},{number="52",value="0x0"},
{number="53",value="0x0"},{number="54",value="0x0"},
{number="55",value="0x0"},{number="56",value="0x0"},
{number="57",value="0x0"},{number="58",value="0x0"},
{number="59",value="0x0"},{number="60",value="0x0"},
{number="61",value="0x0"},{number="62",value="0x0"},
{number="63",value="0x0"},{number="64",value="0xfe00a300"},
{number="65",value="0x29002"},{number="66",value="0x202f04b5"},
{number="67",value="0xfe0043b0"},{number="68",value="0xfe00b3e4"},
{number="69",value="0x20002b03"}]
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC304"></A>
<H3> The <CODE>-data-read-memory</CODE> Command </H3>
<!--docid::SEC304::-->
<P>
<A NAME="SEC305"></A>
<H4> Synopsis </H4>
<!--docid::SEC305::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -data-read-memory [ -o <VAR>byte-offset</VAR> ]
<VAR>address</VAR> <VAR>word-format</VAR> <VAR>word-size</VAR>
<VAR>nr-rows</VAR> <VAR>nr-cols</VAR> [ <VAR>aschar</VAR> ]
</pre></td></tr></table></P><P>
where:
</P><P>
<DL COMPACT>
<DT><SAMP>`<VAR>address</VAR>'</SAMP>
<DD>An expression specifying the address of the first memory word to be
read. Complex expressions containing embedded white space should be
quoted using the C convention.
<P>
<DT><SAMP>`<VAR>word-format</VAR>'</SAMP>
<DD>The format to be used to print the memory words. The notation is the
same as for GDB's <CODE>print</CODE> command (see section <A HREF="gdb_9.html#SEC57">Output formats</A>).
<P>
<DT><SAMP>`<VAR>word-size</VAR>'</SAMP>
<DD>The size of each memory word in bytes.
<P>
<DT><SAMP>`<VAR>nr-rows</VAR>'</SAMP>
<DD>The number of rows in the output table.
<P>
<DT><SAMP>`<VAR>nr-cols</VAR>'</SAMP>
<DD>The number of columns in the output table.
<P>
<DT><SAMP>`<VAR>aschar</VAR>'</SAMP>
<DD>If present, indicates that each row should include an ASCII dump. The
value of <VAR>aschar</VAR> is used as a padding character when a byte is not a
member of the printable ASCII character set (printable ASCII
characters are those whose code is between 32 and 126, inclusively).
<P>
<DT><SAMP>`<VAR>byte-offset</VAR>'</SAMP>
<DD>An offset to add to the <VAR>address</VAR> before fetching memory.
</DL>
<P>
This command displays memory contents as a table of <VAR>nr-rows</VAR> by
<VAR>nr-cols</VAR> words, each word being <VAR>word-size</VAR> bytes. In total,
<CODE><VAR>nr-rows</VAR> * <VAR>nr-cols</VAR> * <VAR>word-size</VAR></CODE> bytes are read
(returned as <SAMP>`total-bytes'</SAMP>). Should less than the requested number
of bytes be returned by the target, the missing words are identified
using <SAMP>`N/A'</SAMP>. The number of bytes read from the target is returned
in <SAMP>`nr-bytes'</SAMP> and the starting address used to read memory in
<SAMP>`addr'</SAMP>.
</P><P>
The address of the next/previous row or page is available in
<SAMP>`next-row'</SAMP> and <SAMP>`prev-row'</SAMP>, <SAMP>`next-page'</SAMP> and
<SAMP>`prev-page'</SAMP>.
</P><P>
<A NAME="SEC306"></A>
<H4> GDB Command </H4>
<!--docid::SEC306::-->
<P>
The corresponding GDB command is <SAMP>`x'</SAMP>. <CODE>gdbtk</CODE> has
<SAMP>`gdb_get_mem'</SAMP> memory read command.
</P><P>
<A NAME="SEC307"></A>
<H4> Example </H4>
<!--docid::SEC307::-->
<P>
Read six bytes of memory starting at <CODE>bytes+6</CODE> but then offset by
<CODE>-6</CODE> bytes. Format as three rows of two columns. One byte per
word. Display each word in hex.
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
9-data-read-memory -o -6 -- bytes+6 x 1 3 2
9^done,addr="0x00001390",nr-bytes="6",total-bytes="6",
next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396",
prev-page="0x0000138a",memory=[
{addr="0x00001390",data=["0x00","0x01"]},
{addr="0x00001392",data=["0x02","0x03"]},
{addr="0x00001394",data=["0x04","0x05"]}]
(gdb)
</FONT></pre></td></tr></table></P><P>
Read two bytes of memory starting at address <CODE>shorts + 64</CODE> and
display as a single word formatted in decimal.
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
5-data-read-memory shorts+64 d 2 1 1
5^done,addr="0x00001510",nr-bytes="2",total-bytes="2",
next-row="0x00001512",prev-row="0x0000150e",
next-page="0x00001512",prev-page="0x0000150e",memory=[
{addr="0x00001510",data=["128"]}]
(gdb)
</FONT></pre></td></tr></table></P><P>
Read thirty two bytes of memory starting at <CODE>bytes+16</CODE> and format
as eight rows of four columns. Include a string encoding with <SAMP>`x'</SAMP>
used as the non-printable character.
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
4-data-read-memory bytes+16 x 1 8 4 x
4^done,addr="0x000013a0",nr-bytes="32",total-bytes="32",
next-row="0x000013c0",prev-row="0x0000139c",
next-page="0x000013c0",prev-page="0x00001380",memory=[
{addr="0x000013a0",data=["0x10","0x11","0x12","0x13"],ascii="xxxx"},
{addr="0x000013a4",data=["0x14","0x15","0x16","0x17"],ascii="xxxx"},
{addr="0x000013a8",data=["0x18","0x19","0x1a","0x1b"],ascii="xxxx"},
{addr="0x000013ac",data=["0x1c","0x1d","0x1e","0x1f"],ascii="xxxx"},
{addr="0x000013b0",data=["0x20","0x21","0x22","0x23"],ascii=" !\"#"},
{addr="0x000013b4",data=["0x24","0x25","0x26","0x27"],ascii="$%&'"},
{addr="0x000013b8",data=["0x28","0x29","0x2a","0x2b"],ascii="()*+"},
{addr="0x000013bc",data=["0x2c","0x2d","0x2e","0x2f"],ascii=",-./"}]
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC308"></A>
<H3> The <CODE>-display-delete</CODE> Command </H3>
<!--docid::SEC308::-->
<P>
<A NAME="SEC309"></A>
<H4> Synopsis </H4>
<!--docid::SEC309::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -display-delete <VAR>number</VAR>
</pre></td></tr></table></P><P>
Delete the display <VAR>number</VAR>.
</P><P>
<A NAME="SEC310"></A>
<H4> GDB Command </H4>
<!--docid::SEC310::-->
<P>
The corresponding GDB command is <SAMP>`delete display'</SAMP>.
</P><P>
<A NAME="SEC311"></A>
<H4> Example </H4>
<!--docid::SEC311::-->
N.A.
<P>
<A NAME="SEC312"></A>
<H3> The <CODE>-display-disable</CODE> Command </H3>
<!--docid::SEC312::-->
<P>
<A NAME="SEC313"></A>
<H4> Synopsis </H4>
<!--docid::SEC313::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -display-disable <VAR>number</VAR>
</pre></td></tr></table></P><P>
Disable display <VAR>number</VAR>.
</P><P>
<A NAME="SEC314"></A>
<H4> GDB Command </H4>
<!--docid::SEC314::-->
<P>
The corresponding GDB command is <SAMP>`disable display'</SAMP>.
</P><P>
<A NAME="SEC315"></A>
<H4> Example </H4>
<!--docid::SEC315::-->
N.A.
<P>
<A NAME="SEC316"></A>
<H3> The <CODE>-display-enable</CODE> Command </H3>
<!--docid::SEC316::-->
<P>
<A NAME="SEC317"></A>
<H4> Synopsis </H4>
<!--docid::SEC317::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -display-enable <VAR>number</VAR>
</pre></td></tr></table></P><P>
Enable display <VAR>number</VAR>.
</P><P>
<A NAME="SEC318"></A>
<H4> GDB Command </H4>
<!--docid::SEC318::-->
<P>
The corresponding GDB command is <SAMP>`enable display'</SAMP>.
</P><P>
<A NAME="SEC319"></A>
<H4> Example </H4>
<!--docid::SEC319::-->
N.A.
<P>
<A NAME="SEC320"></A>
<H3> The <CODE>-display-insert</CODE> Command </H3>
<!--docid::SEC320::-->
<P>
<A NAME="SEC321"></A>
<H4> Synopsis </H4>
<!--docid::SEC321::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -display-insert <VAR>expression</VAR>
</pre></td></tr></table></P><P>
Display <VAR>expression</VAR> every time the program stops.
</P><P>
<A NAME="SEC322"></A>
<H4> GDB Command </H4>
<!--docid::SEC322::-->
<P>
The corresponding GDB command is <SAMP>`display'</SAMP>.
</P><P>
<A NAME="SEC323"></A>
<H4> Example </H4>
<!--docid::SEC323::-->
N.A.
<P>
<A NAME="SEC324"></A>
<H3> The <CODE>-display-list</CODE> Command </H3>
<!--docid::SEC324::-->
<P>
<A NAME="SEC325"></A>
<H4> Synopsis </H4>
<!--docid::SEC325::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -display-list
</pre></td></tr></table></P><P>
List the displays. Do not show the current values.
</P><P>
<A NAME="SEC326"></A>
<H4> GDB Command </H4>
<!--docid::SEC326::-->
<P>
The corresponding GDB command is <SAMP>`info display'</SAMP>.
</P><P>
<A NAME="SEC327"></A>
<H4> Example </H4>
<!--docid::SEC327::-->
N.A.
<P>
<A NAME="SEC328"></A>
<H3> The <CODE>-environment-cd</CODE> Command </H3>
<!--docid::SEC328::-->
<P>
<A NAME="SEC329"></A>
<H4> Synopsis </H4>
<!--docid::SEC329::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -environment-cd <VAR>pathdir</VAR>
</pre></td></tr></table></P><P>
Set GDB's working directory.
</P><P>
<A NAME="SEC330"></A>
<H4> GDB Command </H4>
<!--docid::SEC330::-->
<P>
The corresponding GDB command is <SAMP>`cd'</SAMP>.
</P><P>
<A NAME="SEC331"></A>
<H4> Example </H4>
<!--docid::SEC331::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
^done
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC332"></A>
<H3> The <CODE>-environment-directory</CODE> Command </H3>
<!--docid::SEC332::-->
<P>
<A NAME="SEC333"></A>
<H4> Synopsis </H4>
<!--docid::SEC333::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -environment-directory <VAR>pathdir</VAR>
</pre></td></tr></table></P><P>
Add directory <VAR>pathdir</VAR> to beginning of search path for source files.
</P><P>
<A NAME="SEC334"></A>
<H4> GDB Command </H4>
<!--docid::SEC334::-->
<P>
The corresponding GDB command is <SAMP>`dir'</SAMP>.
</P><P>
<A NAME="SEC335"></A>
<H4> Example </H4>
<!--docid::SEC335::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
^done
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC336"></A>
<H3> The <CODE>-environment-path</CODE> Command </H3>
<!--docid::SEC336::-->
<P>
<A NAME="SEC337"></A>
<H4> Synopsis </H4>
<!--docid::SEC337::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -environment-path ( <VAR>pathdir</VAR> )+
</pre></td></tr></table></P><P>
Add directories <VAR>pathdir</VAR> to beginning of search path for object files.
</P><P>
<A NAME="SEC338"></A>
<H4> GDB Command </H4>
<!--docid::SEC338::-->
<P>
The corresponding GDB command is <SAMP>`path'</SAMP>.
</P><P>
<A NAME="SEC339"></A>
<H4> Example </H4>
<!--docid::SEC339::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb
^done
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC340"></A>
<H3> The <CODE>-environment-pwd</CODE> Command </H3>
<!--docid::SEC340::-->
<P>
<A NAME="SEC341"></A>
<H4> Synopsis </H4>
<!--docid::SEC341::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -environment-pwd
</pre></td></tr></table></P><P>
Show the current working directory.
</P><P>
<A NAME="SEC342"></A>
<H4> GDB command </H4>
<!--docid::SEC342::-->
<P>
The corresponding GDB command is <SAMP>`pwd'</SAMP>.
</P><P>
<A NAME="SEC343"></A>
<H4> Example </H4>
<!--docid::SEC343::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-environment-pwd
~Working directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb.
^done
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="GDB/MI Program Control"></A>
<HR SIZE="6">
<A NAME="SEC344"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC282"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC427"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC427"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC595"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 24.7 GDB/MI Program control </H2>
<!--docid::SEC344::-->
<P>
<A NAME="SEC345"></A>
<H4> Program termination </H4>
<!--docid::SEC345::-->
<P>
As a result of execution, the inferior program can run to completion, if
it doesn't encounter any breakpoints. In this case the output will
include an exit code, if the program has exited exceptionally.
</P><P>
<A NAME="SEC346"></A>
<H4> Examples </H4>
<!--docid::SEC346::-->
<P>
Program exited normally:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-exec-run
^running
(gdb)
x = 55
*stopped,reason="exited-normally"
(gdb)
</FONT></pre></td></tr></table></P><P>
Program exited exceptionally:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-exec-run
^running
(gdb)
x = 55
*stopped,reason="exited",exit-code="01"
(gdb)
</FONT></pre></td></tr></table></P><P>
Another way the program can terminate is if it receives a signal such as
<CODE>SIGINT</CODE>. In this case, GDB/MI displays this:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
*stopped,reason="exited-signalled",signal-name="SIGINT",
signal-meaning="Interrupt"
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC347"></A>
<H3> The <CODE>-exec-abort</CODE> Command </H3>
<!--docid::SEC347::-->
<P>
<A NAME="SEC348"></A>
<H4> Synopsis </H4>
<!--docid::SEC348::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -exec-abort
</pre></td></tr></table></P><P>
Kill the inferior running program.
</P><P>
<A NAME="SEC349"></A>
<H4> GDB Command </H4>
<!--docid::SEC349::-->
<P>
The corresponding GDB command is <SAMP>`kill'</SAMP>.
</P><P>
<A NAME="SEC350"></A>
<H4> Example </H4>
<!--docid::SEC350::-->
N.A.
<P>
<A NAME="SEC351"></A>
<H3> The <CODE>-exec-arguments</CODE> Command </H3>
<!--docid::SEC351::-->
<P>
<A NAME="SEC352"></A>
<H4> Synopsis </H4>
<!--docid::SEC352::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -exec-arguments <VAR>args</VAR>
</pre></td></tr></table></P><P>
Set the inferior program arguments, to be used in the next
<SAMP>`-exec-run'</SAMP>.
</P><P>
<A NAME="SEC353"></A>
<H4> GDB Command </H4>
<!--docid::SEC353::-->
<P>
The corresponding GDB command is <SAMP>`set args'</SAMP>.
</P><P>
<A NAME="SEC354"></A>
<H4> Example </H4>
<!--docid::SEC354::-->
<P>
Don't have one around.
</P><P>
<A NAME="SEC355"></A>
<H3> The <CODE>-exec-continue</CODE> Command </H3>
<!--docid::SEC355::-->
<P>
<A NAME="SEC356"></A>
<H4> Synopsis </H4>
<!--docid::SEC356::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -exec-continue
</pre></td></tr></table></P><P>
Asynchronous command. Resumes the execution of the inferior program
until a breakpoint is encountered, or until the inferior exits.
</P><P>
<A NAME="SEC357"></A>
<H4> GDB Command </H4>
<!--docid::SEC357::-->
<P>
The corresponding GDB corresponding is <SAMP>`continue'</SAMP>.
</P><P>
<A NAME="SEC358"></A>
<H4> Example </H4>
<!--docid::SEC358::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>-exec-continue
^running
(gdb)
@Hello world
*stopped,reason="breakpoint-hit",bkptno="2",frame={func="foo",args=[],
file="hello.c",line="13"}
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC359"></A>
<H3> The <CODE>-exec-finish</CODE> Command </H3>
<!--docid::SEC359::-->
<P>
<A NAME="SEC360"></A>
<H4> Synopsis </H4>
<!--docid::SEC360::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -exec-finish
</pre></td></tr></table></P><P>
Asynchronous command. Resumes the execution of the inferior program
until the current function is exited. Displays the results returned by
the function.
</P><P>
<A NAME="SEC361"></A>
<H4> GDB Command </H4>
<!--docid::SEC361::-->
<P>
The corresponding GDB command is <SAMP>`finish'</SAMP>.
</P><P>
<A NAME="SEC362"></A>
<H4> Example </H4>
<!--docid::SEC362::-->
<P>
Function returning <CODE>void</CODE>.
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>-exec-finish
^running
(gdb)
@hello from foo
*stopped,reason="function-finished",frame={func="main",args=[],
file="hello.c",line="7"}
(gdb)
</FONT></pre></td></tr></table></P><P>
Function returning other than <CODE>void</CODE>. The name of the internal
GDB variable storing the result is printed, together with the
value itself.
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>-exec-finish
^running
(gdb)
*stopped,reason="function-finished",frame={addr="0x000107b0",func="foo",
args=[{name="a",value="1"],{name="b",value="9"}},
file="recursive2.c",line="14"},
gdb-result-var="$1",return-value="0"
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC363"></A>
<H3> The <CODE>-exec-interrupt</CODE> Command </H3>
<!--docid::SEC363::-->
<P>
<A NAME="SEC364"></A>
<H4> Synopsis </H4>
<!--docid::SEC364::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -exec-interrupt
</pre></td></tr></table></P><P>
Asynchronous command. Interrupts the background execution of the target.
Note how the token associated with the stop message is the one for the
execution command that has been interrupted. The token for the interrupt
itself only appears in the <SAMP>`^done'</SAMP> output. If the user is trying to
interrupt a non-running program, an error message will be printed.
</P><P>
<A NAME="SEC365"></A>
<H4> GDB Command </H4>
<!--docid::SEC365::-->
<P>
The corresponding GDB command is <SAMP>`interrupt'</SAMP>.
</P><P>
<A NAME="SEC366"></A>
<H4> Example </H4>
<!--docid::SEC366::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
111-exec-continue
111^running
(gdb)
222-exec-interrupt
222^done
(gdb)
111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
frame={addr="0x00010140",func="foo",args=[],file="try.c",line="13"}
(gdb)
(gdb)
-exec-interrupt
^error,msg="mi_cmd_exec_interrupt: Inferior not executing."
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC367"></A>
<H3> The <CODE>-exec-next</CODE> Command </H3>
<!--docid::SEC367::-->
<P>
<A NAME="SEC368"></A>
<H4> Synopsis </H4>
<!--docid::SEC368::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -exec-next
</pre></td></tr></table></P><P>
Asynchronous command. Resumes execution of the inferior program, stopping
when the beginning of the next source line is reached.
</P><P>
<A NAME="SEC369"></A>
<H4> GDB Command </H4>
<!--docid::SEC369::-->
<P>
The corresponding GDB command is <SAMP>`next'</SAMP>.
</P><P>
<A NAME="SEC370"></A>
<H4> Example </H4>
<!--docid::SEC370::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>-exec-next
^running
(gdb)
*stopped,reason="end-stepping-range",line="8",file="hello.c"
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC371"></A>
<H3> The <CODE>-exec-next-instruction</CODE> Command </H3>
<!--docid::SEC371::-->
<P>
<A NAME="SEC372"></A>
<H4> Synopsis </H4>
<!--docid::SEC372::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -exec-next-instruction
</pre></td></tr></table></P><P>
Asynchronous command. Executes one machine instruction. If the
instruction is a function call continues until the function returns. If
the program stops at an instruction in the middle of a source line, the
address will be printed as well.
</P><P>
<A NAME="SEC373"></A>
<H4> GDB Command </H4>
<!--docid::SEC373::-->
<P>
The corresponding GDB command is <SAMP>`nexti'</SAMP>.
</P><P>
<A NAME="SEC374"></A>
<H4> Example </H4>
<!--docid::SEC374::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-exec-next-instruction
^running
(gdb)
*stopped,reason="end-stepping-range",
addr="0x000100d4",line="5",file="hello.c"
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC375"></A>
<H3> The <CODE>-exec-return</CODE> Command </H3>
<!--docid::SEC375::-->
<P>
<A NAME="SEC376"></A>
<H4> Synopsis </H4>
<!--docid::SEC376::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -exec-return
</pre></td></tr></table></P><P>
Makes current function return immediately. Doesn't execute the inferior.
Displays the new current frame.
</P><P>
<A NAME="SEC377"></A>
<H4> GDB Command </H4>
<!--docid::SEC377::-->
<P>
The corresponding GDB command is <SAMP>`return'</SAMP>.
</P><P>
<A NAME="SEC378"></A>
<H4> Example </H4>
<!--docid::SEC378::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
200-break-insert callee4
200^done,bkpt={number="1",addr="0x00010734",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"}
(gdb)
000-exec-run
000^running
(gdb)
000*stopped,reason="breakpoint-hit",bkptno="1",
frame={func="callee4",args=[],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"}
(gdb)
205-break-delete
205^done
(gdb)
111-exec-return
111^done,frame={level="0",func="callee3",
args=[{name="strarg",
value="0x11940 \"A string argument.\""}],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"}
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC379"></A>
<H3> The <CODE>-exec-run</CODE> Command </H3>
<!--docid::SEC379::-->
<P>
<A NAME="SEC380"></A>
<H4> Synopsis </H4>
<!--docid::SEC380::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -exec-run
</pre></td></tr></table></P><P>
Asynchronous command. Starts execution of the inferior from the
beginning. The inferior executes until either a breakpoint is
encountered or the program exits.
</P><P>
<A NAME="SEC381"></A>
<H4> GDB Command </H4>
<!--docid::SEC381::-->
<P>
The corresponding GDB command is <SAMP>`run'</SAMP>.
</P><P>
<A NAME="SEC382"></A>
<H4> Example </H4>
<!--docid::SEC382::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-break-insert main
^done,bkpt={number="1",addr="0x0001072c",file="recursive2.c",line="4"}
(gdb)
-exec-run
^running
(gdb)
*stopped,reason="breakpoint-hit",bkptno="1",
frame={func="main",args=[],file="recursive2.c",line="4"}
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC383"></A>
<H3> The <CODE>-exec-show-arguments</CODE> Command </H3>
<!--docid::SEC383::-->
<P>
<A NAME="SEC384"></A>
<H4> Synopsis </H4>
<!--docid::SEC384::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -exec-show-arguments
</pre></td></tr></table></P><P>
Print the arguments of the program.
</P><P>
<A NAME="SEC385"></A>
<H4> GDB Command </H4>
<!--docid::SEC385::-->
<P>
The corresponding GDB command is <SAMP>`show args'</SAMP>.
</P><P>
<A NAME="SEC386"></A>
<H4> Example </H4>
<!--docid::SEC386::-->
N.A.
<P>
<A NAME="SEC387"></A>
<H3> The <CODE>-exec-step</CODE> Command </H3>
<!--docid::SEC387::-->
<P>
<A NAME="SEC388"></A>
<H4> Synopsis </H4>
<!--docid::SEC388::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -exec-step
</pre></td></tr></table></P><P>
Asynchronous command. Resumes execution of the inferior program, stopping
when the beginning of the next source line is reached, if the next
source line is not a function call. If it is, stop at the first
instruction of the called function.
</P><P>
<A NAME="SEC389"></A>
<H4> GDB Command </H4>
<!--docid::SEC389::-->
<P>
The corresponding GDB command is <SAMP>`step'</SAMP>.
</P><P>
<A NAME="SEC390"></A>
<H4> Example </H4>
<!--docid::SEC390::-->
<P>
Stepping into a function:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>-exec-step
^running
(gdb)
*stopped,reason="end-stepping-range",
frame={func="foo",args=[{name="a",value="10"},
{name="b",value="0"}],file="recursive2.c",line="11"}
(gdb)
</FONT></pre></td></tr></table></P><P>
Regular stepping:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>-exec-step
^running
(gdb)
*stopped,reason="end-stepping-range",line="14",file="recursive2.c"
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC391"></A>
<H3> The <CODE>-exec-step-instruction</CODE> Command </H3>
<!--docid::SEC391::-->
<P>
<A NAME="SEC392"></A>
<H4> Synopsis </H4>
<!--docid::SEC392::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -exec-step-instruction
</pre></td></tr></table></P><P>
Asynchronous command. Resumes the inferior which executes one machine
instruction. The output, once GDB has stopped, will vary depending on
whether we have stopped in the middle of a source line or not. In the
former case, the address at which the program stopped will be printed as
well.
</P><P>
<A NAME="SEC393"></A>
<H4> GDB Command </H4>
<!--docid::SEC393::-->
<P>
The corresponding GDB command is <SAMP>`stepi'</SAMP>.
</P><P>
<A NAME="SEC394"></A>
<H4> Example </H4>
<!--docid::SEC394::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-exec-step-instruction
^running
(gdb)
*stopped,reason="end-stepping-range",
frame={func="foo",args=[],file="try.c",line="10"}
(gdb)
-exec-step-instruction
^running
(gdb)
*stopped,reason="end-stepping-range",
frame={addr="0x000100f4",func="foo",args=[],file="try.c",line="10"}
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC395"></A>
<H3> The <CODE>-exec-until</CODE> Command </H3>
<!--docid::SEC395::-->
<P>
<A NAME="SEC396"></A>
<H4> Synopsis </H4>
<!--docid::SEC396::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -exec-until [ <VAR>location</VAR> ]
</pre></td></tr></table></P><P>
Asynchronous command. Executes the inferior until the <VAR>location</VAR>
specified in the argument is reached. If there is no argument, the inferior
executes until a source line greater than the current one is reached.
The reason for stopping in this case will be <SAMP>`location-reached'</SAMP>.
</P><P>
<A NAME="SEC397"></A>
<H4> GDB Command </H4>
<!--docid::SEC397::-->
<P>
The corresponding GDB command is <SAMP>`until'</SAMP>.
</P><P>
<A NAME="SEC398"></A>
<H4> Example </H4>
<!--docid::SEC398::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-exec-until recursive2.c:6
^running
(gdb)
x = 55
*stopped,reason="location-reached",frame={func="main",args=[],
file="recursive2.c",line="6"}
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC399"></A>
<H3> The <CODE>-file-exec-and-symbols</CODE> Command </H3>
<!--docid::SEC399::-->
<P>
<A NAME="SEC400"></A>
<H4> Synopsis </H4>
<!--docid::SEC400::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -file-exec-and-symbols <VAR>file</VAR>
</pre></td></tr></table></P><P>
Specify the executable file to be debugged. This file is the one from
which the symbol table is also read. If no file is specified, the
command clears the executable and symbol information. If breakpoints
are set when using this command with no arguments, GDB will produce
error messages. Otherwise, no output is produced, except a completion
notification.
</P><P>
<A NAME="SEC401"></A>
<H4> GDB Command </H4>
<!--docid::SEC401::-->
<P>
The corresponding GDB command is <SAMP>`file'</SAMP>.
</P><P>
<A NAME="SEC402"></A>
<H4> Example </H4>
<!--docid::SEC402::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC403"></A>
<H3> The <CODE>-file-exec-file</CODE> Command </H3>
<!--docid::SEC403::-->
<P>
<A NAME="SEC404"></A>
<H4> Synopsis </H4>
<!--docid::SEC404::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -file-exec-file <VAR>file</VAR>
</pre></td></tr></table></P><P>
Specify the executable file to be debugged. Unlike
<SAMP>`-file-exec-and-symbols'</SAMP>, the symbol table is <EM>not</EM> read
from this file. If used without argument, GDB clears the information
about the executable file. No output is produced, except a completion
notification.
</P><P>
<A NAME="SEC405"></A>
<H4> GDB Command </H4>
<!--docid::SEC405::-->
<P>
The corresponding GDB command is <SAMP>`exec-file'</SAMP>.
</P><P>
<A NAME="SEC406"></A>
<H4> Example </H4>
<!--docid::SEC406::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC407"></A>
<H3> The <CODE>-file-list-exec-sections</CODE> Command </H3>
<!--docid::SEC407::-->
<P>
<A NAME="SEC408"></A>
<H4> Synopsis </H4>
<!--docid::SEC408::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -file-list-exec-sections
</pre></td></tr></table></P><P>
List the sections of the current executable file.
</P><P>
<A NAME="SEC409"></A>
<H4> GDB Command </H4>
<!--docid::SEC409::-->
<P>
The GDB command <SAMP>`info file'</SAMP> shows, among the rest, the same
information as this command. <CODE>gdbtk</CODE> has a corresponding command
<SAMP>`gdb_load_info'</SAMP>.
</P><P>
<A NAME="SEC410"></A>
<H4> Example </H4>
<!--docid::SEC410::-->
N.A.
<P>
<A NAME="SEC411"></A>
<H3> The <CODE>-file-list-exec-source-files</CODE> Command </H3>
<!--docid::SEC411::-->
<P>
<A NAME="SEC412"></A>
<H4> Synopsis </H4>
<!--docid::SEC412::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -file-list-exec-source-files
</pre></td></tr></table></P><P>
List the source files for the current executable.
</P><P>
<A NAME="SEC413"></A>
<H4> GDB Command </H4>
<!--docid::SEC413::-->
<P>
There's no GDB command which directly corresponds to this one.
<CODE>gdbtk</CODE> has an analogous command <SAMP>`gdb_listfiles'</SAMP>.
</P><P>
<A NAME="SEC414"></A>
<H4> Example </H4>
<!--docid::SEC414::-->
N.A.
<P>
<A NAME="SEC415"></A>
<H3> The <CODE>-file-list-shared-libraries</CODE> Command </H3>
<!--docid::SEC415::-->
<P>
<A NAME="SEC416"></A>
<H4> Synopsis </H4>
<!--docid::SEC416::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -file-list-shared-libraries
</pre></td></tr></table></P><P>
List the shared libraries in the program.
</P><P>
<A NAME="SEC417"></A>
<H4> GDB Command </H4>
<!--docid::SEC417::-->
<P>
The corresponding GDB command is <SAMP>`info shared'</SAMP>.
</P><P>
<A NAME="SEC418"></A>
<H4> Example </H4>
<!--docid::SEC418::-->
N.A.
<P>
<A NAME="SEC419"></A>
<H3> The <CODE>-file-list-symbol-files</CODE> Command </H3>
<!--docid::SEC419::-->
<P>
<A NAME="SEC420"></A>
<H4> Synopsis </H4>
<!--docid::SEC420::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -file-list-symbol-files
</pre></td></tr></table></P><P>
List symbol files.
</P><P>
<A NAME="SEC421"></A>
<H4> GDB Command </H4>
<!--docid::SEC421::-->
<P>
The corresponding GDB command is <SAMP>`info file'</SAMP> (part of it).
</P><P>
<A NAME="SEC422"></A>
<H4> Example </H4>
<!--docid::SEC422::-->
N.A.
<P>
<A NAME="SEC423"></A>
<H3> The <CODE>-file-symbol-file</CODE> Command </H3>
<!--docid::SEC423::-->
<P>
<A NAME="SEC424"></A>
<H4> Synopsis </H4>
<!--docid::SEC424::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -file-symbol-file <VAR>file</VAR>
</pre></td></tr></table></P><P>
Read symbol table info from the specified <VAR>file</VAR> argument. When
used without arguments, clears GDB's symbol table info. No output is
produced, except for a completion notification.
</P><P>
<A NAME="SEC425"></A>
<H4> GDB Command </H4>
<!--docid::SEC425::-->
<P>
The corresponding GDB command is <SAMP>`symbol-file'</SAMP>.
</P><P>
<A NAME="SEC426"></A>
<H4> Example </H4>
<!--docid::SEC426::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="GDB/MI Miscellaneous Commands"></A>
<HR SIZE="6">
<A NAME="SEC427"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC344"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC444"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC444"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC595"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 24.8 Miscellaneous GDB commands in GDB/MI </H2>
<!--docid::SEC427::-->
<P>
<A NAME="SEC428"></A>
<H3> The <CODE>-gdb-exit</CODE> Command </H3>
<!--docid::SEC428::-->
<P>
<A NAME="SEC429"></A>
<H4> Synopsis </H4>
<!--docid::SEC429::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -gdb-exit
</pre></td></tr></table></P><P>
Exit GDB immediately.
</P><P>
<A NAME="SEC430"></A>
<H4> GDB Command </H4>
<!--docid::SEC430::-->
<P>
Approximately corresponds to <SAMP>`quit'</SAMP>.
</P><P>
<A NAME="SEC431"></A>
<H4> Example </H4>
<!--docid::SEC431::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-gdb-exit
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC432"></A>
<H3> The <CODE>-gdb-set</CODE> Command </H3>
<!--docid::SEC432::-->
<P>
<A NAME="SEC433"></A>
<H4> Synopsis </H4>
<!--docid::SEC433::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -gdb-set
</pre></td></tr></table></P><P>
Set an internal GDB variable.
</P><P>
<A NAME="SEC434"></A>
<H4> GDB Command </H4>
<!--docid::SEC434::-->
<P>
The corresponding GDB command is <SAMP>`set'</SAMP>.
</P><P>
<A NAME="SEC435"></A>
<H4> Example </H4>
<!--docid::SEC435::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-gdb-set $foo=3
^done
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC436"></A>
<H3> The <CODE>-gdb-show</CODE> Command </H3>
<!--docid::SEC436::-->
<P>
<A NAME="SEC437"></A>
<H4> Synopsis </H4>
<!--docid::SEC437::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -gdb-show
</pre></td></tr></table></P><P>
Show the current value of a GDB variable.
</P><P>
<A NAME="SEC438"></A>
<H4> GDB command </H4>
<!--docid::SEC438::-->
<P>
The corresponding GDB command is <SAMP>`show'</SAMP>.
</P><P>
<A NAME="SEC439"></A>
<H4> Example </H4>
<!--docid::SEC439::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-gdb-show annotate
^done,value="0"
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC440"></A>
<H3> The <CODE>-gdb-version</CODE> Command </H3>
<!--docid::SEC440::-->
<P>
<A NAME="SEC441"></A>
<H4> Synopsis </H4>
<!--docid::SEC441::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -gdb-version
</pre></td></tr></table></P><P>
Show version information for GDB. Used mostly in testing.
</P><P>
<A NAME="SEC442"></A>
<H4> GDB Command </H4>
<!--docid::SEC442::-->
<P>
There's no equivalent GDB command. GDB by default shows this
information when you start an interactive session.
</P><P>
<A NAME="SEC443"></A>
<H4> Example </H4>
<!--docid::SEC443::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-gdb-version
~GNU gdb 5.2.1
~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
"--host=sparc-sun-solaris2.5.1 --target=ppc-eabi".
^done
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="GDB/MI Stack Manipulation"></A>
<HR SIZE="6">
<A NAME="SEC444"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC427"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC469"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC595"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 24.9 GDB/MI Stack Manipulation Commands </H2>
<!--docid::SEC444::-->
<P>
<A NAME="SEC445"></A>
<H3> The <CODE>-stack-info-frame</CODE> Command </H3>
<!--docid::SEC445::-->
<P>
<A NAME="SEC446"></A>
<H4> Synopsis </H4>
<!--docid::SEC446::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -stack-info-frame
</pre></td></tr></table></P><P>
Get info on the current frame.
</P><P>
<A NAME="SEC447"></A>
<H4> GDB Command </H4>
<!--docid::SEC447::-->
<P>
The corresponding GDB command is <SAMP>`info frame'</SAMP> or <SAMP>`frame'</SAMP>
(without arguments).
</P><P>
<A NAME="SEC448"></A>
<H4> Example </H4>
<!--docid::SEC448::-->
N.A.
<P>
<A NAME="SEC449"></A>
<H3> The <CODE>-stack-info-depth</CODE> Command </H3>
<!--docid::SEC449::-->
<P>
<A NAME="SEC450"></A>
<H4> Synopsis </H4>
<!--docid::SEC450::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -stack-info-depth [ <VAR>max-depth</VAR> ]
</pre></td></tr></table></P><P>
Return the depth of the stack. If the integer argument <VAR>max-depth</VAR>
is specified, do not count beyond <VAR>max-depth</VAR> frames.
</P><P>
<A NAME="SEC451"></A>
<H4> GDB Command </H4>
<!--docid::SEC451::-->
<P>
There's no equivalent GDB command.
</P><P>
<A NAME="SEC452"></A>
<H4> Example </H4>
<!--docid::SEC452::-->
<P>
For a stack with frame levels 0 through 11:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-stack-info-depth
^done,depth="12"
(gdb)
-stack-info-depth 4
^done,depth="4"
(gdb)
-stack-info-depth 12
^done,depth="12"
(gdb)
-stack-info-depth 11
^done,depth="11"
(gdb)
-stack-info-depth 13
^done,depth="12"
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC453"></A>
<H3> The <CODE>-stack-list-arguments</CODE> Command </H3>
<!--docid::SEC453::-->
<P>
<A NAME="SEC454"></A>
<H4> Synopsis </H4>
<!--docid::SEC454::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -stack-list-arguments <VAR>show-values</VAR>
[ <VAR>low-frame</VAR> <VAR>high-frame</VAR> ]
</pre></td></tr></table></P><P>
Display a list of the arguments for the frames between <VAR>low-frame</VAR>
and <VAR>high-frame</VAR> (inclusive). If <VAR>low-frame</VAR> and
<VAR>high-frame</VAR> are not provided, list the arguments for the whole call
stack.
</P><P>
The <VAR>show-values</VAR> argument must have a value of 0 or 1. A value of
0 means that only the names of the arguments are listed, a value of 1
means that both names and values of the arguments are printed.
</P><P>
<A NAME="SEC455"></A>
<H4> GDB Command </H4>
<!--docid::SEC455::-->
<P>
GDB does not have an equivalent command. <CODE>gdbtk</CODE> has a
<SAMP>`gdb_get_args'</SAMP> command which partially overlaps with the
functionality of <SAMP>`-stack-list-arguments'</SAMP>.
</P><P>
<A NAME="SEC456"></A>
<H4> Example </H4>
<!--docid::SEC456::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-stack-list-frames
^done,
stack=[
frame={level="0",addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"},
frame={level="1",addr="0x0001076c",func="callee3",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"},
frame={level="2",addr="0x0001078c",func="callee2",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"},
frame={level="3",addr="0x000107b4",func="callee1",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"},
frame={level="4",addr="0x000107e0",func="main",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"}]
(gdb)
-stack-list-arguments 0
^done,
stack-args=[
frame={level="0",args=[]},
frame={level="1",args=[name="strarg"]},
frame={level="2",args=[name="intarg",name="strarg"]},
frame={level="3",args=[name="intarg",name="strarg",name="fltarg"]},
frame={level="4",args=[]}]
(gdb)
-stack-list-arguments 1
^done,
stack-args=[
frame={level="0",args=[]},
frame={level="1",
args=[{name="strarg",value="0x11940 \"A string argument.\""}]},
frame={level="2",args=[
{name="intarg",value="2"},
{name="strarg",value="0x11940 \"A string argument.\""}]},
{frame={level="3",args=[
{name="intarg",value="2"},
{name="strarg",value="0x11940 \"A string argument.\""},
{name="fltarg",value="3.5"}]},
frame={level="4",args=[]}]
(gdb)
-stack-list-arguments 0 2 2
^done,stack-args=[frame={level="2",args=[name="intarg",name="strarg"]}]
(gdb)
-stack-list-arguments 1 2 2
^done,stack-args=[frame={level="2",
args=[{name="intarg",value="2"},
{name="strarg",value="0x11940 \"A string argument.\""}]}]
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC457"></A>
<H3> The <CODE>-stack-list-frames</CODE> Command </H3>
<!--docid::SEC457::-->
<P>
<A NAME="SEC458"></A>
<H4> Synopsis </H4>
<!--docid::SEC458::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -stack-list-frames [ <VAR>low-frame</VAR> <VAR>high-frame</VAR> ]
</pre></td></tr></table></P><P>
List the frames currently on the stack. For each frame it displays the
following info:
</P><P>
<DL COMPACT>
<DT><SAMP>`<VAR>level</VAR>'</SAMP>
<DD>The frame number, 0 being the topmost frame, i.e. the innermost function.
<DT><SAMP>`<VAR>addr</VAR>'</SAMP>
<DD>The <CODE>$pc</CODE> value for that frame.
<DT><SAMP>`<VAR>func</VAR>'</SAMP>
<DD>Function name.
<DT><SAMP>`<VAR>file</VAR>'</SAMP>
<DD>File name of the source file where the function lives.
<DT><SAMP>`<VAR>line</VAR>'</SAMP>
<DD>Line number corresponding to the <CODE>$pc</CODE>.
</DL>
<P>
If invoked without arguments, this command prints a backtrace for the
whole stack. If given two integer arguments, it shows the frames whose
levels are between the two arguments (inclusive). If the two arguments
are equal, it shows the single frame at the corresponding level.
</P><P>
<A NAME="SEC459"></A>
<H4> GDB Command </H4>
<!--docid::SEC459::-->
<P>
The corresponding GDB commands are <SAMP>`backtrace'</SAMP> and <SAMP>`where'</SAMP>.
</P><P>
<A NAME="SEC460"></A>
<H4> Example </H4>
<!--docid::SEC460::-->
<P>
Full stack backtrace:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-stack-list-frames
^done,stack=
[frame={level="0",addr="0x0001076c",func="foo",
file="recursive2.c",line="11"},
frame={level="1",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="2",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="3",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="4",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="5",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="6",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="7",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="8",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="9",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="10",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="11",addr="0x00010738",func="main",
file="recursive2.c",line="4"}]
(gdb)
</FONT></pre></td></tr></table></P><P>
Show frames between <VAR>low_frame</VAR> and <VAR>high_frame</VAR>:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-stack-list-frames 3 5
^done,stack=
[frame={level="3",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="4",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"},
frame={level="5",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"}]
(gdb)
</FONT></pre></td></tr></table></P><P>
Show a single frame:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-stack-list-frames 3 3
^done,stack=
[frame={level="3",addr="0x000107a4",func="foo",
file="recursive2.c",line="14"}]
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC461"></A>
<H3> The <CODE>-stack-list-locals</CODE> Command </H3>
<!--docid::SEC461::-->
<P>
<A NAME="SEC462"></A>
<H4> Synopsis </H4>
<!--docid::SEC462::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -stack-list-locals <VAR>print-values</VAR>
</pre></td></tr></table></P><P>
Display the local variable names for the current frame. With an
argument of 0 prints only the names of the variables, with argument of 1
prints also their values.
</P><P>
<A NAME="SEC463"></A>
<H4> GDB Command </H4>
<!--docid::SEC463::-->
<P>
<SAMP>`info locals'</SAMP> in GDB, <SAMP>`gdb_get_locals'</SAMP> in <CODE>gdbtk</CODE>.
</P><P>
<A NAME="SEC464"></A>
<H4> Example </H4>
<!--docid::SEC464::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-stack-list-locals 0
^done,locals=[name="A",name="B",name="C"]
(gdb)
-stack-list-locals 1
^done,locals=[{name="A",value="1"},{name="B",value="2"},
{name="C",value="3"}]
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC465"></A>
<H3> The <CODE>-stack-select-frame</CODE> Command </H3>
<!--docid::SEC465::-->
<P>
<A NAME="SEC466"></A>
<H4> Synopsis </H4>
<!--docid::SEC466::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -stack-select-frame <VAR>framenum</VAR>
</pre></td></tr></table></P><P>
Change the current frame. Select a different frame <VAR>framenum</VAR> on
the stack.
</P><P>
<A NAME="SEC467"></A>
<H4> GDB Command </H4>
<!--docid::SEC467::-->
<P>
The corresponding GDB commands are <SAMP>`frame'</SAMP>, <SAMP>`up'</SAMP>,
<SAMP>`down'</SAMP>, <SAMP>`select-frame'</SAMP>, <SAMP>`up-silent'</SAMP>, and <SAMP>`down-silent'</SAMP>.
</P><P>
<A NAME="SEC468"></A>
<H4> Example </H4>
<!--docid::SEC468::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-stack-select-frame 2
^done
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="GDB/MI Symbol Query"></A>
<HR SIZE="6">
<A NAME="SEC469"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC444"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC510"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC229"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC595"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 24.10 GDB/MI Symbol Query Commands </H2>
<!--docid::SEC469::-->
<P>
<A NAME="SEC470"></A>
<H3> The <CODE>-symbol-info-address</CODE> Command </H3>
<!--docid::SEC470::-->
<P>
<A NAME="SEC471"></A>
<H4> Synopsis </H4>
<!--docid::SEC471::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -symbol-info-address <VAR>symbol</VAR>
</pre></td></tr></table></P><P>
Describe where <VAR>symbol</VAR> is stored.
</P><P>
<A NAME="SEC472"></A>
<H4> GDB Command </H4>
<!--docid::SEC472::-->
<P>
The corresponding GDB command is <SAMP>`info address'</SAMP>.
</P><P>
<A NAME="SEC473"></A>
<H4> Example </H4>
<!--docid::SEC473::-->
N.A.
<P>
<A NAME="SEC474"></A>
<H3> The <CODE>-symbol-info-file</CODE> Command </H3>
<!--docid::SEC474::-->
<P>
<A NAME="SEC475"></A>
<H4> Synopsis </H4>
<!--docid::SEC475::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -symbol-info-file
</pre></td></tr></table></P><P>
Show the file for the symbol.
</P><P>
<A NAME="SEC476"></A>
<H4> GDB Command </H4>
<!--docid::SEC476::-->
<P>
There's no equivalent GDB command. <CODE>gdbtk</CODE> has
<SAMP>`gdb_find_file'</SAMP>.
</P><P>
<A NAME="SEC477"></A>
<H4> Example </H4>
<!--docid::SEC477::-->
N.A.
<P>
<A NAME="SEC478"></A>
<H3> The <CODE>-symbol-info-function</CODE> Command </H3>
<!--docid::SEC478::-->
<P>
<A NAME="SEC479"></A>
<H4> Synopsis </H4>
<!--docid::SEC479::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -symbol-info-function
</pre></td></tr></table></P><P>
Show which function the symbol lives in.
</P><P>
<A NAME="SEC480"></A>
<H4> GDB Command </H4>
<!--docid::SEC480::-->
<P>
<SAMP>`gdb_get_function'</SAMP> in <CODE>gdbtk</CODE>.
</P><P>
<A NAME="SEC481"></A>
<H4> Example </H4>
<!--docid::SEC481::-->
N.A.
<P>
<A NAME="SEC482"></A>
<H3> The <CODE>-symbol-info-line</CODE> Command </H3>
<!--docid::SEC482::-->
<P>
<A NAME="SEC483"></A>
<H4> Synopsis </H4>
<!--docid::SEC483::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -symbol-info-line
</pre></td></tr></table></P><P>
Show the core addresses of the code for a source line.
</P><P>
<A NAME="SEC484"></A>
<H4> GDB Command </H4>
<!--docid::SEC484::-->
<P>
The corresponding GDB comamnd is <SAMP>`info line'</SAMP>.
<CODE>gdbtk</CODE> has the <SAMP>`gdb_get_line'</SAMP> and <SAMP>`gdb_get_file'</SAMP> commands.
</P><P>
<A NAME="SEC485"></A>
<H4> Example </H4>
<!--docid::SEC485::-->
N.A.
<P>
<A NAME="SEC486"></A>
<H3> The <CODE>-symbol-info-symbol</CODE> Command </H3>
<!--docid::SEC486::-->
<P>
<A NAME="SEC487"></A>
<H4> Synopsis </H4>
<!--docid::SEC487::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -symbol-info-symbol <VAR>addr</VAR>
</pre></td></tr></table></P><P>
Describe what symbol is at location <VAR>addr</VAR>.
</P><P>
<A NAME="SEC488"></A>
<H4> GDB Command </H4>
<!--docid::SEC488::-->
<P>
The corresponding GDB command is <SAMP>`info symbol'</SAMP>.
</P><P>
<A NAME="SEC489"></A>
<H4> Example </H4>
<!--docid::SEC489::-->
N.A.
<P>
<A NAME="SEC490"></A>
<H3> The <CODE>-symbol-list-functions</CODE> Command </H3>
<!--docid::SEC490::-->
<P>
<A NAME="SEC491"></A>
<H4> Synopsis </H4>
<!--docid::SEC491::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -symbol-list-functions
</pre></td></tr></table></P><P>
List the functions in the executable.
</P><P>
<A NAME="SEC492"></A>
<H4> GDB Command </H4>
<!--docid::SEC492::-->
<P>
<SAMP>`info functions'</SAMP> in GDB, <SAMP>`gdb_listfunc'</SAMP> and
<SAMP>`gdb_search'</SAMP> in <CODE>gdbtk</CODE>.
</P><P>
<A NAME="SEC493"></A>
<H4> Example </H4>
<!--docid::SEC493::-->
N.A.
<P>
<A NAME="SEC494"></A>
<H3> The <CODE>-symbol-list-types</CODE> Command </H3>
<!--docid::SEC494::-->
<P>
<A NAME="SEC495"></A>
<H4> Synopsis </H4>
<!--docid::SEC495::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -symbol-list-types
</pre></td></tr></table></P><P>
List all the type names.
</P><P>
<A NAME="SEC496"></A>
<H4> GDB Command </H4>
<!--docid::SEC496::-->
<P>
The corresponding commands are <SAMP>`info types'</SAMP> in GDB,
<SAMP>`gdb_search'</SAMP> in <CODE>gdbtk</CODE>.
</P><P>
<A NAME="SEC497"></A>
<H4> Example </H4>
<!--docid::SEC497::-->
N.A.
<P>
<A NAME="SEC498"></A>
<H3> The <CODE>-symbol-list-variables</CODE> Command </H3>
<!--docid::SEC498::-->
<P>
<A NAME="SEC499"></A>
<H4> Synopsis </H4>
<!--docid::SEC499::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -symbol-list-variables
</pre></td></tr></table></P><P>
List all the global and static variable names.
</P><P>
<A NAME="SEC500"></A>
<H4> GDB Command </H4>
<!--docid::SEC500::-->
<P>
<SAMP>`info variables'</SAMP> in GDB, <SAMP>`gdb_search'</SAMP> in <CODE>gdbtk</CODE>.
</P><P>
<A NAME="SEC501"></A>
<H4> Example </H4>
<!--docid::SEC501::-->
N.A.
<P>
<A NAME="SEC502"></A>
<H3> The <CODE>-symbol-locate</CODE> Command </H3>
<!--docid::SEC502::-->
<P>
<A NAME="SEC503"></A>
<H4> Synopsis </H4>
<!--docid::SEC503::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -symbol-locate
</pre></td></tr></table></P><P>
<A NAME="SEC504"></A>
<H4> GDB Command </H4>
<!--docid::SEC504::-->
<P>
<SAMP>`gdb_loc'</SAMP> in <CODE>gdbtk</CODE>.
</P><P>
<A NAME="SEC505"></A>
<H4> Example </H4>
<!--docid::SEC505::-->
N.A.
<P>
<A NAME="SEC506"></A>
<H3> The <CODE>-symbol-type</CODE> Command </H3>
<!--docid::SEC506::-->
<P>
<A NAME="SEC507"></A>
<H4> Synopsis </H4>
<!--docid::SEC507::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -symbol-type <VAR>variable</VAR>
</pre></td></tr></table></P><P>
Show type of <VAR>variable</VAR>.
</P><P>
<A NAME="SEC508"></A>
<H4> GDB Command </H4>
<!--docid::SEC508::-->
<P>
The corresponding GDB command is <SAMP>`ptype'</SAMP>, <CODE>gdbtk</CODE> has
<SAMP>`gdb_obj_variable'</SAMP>.
</P><P>
<A NAME="SEC509"></A>
<H4> Example </H4>
<!--docid::SEC509::-->
N.A.
<P>
<A NAME="GDB/MI Target Manipulation"></A>
<HR SIZE="6">
<A NAME="SEC510"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC469"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC547"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC229"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC595"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 24.11 GDB/MI Target Manipulation Commands </H2>
<!--docid::SEC510::-->
<P>
<A NAME="SEC511"></A>
<H3> The <CODE>-target-attach</CODE> Command </H3>
<!--docid::SEC511::-->
<P>
<A NAME="SEC512"></A>
<H4> Synopsis </H4>
<!--docid::SEC512::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -target-attach <VAR>pid</VAR> | <VAR>file</VAR>
</pre></td></tr></table></P><P>
Attach to a process <VAR>pid</VAR> or a file <VAR>file</VAR> outside of GDB.
</P><P>
<A NAME="SEC513"></A>
<H4> GDB command </H4>
<!--docid::SEC513::-->
<P>
The corresponding GDB command is <SAMP>`attach'</SAMP>.
</P><P>
<A NAME="SEC514"></A>
<H4> Example </H4>
<!--docid::SEC514::-->
N.A.
<P>
<A NAME="SEC515"></A>
<H3> The <CODE>-target-compare-sections</CODE> Command </H3>
<!--docid::SEC515::-->
<P>
<A NAME="SEC516"></A>
<H4> Synopsis </H4>
<!--docid::SEC516::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -target-compare-sections [ <VAR>section</VAR> ]
</pre></td></tr></table></P><P>
Compare data of section <VAR>section</VAR> on target to the exec file.
Without the argument, all sections are compared.
</P><P>
<A NAME="SEC517"></A>
<H4> GDB Command </H4>
<!--docid::SEC517::-->
<P>
The GDB equivalent is <SAMP>`compare-sections'</SAMP>.
</P><P>
<A NAME="SEC518"></A>
<H4> Example </H4>
<!--docid::SEC518::-->
N.A.
<P>
<A NAME="SEC519"></A>
<H3> The <CODE>-target-detach</CODE> Command </H3>
<!--docid::SEC519::-->
<P>
<A NAME="SEC520"></A>
<H4> Synopsis </H4>
<!--docid::SEC520::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -target-detach
</pre></td></tr></table></P><P>
Disconnect from the remote target. There's no output.
</P><P>
<A NAME="SEC521"></A>
<H4> GDB command </H4>
<!--docid::SEC521::-->
<P>
The corresponding GDB command is <SAMP>`detach'</SAMP>.
</P><P>
<A NAME="SEC522"></A>
<H4> Example </H4>
<!--docid::SEC522::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-target-detach
^done
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC523"></A>
<H3> The <CODE>-target-download</CODE> Command </H3>
<!--docid::SEC523::-->
<P>
<A NAME="SEC524"></A>
<H4> Synopsis </H4>
<!--docid::SEC524::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -target-download
</pre></td></tr></table></P><P>
Loads the executable onto the remote target.
It prints out an update message every half second, which includes the fields:
</P><P>
<DL COMPACT>
<DT><SAMP>`section'</SAMP>
<DD>The name of the section.
<DT><SAMP>`section-sent'</SAMP>
<DD>The size of what has been sent so far for that section.
<DT><SAMP>`section-size'</SAMP>
<DD>The size of the section.
<DT><SAMP>`total-sent'</SAMP>
<DD>The total size of what was sent so far (the current and the previous sections).
<DT><SAMP>`total-size'</SAMP>
<DD>The size of the overall executable to download.
</DL>
<P>
Each message is sent as status record (see section <A HREF="gdb_25.html#SEC223">GDB/MI Output Syntax</A>).
</P><P>
In addition, it prints the name and size of the sections, as they are
downloaded. These messages include the following fields:
</P><P>
<DL COMPACT>
<DT><SAMP>`section'</SAMP>
<DD>The name of the section.
<DT><SAMP>`section-size'</SAMP>
<DD>The size of the section.
<DT><SAMP>`total-size'</SAMP>
<DD>The size of the overall executable to download.
</DL>
<P>
At the end, a summary is printed.
</P><P>
<A NAME="SEC525"></A>
<H4> GDB Command </H4>
<!--docid::SEC525::-->
<P>
The corresponding GDB command is <SAMP>`load'</SAMP>.
</P><P>
<A NAME="SEC526"></A>
<H4> Example </H4>
<!--docid::SEC526::-->
<P>
Note: each status message appears on a single line. Here the messages
have been broken down so that they can fit onto a page.
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-target-download
+download,{section=".text",section-size="6668",total-size="9880"}
+download,{section=".text",section-sent="512",section-size="6668",
total-sent="512",total-size="9880"}
+download,{section=".text",section-sent="1024",section-size="6668",
total-sent="1024",total-size="9880"}
+download,{section=".text",section-sent="1536",section-size="6668",
total-sent="1536",total-size="9880"}
+download,{section=".text",section-sent="2048",section-size="6668",
total-sent="2048",total-size="9880"}
+download,{section=".text",section-sent="2560",section-size="6668",
total-sent="2560",total-size="9880"}
+download,{section=".text",section-sent="3072",section-size="6668",
total-sent="3072",total-size="9880"}
+download,{section=".text",section-sent="3584",section-size="6668",
total-sent="3584",total-size="9880"}
+download,{section=".text",section-sent="4096",section-size="6668",
total-sent="4096",total-size="9880"}
+download,{section=".text",section-sent="4608",section-size="6668",
total-sent="4608",total-size="9880"}
+download,{section=".text",section-sent="5120",section-size="6668",
total-sent="5120",total-size="9880"}
+download,{section=".text",section-sent="5632",section-size="6668",
total-sent="5632",total-size="9880"}
+download,{section=".text",section-sent="6144",section-size="6668",
total-sent="6144",total-size="9880"}
+download,{section=".text",section-sent="6656",section-size="6668",
total-sent="6656",total-size="9880"}
+download,{section=".init",section-size="28",total-size="9880"}
+download,{section=".fini",section-size="28",total-size="9880"}
+download,{section=".data",section-size="3156",total-size="9880"}
+download,{section=".data",section-sent="512",section-size="3156",
total-sent="7236",total-size="9880"}
+download,{section=".data",section-sent="1024",section-size="3156",
total-sent="7748",total-size="9880"}
+download,{section=".data",section-sent="1536",section-size="3156",
total-sent="8260",total-size="9880"}
+download,{section=".data",section-sent="2048",section-size="3156",
total-sent="8772",total-size="9880"}
+download,{section=".data",section-sent="2560",section-size="3156",
total-sent="9284",total-size="9880"}
+download,{section=".data",section-sent="3072",section-size="3156",
total-sent="9796",total-size="9880"}
^done,address="0x10004",load-size="9880",transfer-rate="6586",
write-rate="429"
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC527"></A>
<H3> The <CODE>-target-exec-status</CODE> Command </H3>
<!--docid::SEC527::-->
<P>
<A NAME="SEC528"></A>
<H4> Synopsis </H4>
<!--docid::SEC528::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -target-exec-status
</pre></td></tr></table></P><P>
Provide information on the state of the target (whether it is running or
not, for instance).
</P><P>
<A NAME="SEC529"></A>
<H4> GDB Command </H4>
<!--docid::SEC529::-->
<P>
There's no equivalent GDB command.
</P><P>
<A NAME="SEC530"></A>
<H4> Example </H4>
<!--docid::SEC530::-->
N.A.
<P>
<A NAME="SEC531"></A>
<H3> The <CODE>-target-list-available-targets</CODE> Command </H3>
<!--docid::SEC531::-->
<P>
<A NAME="SEC532"></A>
<H4> Synopsis </H4>
<!--docid::SEC532::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -target-list-available-targets
</pre></td></tr></table></P><P>
List the possible targets to connect to.
</P><P>
<A NAME="SEC533"></A>
<H4> GDB Command </H4>
<!--docid::SEC533::-->
<P>
The corresponding GDB command is <SAMP>`help target'</SAMP>.
</P><P>
<A NAME="SEC534"></A>
<H4> Example </H4>
<!--docid::SEC534::-->
N.A.
<P>
<A NAME="SEC535"></A>
<H3> The <CODE>-target-list-current-targets</CODE> Command </H3>
<!--docid::SEC535::-->
<P>
<A NAME="SEC536"></A>
<H4> Synopsis </H4>
<!--docid::SEC536::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -target-list-current-targets
</pre></td></tr></table></P><P>
Describe the current target.
</P><P>
<A NAME="SEC537"></A>
<H4> GDB Command </H4>
<!--docid::SEC537::-->
<P>
The corresponding information is printed by <SAMP>`info file'</SAMP> (among
other things).
</P><P>
<A NAME="SEC538"></A>
<H4> Example </H4>
<!--docid::SEC538::-->
N.A.
<P>
<A NAME="SEC539"></A>
<H3> The <CODE>-target-list-parameters</CODE> Command </H3>
<!--docid::SEC539::-->
<P>
<A NAME="SEC540"></A>
<H4> Synopsis </H4>
<!--docid::SEC540::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -target-list-parameters
</pre></td></tr></table></P><P>
<A NAME="SEC541"></A>
<H4> GDB Command </H4>
<!--docid::SEC541::-->
<P>
No equivalent.
</P><P>
<A NAME="SEC542"></A>
<H4> Example </H4>
<!--docid::SEC542::-->
N.A.
<P>
<A NAME="SEC543"></A>
<H3> The <CODE>-target-select</CODE> Command </H3>
<!--docid::SEC543::-->
<P>
<A NAME="SEC544"></A>
<H4> Synopsis </H4>
<!--docid::SEC544::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -target-select <VAR>type</VAR> <VAR>parameters <small>...</small></VAR>
</pre></td></tr></table></P><P>
Connect GDB to the remote target. This command takes two args:
</P><P>
<DL COMPACT>
<DT><SAMP>`<VAR>type</VAR>'</SAMP>
<DD>The type of target, for instance <SAMP>`async'</SAMP>, <SAMP>`remote'</SAMP>, etc.
<DT><SAMP>`<VAR>parameters</VAR>'</SAMP>
<DD>Device names, host names and the like. See section <A HREF="gdb_17.html#SEC132">Commands for managing targets</A>, for more details.
</DL>
<P>
The output is a connection notification, followed by the address at
which the target program is, in the following form:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>^connected,addr="<VAR>address</VAR>",func="<VAR>function name</VAR>",
args=[<VAR>arg list</VAR>]
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC545"></A>
<H4> GDB Command </H4>
<!--docid::SEC545::-->
<P>
The corresponding GDB command is <SAMP>`target'</SAMP>.
</P><P>
<A NAME="SEC546"></A>
<H4> Example </H4>
<!--docid::SEC546::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-target-select async /dev/ttya
^connected,addr="0xfe00a300",func="??",args=[]
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="GDB/MI Thread Commands"></A>
<HR SIZE="6">
<A NAME="SEC547"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC510"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC564"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC229"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC595"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 24.12 GDB/MI Thread Commands </H2>
<!--docid::SEC547::-->
<P>
<A NAME="SEC548"></A>
<H3> The <CODE>-thread-info</CODE> Command </H3>
<!--docid::SEC548::-->
<P>
<A NAME="SEC549"></A>
<H4> Synopsis </H4>
<!--docid::SEC549::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -thread-info
</pre></td></tr></table></P><P>
<A NAME="SEC550"></A>
<H4> GDB command </H4>
<!--docid::SEC550::-->
<P>
No equivalent.
</P><P>
<A NAME="SEC551"></A>
<H4> Example </H4>
<!--docid::SEC551::-->
N.A.
<P>
<A NAME="SEC552"></A>
<H3> The <CODE>-thread-list-all-threads</CODE> Command </H3>
<!--docid::SEC552::-->
<P>
<A NAME="SEC553"></A>
<H4> Synopsis </H4>
<!--docid::SEC553::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -thread-list-all-threads
</pre></td></tr></table></P><P>
<A NAME="SEC554"></A>
<H4> GDB Command </H4>
<!--docid::SEC554::-->
<P>
The equivalent GDB command is <SAMP>`info threads'</SAMP>.
</P><P>
<A NAME="SEC555"></A>
<H4> Example </H4>
<!--docid::SEC555::-->
N.A.
<P>
<A NAME="SEC556"></A>
<H3> The <CODE>-thread-list-ids</CODE> Command </H3>
<!--docid::SEC556::-->
<P>
<A NAME="SEC557"></A>
<H4> Synopsis </H4>
<!--docid::SEC557::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -thread-list-ids
</pre></td></tr></table></P><P>
Produces a list of the currently known GDB thread ids. At the
end of the list it also prints the total number of such threads.
</P><P>
<A NAME="SEC558"></A>
<H4> GDB Command </H4>
<!--docid::SEC558::-->
<P>
Part of <SAMP>`info threads'</SAMP> supplies the same information.
</P><P>
<A NAME="SEC559"></A>
<H4> Example </H4>
<!--docid::SEC559::-->
<P>
No threads present, besides the main process:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-thread-list-ids
^done,thread-ids={},number-of-threads="0"
(gdb)
</FONT></pre></td></tr></table></P><P>
Several threads:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-thread-list-ids
^done,thread-ids={thread-id="3",thread-id="2",thread-id="1"},
number-of-threads="3"
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="SEC560"></A>
<H3> The <CODE>-thread-select</CODE> Command </H3>
<!--docid::SEC560::-->
<P>
<A NAME="SEC561"></A>
<H4> Synopsis </H4>
<!--docid::SEC561::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -thread-select <VAR>threadnum</VAR>
</pre></td></tr></table></P><P>
Make <VAR>threadnum</VAR> the current thread. It prints the number of the new
current thread, and the topmost frame for that thread.
</P><P>
<A NAME="SEC562"></A>
<H4> GDB Command </H4>
<!--docid::SEC562::-->
<P>
The corresponding GDB command is <SAMP>`thread'</SAMP>.
</P><P>
<A NAME="SEC563"></A>
<H4> Example </H4>
<!--docid::SEC563::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=smallexample><FONT SIZE=-1><pre>(gdb)
-exec-next
^running
(gdb)
*stopped,reason="end-stepping-range",thread-id="2",line="187",
file="../../../devo/gdb/testsuite/gdb.threads/linux-dp.c"
(gdb)
-thread-list-ids
^done,
thread-ids={thread-id="3",thread-id="2",thread-id="1"},
number-of-threads="3"
(gdb)
-thread-select 3
^done,new-thread-id="3",
frame={level="0",func="vprintf",
args=[{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""},
{name="arg",value="0x2"}],file="vprintf.c",line="31"}
(gdb)
</FONT></pre></td></tr></table></P><P>
<A NAME="GDB/MI Tracepoint Commands"></A>
<HR SIZE="6">
<A NAME="SEC564"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC547"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC565"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC229"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC595"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 24.13 GDB/MI Tracepoint Commands </H2>
<!--docid::SEC564::-->
<P>
The tracepoint commands are not yet implemented.
</P><P>
<A NAME="GDB/MI Variable Objects"></A>
<HR SIZE="6">
<A NAME="SEC565"></A>
<TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0>
<TR><TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC564"> &lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC595"> &gt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT"> &nbsp; <TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC229"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_25.html#SEC217"> Up </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC595"> &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_35.html#SEC643">Index</A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_abt.html#SEC_About"> ? </A>]</TD>
</TR></TABLE>
<H2> 24.14 GDB/MI Variable Objects </H2>
<!--docid::SEC565::-->
<P>
<A NAME="SEC566"></A>
<H3> Motivation for Variable Objects in GDB/MI </H3>
<!--docid::SEC566::-->
<P>
For the implementation of a variable debugger window (locals, watched
expressions, etc.), we are proposing the adaptation of the existing code
used by <CODE>Insight</CODE>.
</P><P>
The two main reasons for that are:
</P><P>
<OL>
<LI>
It has been proven in practice (it is already on its second generation).
<P>
<LI>
It will shorten development time (needless to say how important it is
now).
</OL>
<P>
The original interface was designed to be used by Tcl code, so it was
slightly changed so it could be used through GDB/MI. This section
describes the GDB/MI operations that will be available and gives some
hints about their use.
</P><P>
<EM>Note</EM>: In addition to the set of operations described here, we
expect the GUI implementation of a variable window to require, at
least, the following operations:
</P><P>
<UL>
<LI><CODE>-gdb-show</CODE> <CODE>output-radix</CODE>
<LI><CODE>-stack-list-arguments</CODE>
<LI><CODE>-stack-list-locals</CODE>
<LI><CODE>-stack-select-frame</CODE>
</UL>
<P>
<A NAME="SEC567"></A>
<H3> Introduction to Variable Objects in GDB/MI </H3>
<!--docid::SEC567::-->
<P>
<A NAME="IDX1034"></A>
The basic idea behind variable objects is the creation of a named object
to represent a variable, an expression, a memory location or even a CPU
register. For each object created, a set of operations is available for
examining or changing its properties.
</P><P>
Furthermore, complex data types, such as C structures, are represented
in a tree format. For instance, the <CODE>struct</CODE> type variable is the
root and the children will represent the struct members. If a child
is itself of a complex type, it will also have children of its own.
Appropriate language differences are handled for C, C<TT>++</TT> and Java.
</P><P>
When returning the actual values of the objects, this facility allows
for the individual selection of the display format used in the result
creation. It can be chosen among: binary, decimal, hexadecimal, octal
and natural. Natural refers to a default format automatically
chosen based on the variable type (like decimal for an <CODE>int</CODE>, hex
for pointers, etc.).
</P><P>
The following is the complete set of GDB/MI operations defined to
access this functionality:
</P><P>
<TABLE>
<TR><TD><STRONG>Operation</STRONG></TD>
</TD><TD> <STRONG>Description</STRONG>
</TR>
<TR><TD><CODE>-var-create</CODE></TD>
</TD><TD> create a variable object
</TR>
<TR><TD><CODE>-var-delete</CODE></TD>
</TD><TD> delete the variable object and its children
</TR>
<TR><TD><CODE>-var-set-format</CODE></TD>
</TD><TD> set the display format of this variable
</TR>
<TR><TD><CODE>-var-show-format</CODE></TD>
</TD><TD> show the display format of this variable
</TR>
<TR><TD><CODE>-var-info-num-children</CODE></TD>
</TD><TD> tells how many children this object has
</TR>
<TR><TD><CODE>-var-list-children</CODE></TD>
</TD><TD> return a list of the object's children
</TR>
<TR><TD><CODE>-var-info-type</CODE></TD>
</TD><TD> show the type of this variable object
</TR>
<TR><TD><CODE>-var-info-expression</CODE></TD>
</TD><TD> print what this variable object represents
</TR>
<TR><TD><CODE>-var-show-attributes</CODE></TD>
</TD><TD> is this variable editable? does it exist here?
</TR>
<TR><TD><CODE>-var-evaluate-expression</CODE></TD>
</TD><TD> get the value of this variable
</TR>
<TR><TD><CODE>-var-assign</CODE></TD>
</TD><TD> set the value of this variable
</TR>
<TR><TD><CODE>-var-update</CODE></TD>
</TD><TD> update the variable and its children
</TR></TABLE>
<P>
In the next subsection we describe each operation in detail and suggest
how it can be used.
</P><P>
<A NAME="SEC568"></A>
<H3> Description And Use of Operations on Variable Objects </H3>
<!--docid::SEC568::-->
<P>
<A NAME="SEC569"></A>
<H3> The <CODE>-var-create</CODE> Command </H3>
<!--docid::SEC569::-->
<P>
<A NAME="SEC570"></A>
<H4> Synopsis </H4>
<!--docid::SEC570::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -var-create {<VAR>name</VAR> | "-"}
{<VAR>frame-addr</VAR> | "*"} <VAR>expression</VAR>
</pre></td></tr></table></P><P>
This operation creates a variable object, which allows the monitoring of
a variable, the result of an expression, a memory cell or a CPU
register.
</P><P>
The <VAR>name</VAR> parameter is the string by which the object can be
referenced. It must be unique. If <SAMP>`-'</SAMP> is specified, the varobj
system will generate a string "varNNNNNN" automatically. It will be
unique provided that one does not specify <VAR>name</VAR> on that format.
The command fails if a duplicate name is found.
</P><P>
The frame under which the expression should be evaluated can be
specified by <VAR>frame-addr</VAR>. A <SAMP>`*'</SAMP> indicates that the current
frame should be used.
</P><P>
<VAR>expression</VAR> is any expression valid on the current language set (must not
begin with a <SAMP>`*'</SAMP>), or one of the following:
</P><P>
<UL>
<LI>
<SAMP>`*<VAR>addr</VAR>'</SAMP>, where <VAR>addr</VAR> is the address of a memory cell
<P>
<LI>
<SAMP>`*<VAR>addr</VAR>-<VAR>addr</VAR>'</SAMP> -- a memory address range (TBD)
<P>
<LI>
<SAMP>`$<VAR>regname</VAR>'</SAMP> -- a CPU register name
</UL>
<P>
<A NAME="SEC571"></A>
<H4> Result </H4>
<!--docid::SEC571::-->
<P>
This operation returns the name, number of children and the type of the
object created. Type is returned as a string as the ones generated by
the GDB CLI:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> name="<VAR>name</VAR>",numchild="N",type="<VAR>type</VAR>"
</pre></td></tr></table></P><P>
<A NAME="SEC572"></A>
<H3> The <CODE>-var-delete</CODE> Command </H3>
<!--docid::SEC572::-->
<P>
<A NAME="SEC573"></A>
<H4> Synopsis </H4>
<!--docid::SEC573::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -var-delete <VAR>name</VAR>
</pre></td></tr></table></P><P>
Deletes a previously created variable object and all of its children.
</P><P>
Returns an error if the object <VAR>name</VAR> is not found.
</P><P>
<A NAME="SEC574"></A>
<H3> The <CODE>-var-set-format</CODE> Command </H3>
<!--docid::SEC574::-->
<P>
<A NAME="SEC575"></A>
<H4> Synopsis </H4>
<!--docid::SEC575::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -var-set-format <VAR>name</VAR> <VAR>format-spec</VAR>
</pre></td></tr></table></P><P>
Sets the output format for the value of the object <VAR>name</VAR> to be
<VAR>format-spec</VAR>.
</P><P>
The syntax for the <VAR>format-spec</VAR> is as follows:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> <VAR>format-spec</VAR> ==>
{binary | decimal | hexadecimal | octal | natural}
</pre></td></tr></table></P><P>
<A NAME="SEC576"></A>
<H3> The <CODE>-var-show-format</CODE> Command </H3>
<!--docid::SEC576::-->
<P>
<A NAME="SEC577"></A>
<H4> Synopsis </H4>
<!--docid::SEC577::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -var-show-format <VAR>name</VAR>
</pre></td></tr></table></P><P>
Returns the format used to display the value of the object <VAR>name</VAR>.
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> <VAR>format</VAR> ==>
<VAR>format-spec</VAR>
</pre></td></tr></table></P><P>
<A NAME="SEC578"></A>
<H3> The <CODE>-var-info-num-children</CODE> Command </H3>
<!--docid::SEC578::-->
<P>
<A NAME="SEC579"></A>
<H4> Synopsis </H4>
<!--docid::SEC579::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -var-info-num-children <VAR>name</VAR>
</pre></td></tr></table></P><P>
Returns the number of children of a variable object <VAR>name</VAR>:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> numchild=<VAR>n</VAR>
</pre></td></tr></table></P><P>
<A NAME="SEC580"></A>
<H3> The <CODE>-var-list-children</CODE> Command </H3>
<!--docid::SEC580::-->
<P>
<A NAME="SEC581"></A>
<H4> Synopsis </H4>
<!--docid::SEC581::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -var-list-children <VAR>name</VAR>
</pre></td></tr></table></P><P>
Returns a list of the children of the specified variable object:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> numchild=<VAR>n</VAR>,children={{name=<VAR>name</VAR>,
numchild=<VAR>n</VAR>,type=<VAR>type</VAR>},(repeats N times)}
</pre></td></tr></table></P><P>
<A NAME="SEC582"></A>
<H3> The <CODE>-var-info-type</CODE> Command </H3>
<!--docid::SEC582::-->
<P>
<A NAME="SEC583"></A>
<H4> Synopsis </H4>
<!--docid::SEC583::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -var-info-type <VAR>name</VAR>
</pre></td></tr></table></P><P>
Returns the type of the specified variable <VAR>name</VAR>. The type is
returned as a string in the same format as it is output by the
GDB CLI:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> type=<VAR>typename</VAR>
</pre></td></tr></table></P><P>
<A NAME="SEC584"></A>
<H3> The <CODE>-var-info-expression</CODE> Command </H3>
<!--docid::SEC584::-->
<P>
<A NAME="SEC585"></A>
<H4> Synopsis </H4>
<!--docid::SEC585::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -var-info-expression <VAR>name</VAR>
</pre></td></tr></table></P><P>
Returns what is represented by the variable object <VAR>name</VAR>:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> lang=<VAR>lang-spec</VAR>,exp=<VAR>expression</VAR>
</pre></td></tr></table></P><P>
where <VAR>lang-spec</VAR> is <CODE>{"C" | "C++" | "Java"}</CODE>.
</P><P>
<A NAME="SEC586"></A>
<H3> The <CODE>-var-show-attributes</CODE> Command </H3>
<!--docid::SEC586::-->
<P>
<A NAME="SEC587"></A>
<H4> Synopsis </H4>
<!--docid::SEC587::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -var-show-attributes <VAR>name</VAR>
</pre></td></tr></table></P><P>
List attributes of the specified variable object <VAR>name</VAR>:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> status=<VAR>attr</VAR> [ ( ,<VAR>attr</VAR> )* ]
</pre></td></tr></table></P><P>
where <VAR>attr</VAR> is <CODE>{ { editable | noneditable } | TBD }</CODE>.
</P><P>
<A NAME="SEC588"></A>
<H3> The <CODE>-var-evaluate-expression</CODE> Command </H3>
<!--docid::SEC588::-->
<P>
<A NAME="SEC589"></A>
<H4> Synopsis </H4>
<!--docid::SEC589::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -var-evaluate-expression <VAR>name</VAR>
</pre></td></tr></table></P><P>
Evaluates the expression that is represented by the specified variable
object and returns its value as a string in the current format specified
for the object:
</P><P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> value=<VAR>value</VAR>
</pre></td></tr></table></P><P>
Note that one must invoke <CODE>-var-list-children</CODE> for a variable
before the value of a child variable can be evaluated.
</P><P>
<A NAME="SEC590"></A>
<H3> The <CODE>-var-assign</CODE> Command </H3>
<!--docid::SEC590::-->
<P>
<A NAME="SEC591"></A>
<H4> Synopsis </H4>
<!--docid::SEC591::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -var-assign <VAR>name</VAR> <VAR>expression</VAR>
</pre></td></tr></table></P><P>
Assigns the value of <VAR>expression</VAR> to the variable object specified
by <VAR>name</VAR>. The object must be <SAMP>`editable'</SAMP>. If the variable's
value is altered by the assign, the variable will show up in any
subsequent <CODE>-var-update</CODE> list.
</P><P>
<A NAME="SEC592"></A>
<H4> Example </H4>
<!--docid::SEC592::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre>(gdb)
-var-assign var1 3
^done,value="3"
(gdb)
-var-update *
^done,changelist=[{name="var1",in_scope="true",type_changed="false"}]
(gdb)
</pre></td></tr></table></P><P>
<A NAME="SEC593"></A>
<H3> The <CODE>-var-update</CODE> Command </H3>
<!--docid::SEC593::-->
<P>
<A NAME="SEC594"></A>
<H4> Synopsis </H4>
<!--docid::SEC594::-->
<P>
<TABLE><tr><td>&nbsp;</td><td class=example><pre> -var-update {<VAR>name</VAR> | "*"}
</pre></td></tr></table></P><P>
Update the value of the variable object <VAR>name</VAR> by evaluating its
expression after fetching all the new values from memory or registers.
A <SAMP>`*'</SAMP> causes all existing variable objects to be updated.
</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_25.html#SEC229"> &lt;&lt; </A>]</TD>
<TD VALIGN="MIDDLE" ALIGN="LEFT">[<A HREF="gdb_26.html#SEC595"> &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_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 &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>November, 11 2002</I>
using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html
"><I>texi2html</I></A>
</BODY>
</HTML>