OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [gdb-5.0/] [gdb/] [mi/] [gdbmi.texinfo] - Diff between revs 107 and 1765

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 107 Rev 1765
@c  \input texinfo   @c -*-texinfo-*-
@c  \input texinfo   @c -*-texinfo-*-
@c  @c %**start of header
@c  @c %**start of header
@c  @setfilename gdbmi.info
@c  @setfilename gdbmi.info
@c  @settitle GDB/MI Machine Interface
@c  @settitle GDB/MI Machine Interface
@c  @setchapternewpage off
@c  @setchapternewpage off
@c  @c %**end of header
@c  @c %**end of header
 
 
@c  @ifinfo
@c  @ifinfo
@c  This file documents GDB/MI, a Machine Interface to GDB.
@c  This file documents GDB/MI, a Machine Interface to GDB.
 
 
@c  Copyright (C) 2000, Free Software Foundation, Inc.
@c  Copyright (C) 2000, Free Software Foundation, Inc.
@c  Contributed by Cygnus Solutions.
@c  Contributed by Cygnus Solutions.
 
 
@c  Permission is granted to make and distribute verbatim copies of this
@c  Permission is granted to make and distribute verbatim copies of this
@c  manual provided the copyright notice and this permission notice are
@c  manual provided the copyright notice and this permission notice are
@c  preserved on all copies.
@c  preserved on all copies.
 
 
@c  @ignore
@c  @ignore
@c  Permission is granted to process this file through TeX and print the
@c  Permission is granted to process this file through TeX and print the
@c  results, provided the printed document carries copying permission notice
@c  results, provided the printed document carries copying permission notice
@c  identical to this one except for the removal of this paragraph (this
@c  identical to this one except for the removal of this paragraph (this
@c  paragraph not being relevant to the printed manual).
@c  paragraph not being relevant to the printed manual).
 
 
@c  @end ignore
@c  @end ignore
@c  Permission is granted to copy and distribute modified versions of this
@c  Permission is granted to copy and distribute modified versions of this
@c  manual under the conditions for verbatim copying, provided also that the
@c  manual under the conditions for verbatim copying, provided also that the
@c  entire resulting derived work is distributed under the terms of a
@c  entire resulting derived work is distributed under the terms of a
@c  permission notice identical to this one.
@c  permission notice identical to this one.
 
 
@c  Permission is granted to copy and distribute translations of this manual
@c  Permission is granted to copy and distribute translations of this manual
@c  into another language, under the above conditions for modified versions.
@c  into another language, under the above conditions for modified versions.
@c  @end ifinfo
@c  @end ifinfo
 
 
@c  @c  This title page illustrates only one of the
@c  @c  This title page illustrates only one of the
@c  @c  two methods of forming a title page.
@c  @c  two methods of forming a title page.
 
 
@c  @titlepage
@c  @titlepage
@c  @title GDB/MI
@c  @title GDB/MI
@c  @subtitle Version 0.2
@c  @subtitle Version 0.2
@c  @subtitle Feb 2000
@c  @subtitle Feb 2000
@c  @author Andrew Cagney, Fernando Nasser and Elena Zannoni
@c  @author Andrew Cagney, Fernando Nasser and Elena Zannoni
 
 
@c  @c  The following two commands
@c  @c  The following two commands
@c  @c  start the copyright page.
@c  @c  start the copyright page.
@c  @page
@c  @page
@c  @vskip 0pt plus 1filll
@c  @vskip 0pt plus 1filll
@c  Permission is granted to make and distribute verbatim copies of this
@c  Permission is granted to make and distribute verbatim copies of this
@c  manual provided the copyright notice and this permission notice are
@c  manual provided the copyright notice and this permission notice are
@c  preserved on all copies.
@c  preserved on all copies.
 
 
@c  Copyright @copyright{} 2000, Free Software Foundation, Inc.
@c  Copyright @copyright{} 2000, Free Software Foundation, Inc.
@c  @end titlepage
@c  @end titlepage
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% CHAPTER %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI
@node GDB/MI
@chapter The @sc{gdb/mi} Interface
@chapter The @sc{gdb/mi} Interface
 
 
@unnumberedsec Function and Purpose
@unnumberedsec Function and Purpose
 
 
@cindex @sc{gdb/mi}, its purpose
@cindex @sc{gdb/mi}, its purpose
@sc{gdb/mi} is a line based machine oriented text interface to GDB.  It is
@sc{gdb/mi} is a line based machine oriented text interface to GDB.  It is
specifically intended to support the development of systems which use
specifically intended to support the development of systems which use
the debugger as just one small component of a larger system.
the debugger as just one small component of a larger system.
 
 
This chapter is a specification of the @sc{gdb/mi} interface.  It is written
This chapter is a specification of the @sc{gdb/mi} interface.  It is written
in the form of a reference manual.
in the form of a reference manual.
 
 
Note that @sc{gdb/mi} is still under construction, so some of the
Note that @sc{gdb/mi} is still under construction, so some of the
features described below are incomplete and subject to change.
features described below are incomplete and subject to change.
 
 
@unnumberedsec Notation and Terminology
@unnumberedsec Notation and Terminology
 
 
@cindex notational conventions, for @sc{gdb/mi}
@cindex notational conventions, for @sc{gdb/mi}
This chapter uses the following notation:
This chapter uses the following notation:
 
 
@itemize @bullet
@itemize @bullet
@item
@item
@code{|} separates two alternatives.
@code{|} separates two alternatives.
 
 
@item
@item
@code{[ @var{something} ]} indicates that @var{something} is optional:
@code{[ @var{something} ]} indicates that @var{something} is optional:
it may or may not be given.
it may or may not be given.
 
 
@item
@item
@code{( @var{group} )*} means that @var{group} inside the parentheses
@code{( @var{group} )*} means that @var{group} inside the parentheses
may repeat zero or more times.
may repeat zero or more times.
 
 
@item
@item
@code{( @var{group} )+} means that @var{group} inside the parentheses
@code{( @var{group} )+} means that @var{group} inside the parentheses
may repeat one or more times.
may repeat one or more times.
 
 
@item
@item
@code{"@var{string}"} means a literal @var{string}.
@code{"@var{string}"} means a literal @var{string}.
@end itemize
@end itemize
 
 
@ignore
@ignore
@heading Dependencies
@heading Dependencies
@end ignore
@end ignore
 
 
@heading Acknowledgments
@heading Acknowledgments
 
 
In alphabetic order: Andrew Cagney, Fernando Nasser, Stan Shebs and
In alphabetic order: Andrew Cagney, Fernando Nasser, Stan Shebs and
Elena Zannoni.
Elena Zannoni.
 
 
@menu
@menu
* GDB/MI Command Syntax::
* GDB/MI Command Syntax::
* GDB/MI Compatibility with CLI::
* GDB/MI Compatibility with CLI::
* GDB/MI Output Records::
* GDB/MI Output Records::
* GDB/MI Command Description Format::
* GDB/MI Command Description Format::
* GDB/MI Breakpoint Table Commands::
* GDB/MI Breakpoint Table Commands::
* GDB/MI Data Manipulation::
* GDB/MI Data Manipulation::
* GDB/MI Program Control::
* GDB/MI Program Control::
* GDB/MI Miscellaneous Commands::
* GDB/MI Miscellaneous Commands::
* GDB/MI Stack Manipulation::
* GDB/MI Stack Manipulation::
* GDB/MI Symbol Query::
* GDB/MI Symbol Query::
* GDB/MI Target Manipulation::
* GDB/MI Target Manipulation::
* GDB/MI Thread Commands::
* GDB/MI Thread Commands::
* GDB/MI Tracepoint Commands::
* GDB/MI Tracepoint Commands::
* GDB/MI Variable Objects::
* GDB/MI Variable Objects::
* GDB/MI Draft Changes to Output Syntax::
* GDB/MI Draft Changes to Output Syntax::
@end menu
@end menu
 
 
@c When these are implemented, they should be moved to be between Misc and
@c When these are implemented, they should be moved to be between Misc and
@c Stack Manipulation in the above menu.  They are now outside the menu
@c Stack Manipulation in the above menu.  They are now outside the menu
@c because makeinfo 3.12 barfs if it sees @ignore or @comments in the
@c because makeinfo 3.12 barfs if it sees @ignore or @comments in the
@c middle of a menu.
@c middle of a menu.
@ignore
@ignore
* GDB/MI Kod Commands::
* GDB/MI Kod Commands::
* GDB/MI Memory Overlay Commands::
* GDB/MI Memory Overlay Commands::
* GDB/MI Signal Handling Commands::
* GDB/MI Signal Handling Commands::
@end ignore
@end ignore
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Command Syntax
@node GDB/MI Command Syntax
@section @sc{gdb/mi} Command Syntax
@section @sc{gdb/mi} Command Syntax
 
 
@menu
@menu
* GDB/MI Input Syntax::
* GDB/MI Input Syntax::
* GDB/MI Output Syntax::
* GDB/MI Output Syntax::
* GDB/MI Simple Examples::
* GDB/MI Simple Examples::
@end menu
@end menu
 
 
@node GDB/MI Input Syntax
@node GDB/MI Input Syntax
@subsection @sc{gdb/mi} Input Syntax
@subsection @sc{gdb/mi} Input Syntax
 
 
@cindex input syntax for @sc{gdb/mi}
@cindex input syntax for @sc{gdb/mi}
@cindex @sc{gdb/mi}, input syntax
@cindex @sc{gdb/mi}, input syntax
@table @code
@table @code
@item @var{command} @expansion{}
@item @var{command} @expansion{}
@code{@var{cli-command} | @var{mi-command}}
@code{@var{cli-command} | @var{mi-command}}
 
 
@item @var{cli-command} @expansion{}
@item @var{cli-command} @expansion{}
@code{[ @var{token} ] @var{cli-command} @var{nl}}, where
@code{[ @var{token} ] @var{cli-command} @var{nl}}, where
@var{cli-command} is any existing GDB CLI command.
@var{cli-command} is any existing GDB CLI command.
 
 
@item @var{mi-command} @expansion{}
@item @var{mi-command} @expansion{}
@code{[ @var{token} ] "-" @var{operation} ( " " @var{option} )*
@code{[ @var{token} ] "-" @var{operation} ( " " @var{option} )*
@code{[} " --" @code{]} ( " " @var{parameter} )* @var{nl}}
@code{[} " --" @code{]} ( " " @var{parameter} )* @var{nl}}
 
 
@item @var{token} @expansion{}
@item @var{token} @expansion{}
@code{"any sequence of digits"}
@code{"any sequence of digits"}
 
 
@item @var{option} @expansion{}
@item @var{option} @expansion{}
@code{"-" @var{parameter} [ " " @var{parameter} ]}
@code{"-" @var{parameter} [ " " @var{parameter} ]}
 
 
@item @var{parameter} @expansion{}
@item @var{parameter} @expansion{}
@code{@var{non-blank-sequence} | @var{c-string}}
@code{@var{non-blank-sequence} | @var{c-string}}
 
 
@item @var{operation} @expansion{}
@item @var{operation} @expansion{}
@emph{any of the operations described in this document}
@emph{any of the operations described in this document}
 
 
@item @var{non-blank-sequence} @expansion{}
@item @var{non-blank-sequence} @expansion{}
@emph{anything, provided it doesn't contain special characters such as
@emph{anything, provided it doesn't contain special characters such as
"-", @var{nl}, """ and of course " "}
"-", @var{nl}, """ and of course " "}
 
 
@item @var{c-string} @expansion{}
@item @var{c-string} @expansion{}
@code{""" @var{seven-bit-iso-c-string-content} """}
@code{""" @var{seven-bit-iso-c-string-content} """}
 
 
@item @var{nl} @expansion{}
@item @var{nl} @expansion{}
@code{CR | CR-LF}
@code{CR | CR-LF}
@end table
@end table
 
 
Notes:
Notes:
 
 
@itemize @bullet
@itemize @bullet
@item
@item
The CLI commands are still handled by the @sc{mi} interpreter; their
The CLI commands are still handled by the @sc{mi} interpreter; their
output is described below.
output is described below.
 
 
@item
@item
The @code{@var{token}}, when present, is passed back when the command
The @code{@var{token}}, when present, is passed back when the command
finishes.
finishes.
 
 
@item
@item
Some @sc{mi} commands accept optional arguments as part of the parameter
Some @sc{mi} commands accept optional arguments as part of the parameter
list. Each option is identified by a leading @samp{-} (dash) and may be
list. Each option is identified by a leading @samp{-} (dash) and may be
followed by an optional argument parameter.  Options occur first in the
followed by an optional argument parameter.  Options occur first in the
parameter list and can be delimited from normal parameters using
parameter list and can be delimited from normal parameters using
@samp{--} (this is useful when some parameters begin with a dash).
@samp{--} (this is useful when some parameters begin with a dash).
@end itemize
@end itemize
 
 
Pragmatics:
Pragmatics:
 
 
@itemize @bullet
@itemize @bullet
@item
@item
We want easy access to the existing CLI syntax (for debugging).
We want easy access to the existing CLI syntax (for debugging).
 
 
@item
@item
We want it to be easy to spot a @sc{mi} operation.
We want it to be easy to spot a @sc{mi} operation.
@end itemize
@end itemize
 
 
@node GDB/MI Output Syntax
@node GDB/MI Output Syntax
@subsection @sc{gdb/mi} Output Syntax
@subsection @sc{gdb/mi} Output Syntax
 
 
@cindex output syntax of @sc{gdb/mi}
@cindex output syntax of @sc{gdb/mi}
@cindex @sc{gdb/mi}, output syntax
@cindex @sc{gdb/mi}, output syntax
The output from @sc{gdb/mi} consists of zero or more out-of-band records
The output from @sc{gdb/mi} consists of zero or more out-of-band records
followed, optionally, by a single result record.  This result record
followed, optionally, by a single result record.  This result record
is for the most recent command.  The sequence of output records is
is for the most recent command.  The sequence of output records is
terminated by @samp{(gdb)}.
terminated by @samp{(gdb)}.
 
 
If an input command was prefixed with a @code{@var{token}} then the
If an input command was prefixed with a @code{@var{token}} then the
corresponding output for that command will also be prefixed by that same
corresponding output for that command will also be prefixed by that same
@var{token}.
@var{token}.
 
 
@table @code
@table @code
@item @var{output} @expansion{}
@item @var{output} @expansion{}
@code{( @var{out-of-band-record} )* [ @var{result-record} ] "(gdb)" @var{nl}}
@code{( @var{out-of-band-record} )* [ @var{result-record} ] "(gdb)" @var{nl}}
 
 
@item @var{result-record} @expansion{}
@item @var{result-record} @expansion{}
@code{ [ @var{token} ] "^" @var{result-class} ( "," @var{result} )* @var{nl}}
@code{ [ @var{token} ] "^" @var{result-class} ( "," @var{result} )* @var{nl}}
 
 
@item @var{out-of-band-record} @expansion{}
@item @var{out-of-band-record} @expansion{}
@code{@var{async-record} | @var{stream-record}}
@code{@var{async-record} | @var{stream-record}}
 
 
@item @var{async-record} @expansion{}
@item @var{async-record} @expansion{}
@code{@var{exec-async-output} | @var{status-async-output} | @var{notify-async-output}}
@code{@var{exec-async-output} | @var{status-async-output} | @var{notify-async-output}}
 
 
@item @var{exec-async-output} @expansion{}
@item @var{exec-async-output} @expansion{}
@code{[ @var{token} ] "*" @var{async-output}}
@code{[ @var{token} ] "*" @var{async-output}}
 
 
@item @var{status-async-output} @expansion{}
@item @var{status-async-output} @expansion{}
@code{[ @var{token} ] "+" @var{async-output}}
@code{[ @var{token} ] "+" @var{async-output}}
 
 
@item @var{notify-async-output} @expansion{}
@item @var{notify-async-output} @expansion{}
@code{[ @var{token} ] "=" @var{async-output}}
@code{[ @var{token} ] "=" @var{async-output}}
 
 
@item @var{async-output} @expansion{}
@item @var{async-output} @expansion{}
@code{@var{async-class} ( "," @var{result} )* @var{nl}}
@code{@var{async-class} ( "," @var{result} )* @var{nl}}
 
 
@item @var{result-class} @expansion{}
@item @var{result-class} @expansion{}
@code{"done" | "running" | "connected" | "error" | "exit"}
@code{"done" | "running" | "connected" | "error" | "exit"}
 
 
@item @var{async-class} @expansion{}
@item @var{async-class} @expansion{}
@code{"stopped" | @var{others}} (where @var{others} will be added
@code{"stopped" | @var{others}} (where @var{others} will be added
depending on the needs---this is still in development).
depending on the needs---this is still in development).
 
 
@item @var{result} @expansion{}
@item @var{result} @expansion{}
@code{[ @var{string} "=" ] @var{value}}
@code{[ @var{string} "=" ] @var{value}}
 
 
@item @var{value} @expansion{}
@item @var{value} @expansion{}
@code{@var{const} | "@{" @var{result} ( "," @var{result} )* "@}"}
@code{@var{const} | "@{" @var{result} ( "," @var{result} )* "@}"}
 
 
@item @var{const} @expansion{}
@item @var{const} @expansion{}
@code{@var{c-string}}
@code{@var{c-string}}
 
 
@item @var{stream-record} @expansion{}
@item @var{stream-record} @expansion{}
@code{@var{console-stream-output} | @var{target-stream-output} | @var{log-stream-output}}
@code{@var{console-stream-output} | @var{target-stream-output} | @var{log-stream-output}}
 
 
@item @var{console-stream-output} @expansion{}
@item @var{console-stream-output} @expansion{}
@code{"~" @var{c-string}}
@code{"~" @var{c-string}}
 
 
@item @var{target-stream-output} @expansion{}
@item @var{target-stream-output} @expansion{}
@code{"@@" @var{c-string}}
@code{"@@" @var{c-string}}
 
 
@item @var{log-stream-output} @expansion{}
@item @var{log-stream-output} @expansion{}
@code{"&" @var{c-string}}
@code{"&" @var{c-string}}
 
 
@item @var{nl} @expansion{}
@item @var{nl} @expansion{}
@code{CR | CR-LF}
@code{CR | CR-LF}
 
 
@item @var{token} @expansion{}
@item @var{token} @expansion{}
@emph{any sequence of digits}.
@emph{any sequence of digits}.
@end table
@end table
 
 
In addition, the following are still being developed:
In addition, the following are still being developed:
 
 
@table @code
@table @code
@item @var{query}
@item @var{query}
This action is currently undefined.
This action is currently undefined.
@end table
@end table
 
 
Notes:
Notes:
 
 
@itemize @bullet
@itemize @bullet
@item
@item
All output sequences end in a single line containing a period.
All output sequences end in a single line containing a period.
 
 
@item
@item
The @code{@var{token}} is from the corresponding request.  If an execution
The @code{@var{token}} is from the corresponding request.  If an execution
command is interrupted by the @samp{-exec-interrupt} command, the
command is interrupted by the @samp{-exec-interrupt} command, the
@var{token} associated with the `*stopped' message is the one of the
@var{token} associated with the `*stopped' message is the one of the
original execution command, not the one of the interrupt-command.
original execution command, not the one of the interrupt-command.
 
 
@item
@item
@cindex status output in @sc{gdb/mi}
@cindex status output in @sc{gdb/mi}
@var{status-async-output} contains on-going status information about the
@var{status-async-output} contains on-going status information about the
progress of a slow operation.  It can be discarded.  All status output is
progress of a slow operation.  It can be discarded.  All status output is
prefixed by @samp{+}.
prefixed by @samp{+}.
 
 
@item
@item
@cindex async output in @sc{gdb/mi}
@cindex async output in @sc{gdb/mi}
@var{exec-async-output} contains asynchronous state change on the target
@var{exec-async-output} contains asynchronous state change on the target
(stopped, started, disappeared).  All async output is prefixed by
(stopped, started, disappeared).  All async output is prefixed by
@samp{*}.
@samp{*}.
 
 
@item
@item
@cindex notify output in @sc{gdb/mi}
@cindex notify output in @sc{gdb/mi}
@var{notify-async-output} contains supplementary information that the
@var{notify-async-output} contains supplementary information that the
client should handle (e.g., a new breakpoint information).  All notify
client should handle (e.g., a new breakpoint information).  All notify
output is prefixed by @samp{=}.
output is prefixed by @samp{=}.
 
 
@item
@item
@cindex console output in @sc{gdb/mi}
@cindex console output in @sc{gdb/mi}
@var{console-stream-output} is output that should be displayed as is in the
@var{console-stream-output} is output that should be displayed as is in the
console.  It is the textual response to a CLI command.  All the console
console.  It is the textual response to a CLI command.  All the console
output is prefixed by @samp{~}.
output is prefixed by @samp{~}.
 
 
@item
@item
@cindex target output in @sc{gdb/mi}
@cindex target output in @sc{gdb/mi}
@var{target-stream-output} is the output produced by the target program.
@var{target-stream-output} is the output produced by the target program.
All the target output is prefixed by @samp{@@}.
All the target output is prefixed by @samp{@@}.
 
 
@item
@item
@cindex log output in @sc{gdb/mi}
@cindex log output in @sc{gdb/mi}
@var{log-stream-output} is output text coming from GDB's internals, for
@var{log-stream-output} is output text coming from GDB's internals, for
instance messages that should be displayed as part of an error log.  All
instance messages that should be displayed as part of an error log.  All
the log output is prefixed by @samp{&}.
the log output is prefixed by @samp{&}.
@end itemize
@end itemize
 
 
@xref{GDB/MI Stream Records, , @sc{gdb/mi} Stream Records}, for more
@xref{GDB/MI Stream Records, , @sc{gdb/mi} Stream Records}, for more
details about the various output records.
details about the various output records.
 
 
@xref{GDB/MI Draft Changes to Output Syntax, , @sc{gdb/mi} Draft Changes
@xref{GDB/MI Draft Changes to Output Syntax, , @sc{gdb/mi} Draft Changes
to Output Syntax}, for proposed revisions to the current output syntax.
to Output Syntax}, for proposed revisions to the current output syntax.
 
 
@node GDB/MI Simple Examples
@node GDB/MI Simple Examples
@subsection Simple Examples of @sc{gdb/mi} Interaction
@subsection Simple Examples of @sc{gdb/mi} Interaction
@cindex @sc{gdb/mi}, simple examples
@cindex @sc{gdb/mi}, simple examples
 
 
This subsection presents several simple examples of interaction using
This subsection presents several simple examples of interaction using
the @sc{gdb/mi} interface.  In these examples, @samp{->} means that the
the @sc{gdb/mi} interface.  In these examples, @samp{->} means that the
following line is passed to @sc{gdb/mi} as input, while @samp{<-} means
following line is passed to @sc{gdb/mi} as input, while @samp{<-} means
the output received from @sc{gdb/mi}.
the output received from @sc{gdb/mi}.
 
 
@subsubheading Target Stop
@subsubheading Target Stop
 
 
Here's an example of stopping the inferior process:
Here's an example of stopping the inferior process:
 
 
@example
@example
-> -stop
-> -stop
<- (gdb)
<- (gdb)
@end example
@end example
 
 
@noindent
@noindent
and later:
and later:
 
 
@example
@example
<- *stop,reason="stop",address="0x123",source="a.c:123"
<- *stop,reason="stop",address="0x123",source="a.c:123"
<- (gdb)
<- (gdb)
@end example
@end example
 
 
@subsubheading Simple CLI Command
@subsubheading Simple CLI Command
 
 
Here's an example of a simple CLI command being passed through
Here's an example of a simple CLI command being passed through
@sc{gdb/mi} and on to the CLI.
@sc{gdb/mi} and on to the CLI.
 
 
@example
@example
-> print 1+2
-> print 1+2
<- ~3\n
<- ~3\n
<- (gdb)
<- (gdb)
@end example
@end example
 
 
@subsubheading Command With Side Effects
@subsubheading Command With Side Effects
 
 
@example
@example
-> -symbol-file xyz.exe
-> -symbol-file xyz.exe
<- *breakpoint,nr="3",address="0x123",source="a.c:123"
<- *breakpoint,nr="3",address="0x123",source="a.c:123"
<- (gdb)
<- (gdb)
@end example
@end example
 
 
@subsubheading A Bad Command
@subsubheading A Bad Command
 
 
Here's what happens if you pass a non-existent command:
Here's what happens if you pass a non-existent command:
 
 
@example
@example
-> -rubbish
-> -rubbish
<- error,"Rubbish not found"
<- error,"Rubbish not found"
<- (gdb)
<- (gdb)
@end example
@end example
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Compatibility with CLI
@node GDB/MI Compatibility with CLI
@section @sc{gdb/mi} Compatibility with CLI
@section @sc{gdb/mi} Compatibility with CLI
 
 
@cindex compatibility, @sc{gdb/mi} and CLI
@cindex compatibility, @sc{gdb/mi} and CLI
@cindex @sc{gdb/mi}, compatibility with CLI
@cindex @sc{gdb/mi}, compatibility with CLI
To help users familiar with GDB's existing CLI interface, @sc{gdb/mi}
To help users familiar with GDB's existing CLI interface, @sc{gdb/mi}
accepts existing CLI commands.  As specified by the syntax, such
accepts existing CLI commands.  As specified by the syntax, such
commands can be directly entered into the @sc{gdb/mi} interface and GDB will
commands can be directly entered into the @sc{gdb/mi} interface and GDB will
respond.
respond.
 
 
This mechanism is provided as an aid to developers of @sc{gdb/mi}
This mechanism is provided as an aid to developers of @sc{gdb/mi}
clients and not as a reliable interface into the CLI.  Since the command
clients and not as a reliable interface into the CLI.  Since the command
is being interpreteted in an environment that assumes @sc{gdb/mi}
is being interpreteted in an environment that assumes @sc{gdb/mi}
behaviour, the exact output of such commands is likely to end up being
behaviour, the exact output of such commands is likely to end up being
an un-supported hybrid of @sc{gdb/mi} and CLI output.
an un-supported hybrid of @sc{gdb/mi} and CLI output.
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Output Records
@node GDB/MI Output Records
@section @sc{gdb/mi} Output Records
@section @sc{gdb/mi} Output Records
 
 
@menu
@menu
* GDB/MI Result Records::
* GDB/MI Result Records::
* GDB/MI Stream Records::
* GDB/MI Stream Records::
* GDB/MI Out-of-band Records::
* GDB/MI Out-of-band Records::
@end menu
@end menu
 
 
@node GDB/MI Result Records
@node GDB/MI Result Records
@subsection @sc{gdb/mi} Result Records
@subsection @sc{gdb/mi} Result Records
 
 
@cindex result records in @sc{gdb/mi}
@cindex result records in @sc{gdb/mi}
@cindex @sc{gdb/mi}, result records
@cindex @sc{gdb/mi}, result records
In addition to a number of out-of-band notifications, the response to a
In addition to a number of out-of-band notifications, the response to a
@sc{gdb/mi} command includes one of the following result indications:
@sc{gdb/mi} command includes one of the following result indications:
 
 
@table @code
@table @code
@findex ^done
@findex ^done
@item "^done" [ "," @var{results} ]
@item "^done" [ "," @var{results} ]
The synchronous operation was successful, @code{@var{results}} is the return
The synchronous operation was successful, @code{@var{results}} is the return
value.
value.
 
 
@item "^running"
@item "^running"
@findex ^running
@findex ^running
@c Is this one correct?  Should it be an out-of-band notification?
@c Is this one correct?  Should it be an out-of-band notification?
The asynchronous operation was successfully started.  The target is
The asynchronous operation was successfully started.  The target is
running.
running.
 
 
@item "^error" "," @var{c-string}
@item "^error" "," @var{c-string}
@cindex ^error
@cindex ^error
The operation failed.  The @code{@var{c-string}} contains the corresponding
The operation failed.  The @code{@var{c-string}} contains the corresponding
error message.
error message.
@end table
@end table
 
 
@node GDB/MI Stream Records
@node GDB/MI Stream Records
@subsection @sc{gdb/mi} Stream Records
@subsection @sc{gdb/mi} Stream Records
 
 
@cindex @sc{gdb/mi}, stream records
@cindex @sc{gdb/mi}, stream records
@cindex stream records in @sc{gdb/mi}
@cindex stream records in @sc{gdb/mi}
GDB internally maintains a number of output streams: the console, the
GDB internally maintains a number of output streams: the console, the
target, and the log.  The output intended for each of these streams is
target, and the log.  The output intended for each of these streams is
funneled through the @sc{gdb/mi} interface using @dfn{stream records}.
funneled through the @sc{gdb/mi} interface using @dfn{stream records}.
 
 
Each stream record begins with a unique @dfn{prefix character} which
Each stream record begins with a unique @dfn{prefix character} which
identifies its stream (@pxref{GDB/MI Output Syntax, , @sc{gdb/mi} Output
identifies its stream (@pxref{GDB/MI Output Syntax, , @sc{gdb/mi} Output
Syntax}). In addition to the prefix, each stream record contains a
Syntax}). In addition to the prefix, each stream record contains a
@code{@var{string-output}}.  This is either raw text (with an implicit new
@code{@var{string-output}}.  This is either raw text (with an implicit new
line) or a quoted C string (which does not contain an implicit newline).
line) or a quoted C string (which does not contain an implicit newline).
 
 
@table @code
@table @code
@item "~" @var{string-output}
@item "~" @var{string-output}
The console output stream contains text that should be displayed in the
The console output stream contains text that should be displayed in the
CLI console window.  It contains the textual responses to CLI commands.
CLI console window.  It contains the textual responses to CLI commands.
 
 
@item "@@" @var{string-output}
@item "@@" @var{string-output}
The target output stream contains any textual output from the running
The target output stream contains any textual output from the running
target.
target.
 
 
@item "&" @var{string-output}
@item "&" @var{string-output}
The LOG stream contains debugging messages being produced by GDB's
The LOG stream contains debugging messages being produced by GDB's
internals.
internals.
@end table
@end table
 
 
@node GDB/MI Out-of-band Records
@node GDB/MI Out-of-band Records
@subsection @sc{gdb/mi} Out-of-band Records
@subsection @sc{gdb/mi} Out-of-band Records
 
 
@cindex out-of-band records in @sc{gdb/mi}
@cindex out-of-band records in @sc{gdb/mi}
@cindex @sc{gdb/mi}, out-of-band records
@cindex @sc{gdb/mi}, out-of-band records
@dfn{Out-of-band} records are used to notify the @sc{gdb/mi} client of
@dfn{Out-of-band} records are used to notify the @sc{gdb/mi} client of
additional changes that have occurred.  Those changes can either be a
additional changes that have occurred.  Those changes can either be a
consequence of @sc{gdb/mi} (e.g., a breakpoint modified) or a result of
consequence of @sc{gdb/mi} (e.g., a breakpoint modified) or a result of
target activity (e.g., target stopped).
target activity (e.g., target stopped).
 
 
The following is a preliminary list of possible out-of-band records.
The following is a preliminary list of possible out-of-band records.
 
 
@table @code
@table @code
@item "*" "stop"
@item "*" "stop"
@end table
@end table
 
 
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Command Description Format
@node GDB/MI Command Description Format
@section @sc{gdb/mi} Command Description Format
@section @sc{gdb/mi} Command Description Format
 
 
The remaining sections describe blocks of commands.  Each block of
The remaining sections describe blocks of commands.  Each block of
commands is laid out in a fashion similar to this chapter.
commands is laid out in a fashion similar to this chapter.
 
 
Note the the line breaks shown in the examples are here only for
Note the the line breaks shown in the examples are here only for
readability. They don't appear in the real output.
readability. They don't appear in the real output.
Also note that the commands with a non-available example (N.A.@:) are
Also note that the commands with a non-available example (N.A.@:) are
not yet implemented.
not yet implemented.
 
 
@subheading Motivation
@subheading Motivation
 
 
The motivation for this collection of commands
The motivation for this collection of commands
 
 
@subheading Introduction
@subheading Introduction
 
 
A brief introduction to this collection of commands as a whole.
A brief introduction to this collection of commands as a whole.
 
 
@subheading Commands
@subheading Commands
 
 
For each command in the block, the following is described:
For each command in the block, the following is described:
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -command @var{args}...
 -command @var{args}...
@end example
@end example
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB CLI command.
The corresponding GDB CLI command.
 
 
@subsubheading Result
@subsubheading Result
 
 
@subsubheading Out-of-band
@subsubheading Out-of-band
 
 
@subsubheading Notes
@subsubheading Notes
 
 
@subsubheading Example
@subsubheading Example
 
 
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Breakpoint Table Commands
@node GDB/MI Breakpoint Table Commands
@section @sc{gdb/mi} Breakpoint table commands
@section @sc{gdb/mi} Breakpoint table commands
 
 
@cindex breakpoint commands for @sc{gdb/mi}
@cindex breakpoint commands for @sc{gdb/mi}
@cindex @sc{gdb/mi}, breakpoint commands
@cindex @sc{gdb/mi}, breakpoint commands
This section documents @sc{gdb/mi} commands for manipulating
This section documents @sc{gdb/mi} commands for manipulating
breakpoints.
breakpoints.
 
 
@subheading The @code{-break-after} Command
@subheading The @code{-break-after} Command
@findex -break-after
@findex -break-after
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -break-after @var{number} @var{count}
 -break-after @var{number} @var{count}
@end example
@end example
 
 
The breakpoint number @var{number} is not in effect until it has been
The breakpoint number @var{number} is not in effect until it has been
hit @var{count} times.  To see how this is reflected in the output of
hit @var{count} times.  To see how this is reflected in the output of
the @samp{-break-list} command, see the description of the
the @samp{-break-list} command, see the description of the
@samp{-break-list} command below.
@samp{-break-list} command below.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{ignore}.
The corresponding GDB command is @samp{ignore}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-break-insert main
-break-insert main
^done,bkpt=@{number="1",addr="0x000100d0",file="hello.c",line="5"@}
^done,bkpt=@{number="1",addr="0x000100d0",file="hello.c",line="5"@}
(gdb)
(gdb)
-break-after 1 3
-break-after 1 3
~
~
^done
^done
(gdb)
(gdb)
-break-list
-break-list
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0",
ignore="3"@}@}
ignore="3"@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@ignore
@ignore
@subheading The @code{-break-catch} Command
@subheading The @code{-break-catch} Command
@findex -break-catch
@findex -break-catch
 
 
@subheading The @code{-break-commands} Command
@subheading The @code{-break-commands} Command
@findex -break-commands
@findex -break-commands
@end ignore
@end ignore
 
 
 
 
@subheading -break-condition
@subheading -break-condition
@findex -break-condition
@findex -break-condition
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -break-condition @var{number} @var{expr}
 -break-condition @var{number} @var{expr}
@end example
@end example
 
 
Breakpoint @var{number} will stop the program only if the condition in
Breakpoint @var{number} will stop the program only if the condition in
@var{expr} is true.  The condition becomes part of the
@var{expr} is true.  The condition becomes part of the
@samp{-break-list} output (see the description of the @samp{-break-list}
@samp{-break-list} output (see the description of the @samp{-break-list}
command below).
command below).
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{condition}.
The corresponding GDB command is @samp{condition}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-break-condition 1 1
-break-condition 1 1
^done
^done
(gdb)
(gdb)
-break-list
-break-list
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",cond="1",
addr="0x000100d0",func="main",file="hello.c",line="5",cond="1",
times="0",ignore="3"@}@}
times="0",ignore="3"@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@subheading The @code{-break-delete} Command
@subheading The @code{-break-delete} Command
@findex -break-delete
@findex -break-delete
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -break-delete ( @var{breakpoint} )+
 -break-delete ( @var{breakpoint} )+
@end example
@end example
 
 
Delete the breakpoint(s) whose number(s) are specified in the argument
Delete the breakpoint(s) whose number(s) are specified in the argument
list. This is obviously reflected in the breakpoint list.
list. This is obviously reflected in the breakpoint list.
 
 
@subsubheading GDB command
@subsubheading GDB command
 
 
The corresponding GDB command is @samp{delete}.
The corresponding GDB command is @samp{delete}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@example
@example
(gdb)
(gdb)
-break-delete 1
-break-delete 1
^done
^done
(gdb)
(gdb)
-break-list
-break-list
^done,BreakpointTable=@{@}
^done,BreakpointTable=@{@}
(gdb)
(gdb)
@end example
@end example
 
 
@subheading The @code{-break-disable} Command
@subheading The @code{-break-disable} Command
@findex -break-disable
@findex -break-disable
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -break-disable ( @var{breakpoint} )+
 -break-disable ( @var{breakpoint} )+
@end example
@end example
 
 
Disable the named @var{breakpoint}(s).  The field @samp{enabled} in the
Disable the named @var{breakpoint}(s).  The field @samp{enabled} in the
break list is now set to @samp{n} for the named @var{breakpoint}(s).
break list is now set to @samp{n} for the named @var{breakpoint}(s).
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{disable}.
The corresponding GDB command is @samp{disable}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-break-disable 2
-break-disable 2
^done
^done
(gdb)
(gdb)
-break-list
-break-list
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
bkpt=@{number="2",type="breakpoint",disp="keep",enabled="n",
bkpt=@{number="2",type="breakpoint",disp="keep",enabled="n",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}@}
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@subheading The @code{-break-enable} Command
@subheading The @code{-break-enable} Command
@findex -break-enable
@findex -break-enable
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -break-enable ( @var{breakpoint} )+
 -break-enable ( @var{breakpoint} )+
@end example
@end example
 
 
Enable (previously disabled) @var{breakpoint}(s).
Enable (previously disabled) @var{breakpoint}(s).
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{enable}.
The corresponding GDB command is @samp{enable}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-break-enable 2
-break-enable 2
^done
^done
(gdb)
(gdb)
-break-list
-break-list
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}@}
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@subheading The @code{-break-info} Command
@subheading The @code{-break-info} Command
@findex -break-info
@findex -break-info
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -break-info @var{breakpoint}
 -break-info @var{breakpoint}
@end example
@end example
 
 
@c REDUNDANT???
@c REDUNDANT???
Get information about a single breakpoint.
Get information about a single breakpoint.
 
 
@subsubheading GDB command
@subsubheading GDB command
 
 
The corresponding GDB command is @samp{info break @var{breakpoint}}.
The corresponding GDB command is @samp{info break @var{breakpoint}}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
@subheading The @code{-break-insert} Command
@subheading The @code{-break-insert} Command
@findex -break-insert
@findex -break-insert
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -break-insert [ -t ] [ -h ] [ -r ]
 -break-insert [ -t ] [ -h ] [ -r ]
    [ -c @var{condition} ] [ -i @var{ignore-count} ]
    [ -c @var{condition} ] [ -i @var{ignore-count} ]
    [ -p @var{thread} ] [ @var{line} | @var{addr} ]
    [ -p @var{thread} ] [ @var{line} | @var{addr} ]
@end example
@end example
 
 
@noindent
@noindent
If specified, @var{line}, can be one of:
If specified, @var{line}, can be one of:
 
 
@itemize @bullet
@itemize @bullet
@item function
@item function
@c @item +offset
@c @item +offset
@c @item -offset
@c @item -offset
@c @item linenum
@c @item linenum
@item filename:linenum
@item filename:linenum
@item filename:function
@item filename:function
@item *address
@item *address
@end itemize
@end itemize
 
 
The possible optional parameters of this command are:
The possible optional parameters of this command are:
 
 
@table @samp
@table @samp
@item -t
@item -t
Insert a tempoary breakpoint.
Insert a tempoary breakpoint.
@item -h
@item -h
Insert a hardware breakpoint.
Insert a hardware breakpoint.
@item -c @var{condition}
@item -c @var{condition}
Make the breakpoint conditional on @var{condition}.
Make the breakpoint conditional on @var{condition}.
@item -i @var{ignore-count}
@item -i @var{ignore-count}
Initialize the @var{ignore-count}.
Initialize the @var{ignore-count}.
@item -r
@item -r
Insert a regular breakpoint in all the functions whose names match the
Insert a regular breakpoint in all the functions whose names match the
given regular expression.  Other flags are not applicable to regular
given regular expression.  Other flags are not applicable to regular
expresson.
expresson.
@end table
@end table
 
 
@subsubheading Result
@subsubheading Result
 
 
The result is in the form:
The result is in the form:
 
 
@example
@example
 ^done,bkptno="@var{number}",func="@var{funcname}",
 ^done,bkptno="@var{number}",func="@var{funcname}",
  file="@var{filename}",line="@var{lineno}"
  file="@var{filename}",line="@var{lineno}"
@end example
@end example
 
 
@noindent
@noindent
where @var{number} is the GDB number for this breakpoint, @var{funcname}
where @var{number} is the GDB number for this breakpoint, @var{funcname}
is the name of the function where the breakpoint was inserted,
is the name of the function where the breakpoint was inserted,
@var{filename} is the name of the source file which contains this
@var{filename} is the name of the source file which contains this
function, and @var{lineno} is the source line number within that file.
function, and @var{lineno} is the source line number within that file.
 
 
Note: this format is open to change.
Note: this format is open to change.
@c An out-of-band breakpoint instead of part of the result?
@c An out-of-band breakpoint instead of part of the result?
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB commands are @samp{break}, @samp{tbreak},
The corresponding GDB commands are @samp{break}, @samp{tbreak},
@samp{hbreak}, @samp{thbreak}, and @samp{rbreak}.
@samp{hbreak}, @samp{thbreak}, and @samp{rbreak}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-break-insert main
-break-insert main
^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@}
^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@}
(gdb)
(gdb)
-break-insert -t foo
-break-insert -t foo
^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",line="11"@}
^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",line="11"@}
(gdb)
(gdb)
-break-list
-break-list
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x0001072c", func="main",file="recursive2.c",line="4",times="0"@},
addr="0x0001072c", func="main",file="recursive2.c",line="4",times="0"@},
bkpt=@{number="2",type="breakpoint",disp="del",enabled="y",
bkpt=@{number="2",type="breakpoint",disp="del",enabled="y",
addr="0x00010774",func="foo",file="recursive2.c",line="11",times="0"@}@}
addr="0x00010774",func="foo",file="recursive2.c",line="11",times="0"@}@}
(gdb)
(gdb)
-break-insert -r foo.*
-break-insert -r foo.*
~int foo(int, int);
~int foo(int, int);
^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c",line="11"@}
^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c",line="11"@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@subheading The @code{-break-list} Command
@subheading The @code{-break-list} Command
@findex -break-list
@findex -break-list
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -break-list
 -break-list
@end example
@end example
 
 
Displays the list of inserted breakpoints, showing the following fields:
Displays the list of inserted breakpoints, showing the following fields:
 
 
@table @samp
@table @samp
@item Number
@item Number
number of the breakpoint
number of the breakpoint
@item Type
@item Type
type of the breakpoint: @samp{breakpoint} or @samp{watchpoint}
type of the breakpoint: @samp{breakpoint} or @samp{watchpoint}
@item Disposition
@item Disposition
should the breakpoint be deleted or disabled when it is hit: @samp{keep}
should the breakpoint be deleted or disabled when it is hit: @samp{keep}
or @samp{nokeep}
or @samp{nokeep}
@item Enabled
@item Enabled
is the breakpoint enabled or no: @samp{y} or @samp{n}
is the breakpoint enabled or no: @samp{y} or @samp{n}
@item Address
@item Address
memory location at which the breakpoint is set
memory location at which the breakpoint is set
@item What
@item What
logical location of the breakpoint, expressed by function name, file
logical location of the breakpoint, expressed by function name, file
name, line number
name, line number
@item times
@item times
number of times the breakpoint has been hit
number of times the breakpoint has been hit
@end table
@end table
 
 
If there are no breakpoints or watchpoints, the BreakpointTable field is
If there are no breakpoints or watchpoints, the BreakpointTable field is
an empty list.
an empty list.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{info break}.
The corresponding GDB command is @samp{info break}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-break-list
-break-list
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@},
addr="0x000100d0",func="main",file="hello.c",line="5",times="0"@},
bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
addr="0x00010114",func="foo",file="hello.c",line="13",times="0"@}@}
addr="0x00010114",func="foo",file="hello.c",line="13",times="0"@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
Here's an example of the result when there are no breakpoints:
Here's an example of the result when there are no breakpoints:
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-break-list
-break-list
^done,BreakpointTable=@{@}
^done,BreakpointTable=@{@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@subheading The @code{-break-watch} Command
@subheading The @code{-break-watch} Command
@findex -break-watch
@findex -break-watch
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -break-watch [ -a | -r ]
 -break-watch [ -a | -r ]
@end example
@end example
 
 
Create a watchpoint.  With the @samp{-a} option it will create an
Create a watchpoint.  With the @samp{-a} option it will create an
@dfn{access} watchpoint, i.e. a watchpoint that triggers either on a
@dfn{access} watchpoint, i.e. a watchpoint that triggers either on a
read from or on a write to the memory location.  With the @samp{-r}
read from or on a write to the memory location.  With the @samp{-r}
option, the watchpoint created is a @dfn{read} watchpoint, i.e. it will
option, the watchpoint created is a @dfn{read} watchpoint, i.e. it will
trigger only when the memory location is accessed for reading.  Without
trigger only when the memory location is accessed for reading.  Without
either of the options, the watchpoint created is a regular watchpoint,
either of the options, the watchpoint created is a regular watchpoint,
i.e. it will trigger when the memory location is accessed for writing.
i.e. it will trigger when the memory location is accessed for writing.
@xref{Set Watchpoints, , Setting watchpoints}.
@xref{Set Watchpoints, , Setting watchpoints}.
 
 
Note that @samp{-break-list} will report a single list of watchpoints and
Note that @samp{-break-list} will report a single list of watchpoints and
breakpoints inserted.
breakpoints inserted.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB commands are @samp{watch}, @samp{awatch}, and
The corresponding GDB commands are @samp{watch}, @samp{awatch}, and
@samp{rwatch}.
@samp{rwatch}.
 
 
@subsubheading Example
@subsubheading Example
 
 
Setting a watchpoint on a variable in the @code{main} function:
Setting a watchpoint on a variable in the @code{main} function:
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-break-watch x
-break-watch x
^done,wpt=@{number="2",exp="x"@}
^done,wpt=@{number="2",exp="x"@}
(gdb)
(gdb)
-exec-continue
-exec-continue
^running
^running
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
value=@{old="-268439212",new="55"@},
value=@{old="-268439212",new="55"@},
frame=@{func="main",args=@{@},file="recursive2.c",line="5"@}
frame=@{func="main",args=@{@},file="recursive2.c",line="5"@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
Setting a watchpoint on a variable local to a function.  GDB will stop
Setting a watchpoint on a variable local to a function.  GDB will stop
the program execution twice: first for the variable changing value, then
the program execution twice: first for the variable changing value, then
for the watchpoint going out of scope.
for the watchpoint going out of scope.
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-break-watch C
-break-watch C
^done,wpt=@{number="5",exp="C"@}
^done,wpt=@{number="5",exp="C"@}
(gdb)
(gdb)
-exec-continue
-exec-continue
^running
^running
^done,reason="watchpoint-trigger",
^done,reason="watchpoint-trigger",
wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
wpt=@{number="5",exp="C"@},value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=@{@},
frame=@{func="callee4",args=@{@},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(gdb)
(gdb)
-exec-continue
-exec-continue
^running
^running
^done,reason="watchpoint-scope",wpnum="5",
^done,reason="watchpoint-scope",wpnum="5",
frame=@{func="callee3",args=@{@{name="strarg",
frame=@{func="callee3",args=@{@{name="strarg",
value="0x11940 \"A string argument.\""@}@},
value="0x11940 \"A string argument.\""@}@},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
Listing breakpoints and watchpoints, at different points in the program
Listing breakpoints and watchpoints, at different points in the program
execution.  Note that once the watchpoint goes out of scope, it is
execution.  Note that once the watchpoint goes out of scope, it is
deleted.
deleted.
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-break-watch C
-break-watch C
^done,wpt=@{number="2",exp="C"@}
^done,wpt=@{number="2",exp="C"@}
(gdb)
(gdb)
-break-list
-break-list
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x00010734",func="callee4",
addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
bkpt=@{number="2",type="watchpoint",disp="keep",
bkpt=@{number="2",type="watchpoint",disp="keep",
enabled="y",addr="",what="C",times="0"@}@}
enabled="y",addr="",what="C",times="0"@}@}
(gdb)
(gdb)
-exec-continue
-exec-continue
^running
^running
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
value=@{old="-276895068",new="3"@},
value=@{old="-276895068",new="3"@},
frame=@{func="callee4",args=@{@},
frame=@{func="callee4",args=@{@},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
(gdb)
(gdb)
-break-list
-break-list
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x00010734",func="callee4",
addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
bkpt=@{number="2",type="watchpoint",disp="keep",
bkpt=@{number="2",type="watchpoint",disp="keep",
enabled="y",addr="",what="C",times="-5"@}@}
enabled="y",addr="",what="C",times="-5"@}@}
(gdb)
(gdb)
-exec-continue
-exec-continue
^running
^running
^done,reason="watchpoint-scope",wpnum="2",
^done,reason="watchpoint-scope",wpnum="2",
frame=@{func="callee3",args=@{@{name="strarg",
frame=@{func="callee3",args=@{@{name="strarg",
value="0x11940 \"A string argument.\""@}@},
value="0x11940 \"A string argument.\""@}@},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(gdb)
(gdb)
-break-list
-break-list
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
^done,BreakpointTable=@{hdr=@{"Num","Type","Disp","Enb","Address","What"@},
bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x00010734",func="callee4",
addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@}@}
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Data Manipulation
@node GDB/MI Data Manipulation
@section @sc{gdb/mi} Data Manipulation
@section @sc{gdb/mi} Data Manipulation
 
 
@cindex data manipulation, in @sc{gdb/mi}
@cindex data manipulation, in @sc{gdb/mi}
@cindex @sc{gdb/mi}, data manipulation
@cindex @sc{gdb/mi}, data manipulation
This section describes the @sc{gdb/mi} commands that manipulate data:
This section describes the @sc{gdb/mi} commands that manipulate data:
examine memory and registers, evaluate expressions, etc.
examine memory and registers, evaluate expressions, etc.
 
 
@c REMOVED FROM THE INTERFACE.
@c REMOVED FROM THE INTERFACE.
@c @subheading -data-assign
@c @subheading -data-assign
@c Change the value of a program variable. Plenty of side effects.
@c Change the value of a program variable. Plenty of side effects.
@c @subsubheading GDB command
@c @subsubheading GDB command
@c set variable
@c set variable
@c @subsubheading Example
@c @subsubheading Example
@c N.A.
@c N.A.
 
 
@subheading The @code{-data-disassemble} Command
@subheading The @code{-data-disassemble} Command
@findex -data-disassemble
@findex -data-disassemble
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -data-disassemble
 -data-disassemble
    [ -s @var{start-addr} -e @var{end-addr} ]
    [ -s @var{start-addr} -e @var{end-addr} ]
  | [ -f @var{filename} -l @var{linenum} [ -n @var{lines} ] ]
  | [ -f @var{filename} -l @var{linenum} [ -n @var{lines} ] ]
  -- @var{mode}
  -- @var{mode}
@end example
@end example
 
 
@noindent
@noindent
Where:
Where:
 
 
@table @samp
@table @samp
@item @var{start-addr}
@item @var{start-addr}
is the beginning address (or @code{$pc})
is the beginning address (or @code{$pc})
@item @var{end-addr}
@item @var{end-addr}
is the end address
is the end address
@item @var{filename}
@item @var{filename}
is the name of the file to disassemble
is the name of the file to disassemble
@item @var{linenum}
@item @var{linenum}
is the line number to disassemble around
is the line number to disassemble around
@item @var{lines}
@item @var{lines}
is the the number of disassembly lines to be produced.  If it is -1,
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} is
the whole function will be disassembled, in case no @var{end-addr} is
specified.  If @var{end-addr} is specified as a non-zero value, and
specified.  If @var{end-addr} is specified as a non-zero value, and
@var{lines} is lower than the number of disassembly lines between
@var{lines} is lower than the number of disassembly lines between
@var{start-addr} and @var{end-addr}, only @var{lines} lines are
@var{start-addr} and @var{end-addr}, only @var{lines} lines are
displayed; if @var{lines} is higher than the number of lines between
displayed; if @var{lines} is higher than the number of lines between
@var{start-addr} and @var{end-addr}, only the lines up to @var{end-addr}
@var{start-addr} and @var{end-addr}, only the lines up to @var{end-addr}
are displayed.
are displayed.
@item @var{mode}
@item @var{mode}
is either 0 (meaning only disassembly) or 1 (meaning mixed source and
is either 0 (meaning only disassembly) or 1 (meaning mixed source and
disassembly)
disassembly)
@end table
@end table
 
 
@subsubheading Result
@subsubheading Result
 
 
The output for each instruction is composed of two fields:
The output for each instruction is composed of two fields:
 
 
@itemize @bullet
@itemize @bullet
@item Address
@item Address
@item Func-name
@item Func-name
@item Offset
@item Offset
@item Instruction
@item Instruction
@end itemize
@end itemize
 
 
Note that whatever included in the instruction field, is not manipulated
Note that whatever included in the instruction field, is not manipulated
directely by flathead, i.e. it is not possible to adjust its format.
directely by flathead, i.e. it is not possible to adjust its format.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
There's no direct mapping from this command to the CLI.
There's no direct mapping from this command to the CLI.
 
 
@subsubheading Example
@subsubheading Example
 
 
Disassemble from the current value of @code{$pc} to @code{$pc + 20}:
Disassemble from the current value of @code{$pc} to @code{$pc + 20}:
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-data-disassemble -s $pc -e "$pc + 20" -- 0
-data-disassemble -s $pc -e "$pc + 20" -- 0
^done,
^done,
asm_insns=@{
asm_insns=@{
@{address="0x000107c0",func-name="main",offset="4",
@{address="0x000107c0",func-name="main",offset="4",
inst="mov  2, %o0"@},
inst="mov  2, %o0"@},
@{address="0x000107c4",func-name="main",offset="8",
@{address="0x000107c4",func-name="main",offset="8",
inst="sethi  %hi(0x11800), %o2"@},
inst="sethi  %hi(0x11800), %o2"@},
@{address="0x000107c8",func-name="main",offset="12",
@{address="0x000107c8",func-name="main",offset="12",
inst="or  %o2, 0x140, %o1\t! 0x11940 <_lib_version+8>"@},
inst="or  %o2, 0x140, %o1\t! 0x11940 <_lib_version+8>"@},
@{address="0x000107cc",func-name="main",offset="16",
@{address="0x000107cc",func-name="main",offset="16",
inst="sethi  %hi(0x11800), %o2"@},
inst="sethi  %hi(0x11800), %o2"@},
@{address="0x000107d0",func-name="main",offset="20",
@{address="0x000107d0",func-name="main",offset="20",
inst="or  %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"@}@}
inst="or  %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
Disassemble the whole @code{main} function.  Line 32 is part of
Disassemble the whole @code{main} function.  Line 32 is part of
@code{main}.
@code{main}.
 
 
@smallexample
@smallexample
-data-disassemble -f basics.c -l 32 -- 0
-data-disassemble -f basics.c -l 32 -- 0
^done,asm_insns=@{
^done,asm_insns=@{
@{address="0x000107bc",func-name="main",offset="0",
@{address="0x000107bc",func-name="main",offset="0",
inst="save  %sp, -112, %sp"@},
inst="save  %sp, -112, %sp"@},
@{address="0x000107c0",func-name="main",offset="4",
@{address="0x000107c0",func-name="main",offset="4",
inst="mov   2, %o0"@},
inst="mov   2, %o0"@},
@{address="0x000107c4",func-name="main",offset="8",
@{address="0x000107c4",func-name="main",offset="8",
inst="sethi %hi(0x11800), %o2"@},
inst="sethi %hi(0x11800), %o2"@},
[...]
[...]
@{address="0x0001081c",func-name="main",offset="96",inst="ret "@},
@{address="0x0001081c",func-name="main",offset="96",inst="ret "@},
@{address="0x00010820",func-name="main",offset="100",inst="restore "@}@}
@{address="0x00010820",func-name="main",offset="100",inst="restore "@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
Disassemble 3 instructions from the start of @code{main}:
Disassemble 3 instructions from the start of @code{main}:
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-data-disassemble -f basics.c -l 32 -n 3 -- 0
-data-disassemble -f basics.c -l 32 -n 3 -- 0
^done,asm_insns=@{
^done,asm_insns=@{
@{address="0x000107bc",func-name="main",offset="0",
@{address="0x000107bc",func-name="main",offset="0",
inst="save  %sp, -112, %sp"@},
inst="save  %sp, -112, %sp"@},
@{address="0x000107c0",func-name="main",offset="4",
@{address="0x000107c0",func-name="main",offset="4",
inst="mov  2, %o0"@},
inst="mov  2, %o0"@},
@{address="0x000107c4",func-name="main",offset="8",
@{address="0x000107c4",func-name="main",offset="8",
inst="sethi  %hi(0x11800), %o2"@}@}
inst="sethi  %hi(0x11800), %o2"@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
Disassemble 3 instructions from the start of @code{main} in mixed mode:
Disassemble 3 instructions from the start of @code{main} in mixed mode:
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-data-disassemble -f basics.c -l 32 -n 3 -- 1
-data-disassemble -f basics.c -l 32 -n 3 -- 1
^done,asm_insns=@{
^done,asm_insns=@{
src_and_asm_line=@{line="31",
src_and_asm_line=@{line="31",
file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
  testsuite/gdb.mi/basics.c",line_asm_insn=@{
  testsuite/gdb.mi/basics.c",line_asm_insn=@{
@{address="0x000107bc",func-name="main",offset="0",
@{address="0x000107bc",func-name="main",offset="0",
inst="save  %sp, -112, %sp"@}@}@},
inst="save  %sp, -112, %sp"@}@}@},
 
 
src_and_asm_line=@{line="32",
src_and_asm_line=@{line="32",
file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
  testsuite/gdb.mi/basics.c",line_asm_insn=@{
  testsuite/gdb.mi/basics.c",line_asm_insn=@{
@{address="0x000107c0",func-name="main",offset="4",
@{address="0x000107c0",func-name="main",offset="4",
inst="mov  2, %o0"@},
inst="mov  2, %o0"@},
@{address="0x000107c4",func-name="main",offset="8",
@{address="0x000107c4",func-name="main",offset="8",
inst="sethi  %hi(0x11800), %o2"@}@}@}@}
inst="sethi  %hi(0x11800), %o2"@}@}@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-data-evaluate-expression} Command
@subheading The @code{-data-evaluate-expression} Command
@findex -data-evaluate-expression
@findex -data-evaluate-expression
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -data-evaluate-expression @var{expr}
 -data-evaluate-expression @var{expr}
@end example
@end example
 
 
Evaluate @var{expr} as an expression.  The expression could contain an
Evaluate @var{expr} as an expression.  The expression could contain an
inferior function call.  The function call will execute synchronously.
inferior function call.  The function call will execute synchronously.
If the expression contains spaces, it must be enclosed in double quotes.
If the expression contains spaces, it must be enclosed in double quotes.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB commands are @samp{print}, @samp{output}, and
The corresponding GDB commands are @samp{print}, @samp{output}, and
@samp{call}.  In @code{gdbtk} only, there's a corresponding
@samp{call}.  In @code{gdbtk} only, there's a corresponding
@samp{gdb_eval} command.
@samp{gdb_eval} command.
 
 
@subsubheading Example
@subsubheading Example
 
 
In the following example, the numbers that precede the commands are the
In the following example, the numbers that precede the commands are the
@dfn{tokens} described in @ref{GDB/MI Command Syntax, , @sc{gdb/mi}
@dfn{tokens} described in @ref{GDB/MI Command Syntax, , @sc{gdb/mi}
Command Syntax}.  Notice how @sc{gdb/mi} returns the same tokens in its
Command Syntax}.  Notice how @sc{gdb/mi} returns the same tokens in its
output.
output.
 
 
@smallexample
@smallexample
211-data-evaluate-expression A
211-data-evaluate-expression A
211^done,value="1"
211^done,value="1"
(gdb)
(gdb)
311-data-evaluate-expression &A
311-data-evaluate-expression &A
311^done,value="0xefffeb7c"
311^done,value="0xefffeb7c"
(gdb)
(gdb)
411-data-evaluate-expression A+3
411-data-evaluate-expression A+3
411^done,value="4"
411^done,value="4"
(gdb)
(gdb)
511-data-evaluate-expression "A + 3"
511-data-evaluate-expression "A + 3"
511^done,value="4"
511^done,value="4"
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-data-list-changed-registers} Command
@subheading The @code{-data-list-changed-registers} Command
@findex -data-list-changed-registers
@findex -data-list-changed-registers
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -data-list-changed-registers
 -data-list-changed-registers
@end example
@end example
 
 
Display a list of the registers that have changed.
Display a list of the registers that have changed.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
GDB doesn't have a direct analog for this command; @code{gdbtk} has the
GDB doesn't have a direct analog for this command; @code{gdbtk} has the
corresponding command @samp{gdb_changed_register_list}.
corresponding command @samp{gdb_changed_register_list}.
 
 
@subsubheading Example
@subsubheading Example
 
 
On a PPC MBX board:
On a PPC MBX board:
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-exec-continue
-exec-continue
^running
^running
 
 
(gdb)
(gdb)
*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
args=@{@},file="try.c",line="5"@}
args=@{@},file="try.c",line="5"@}
(gdb)
(gdb)
-data-list-changed-registers
-data-list-changed-registers
^done,changed-registers=@{"0","1","2","4","5","6","7","8","9",
^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",
"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"@}
"24","25","26","27","28","30","31","64","65","66","67","69"@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-data-list-register-names} Command
@subheading The @code{-data-list-register-names} Command
@findex -data-list-register-names
@findex -data-list-register-names
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -data-list-register-names [ ( @var{regno} )+ ]
 -data-list-register-names [ ( @var{regno} )+ ]
@end example
@end example
 
 
Show a list of register names for the current target.  If no arguments
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
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
integer numbers are given as arguments, it will print a list of the
names of the registers corresponding to the arguments.
names of the registers corresponding to the arguments.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
GDB does not have a command which corresponds to
GDB does not have a command which corresponds to
@samp{-data-list-register-names}.  In @code{gdbtk} there is a
@samp{-data-list-register-names}.  In @code{gdbtk} there is a
corresponding command @samp{gdb_regnames}.
corresponding command @samp{gdb_regnames}.
 
 
@subsubheading Example
@subsubheading Example
 
 
For the PPC MBX board:
For the PPC MBX board:
@smallexample
@smallexample
(gdb)
(gdb)
-data-list-register-names
-data-list-register-names
^done,register-names=@{"r0","r1","r2","r3","r4","r5","r6","r7",
^done,register-names=@{"r0","r1","r2","r3","r4","r5","r6","r7",
"r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18",
"r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18",
"r19","r20","r21","r22","r23","r24","r25","r26","r27","r28","r29",
"r19","r20","r21","r22","r23","r24","r25","r26","r27","r28","r29",
"r30","r31","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9",
"r30","r31","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9",
"f10","f11","f12","f13","f14","f15","f16","f17","f18","f19","f20",
"f10","f11","f12","f13","f14","f15","f16","f17","f18","f19","f20",
"f21","f22","f23","f24","f25","f26","f27","f28","f29","f30","f31",
"f21","f22","f23","f24","f25","f26","f27","f28","f29","f30","f31",
"pc","ps","cr","lr","ctr","xer"@}
"pc","ps","cr","lr","ctr","xer"@}
(gdb)
(gdb)
-data-list-register-names 1 2 3
-data-list-register-names 1 2 3
^done,register-names=@{"r1","r2","r3"@}
^done,register-names=@{"r1","r2","r3"@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@subheading The @code{-data-list-register-values} Command
@subheading The @code{-data-list-register-values} Command
@findex -data-list-register-values
@findex -data-list-register-values
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -data-list-register-values @var{fmt} [ ( @var{regno} )*]
 -data-list-register-values @var{fmt} [ ( @var{regno} )*]
@end example
@end example
 
 
Display the registers' contents.  @var{fmt} is the format according to
Display the registers' contents.  @var{fmt} is the format according to
which the registers' contents are to be returned, followed by an optional
which the registers' contents are to be returned, followed by an optional
list of numbers specifying the registers to display.  A missing list of
list of numbers specifying the registers to display.  A missing list of
numbers indicates that the contents of all the registers must be returned.
numbers indicates that the contents of all the registers must be returned.
 
 
Allowed formats for @var{fmt} are:
Allowed formats for @var{fmt} are:
 
 
@table @code
@table @code
@item x
@item x
Hexadecimal
Hexadecimal
@item o
@item o
Octal
Octal
@item t
@item t
Binary
Binary
@item d
@item d
Decimal
Decimal
@item r
@item r
Raw
Raw
@item N
@item N
Natural
Natural
@end table
@end table
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB commands are @samp{info reg}, @samp{info all-reg},
The corresponding GDB commands are @samp{info reg}, @samp{info all-reg},
and (in @code{gdbtk}) @samp{gdb_fetch_registers}.
and (in @code{gdbtk}) @samp{gdb_fetch_registers}.
 
 
@subsubheading Example
@subsubheading Example
 
 
For a PPC MBX board (note: line breaks are for readability only, they
For a PPC MBX board (note: line breaks are for readability only, they
don't appear in the actual output):
don't appear in the actual output):
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-data-list-register-values r 64 65
-data-list-register-values r 64 65
^done,register-values=@{@{number="64",value="0xfe00a300"@},
^done,register-values=@{@{number="64",value="0xfe00a300"@},
@{number="65",value="0x00029002"@}@}
@{number="65",value="0x00029002"@}@}
(gdb)
(gdb)
-data-list-register-values x
-data-list-register-values x
^done,register-values=@{@{number="0",value="0xfe0043c8"@},
^done,register-values=@{@{number="0",value="0xfe0043c8"@},
@{number="1",value="0x3fff88"@},@{number="2",value="0xfffffffe"@},
@{number="1",value="0x3fff88"@},@{number="2",value="0xfffffffe"@},
@{number="3",value="0x0"@},@{number="4",value="0xa"@},
@{number="3",value="0x0"@},@{number="4",value="0xa"@},
@{number="5",value="0x3fff68"@},@{number="6",value="0x3fff58"@},
@{number="5",value="0x3fff68"@},@{number="6",value="0x3fff58"@},
@{number="7",value="0xfe011e98"@},@{number="8",value="0x2"@},
@{number="7",value="0xfe011e98"@},@{number="8",value="0x2"@},
@{number="9",value="0xfa202820"@},@{number="10",value="0xfa202808"@},
@{number="9",value="0xfa202820"@},@{number="10",value="0xfa202808"@},
@{number="11",value="0x1"@},@{number="12",value="0x0"@},
@{number="11",value="0x1"@},@{number="12",value="0x0"@},
@{number="13",value="0x4544"@},@{number="14",value="0xffdfffff"@},
@{number="13",value="0x4544"@},@{number="14",value="0xffdfffff"@},
@{number="15",value="0xffffffff"@},@{number="16",value="0xfffffeff"@},
@{number="15",value="0xffffffff"@},@{number="16",value="0xfffffeff"@},
@{number="17",value="0xefffffed"@},@{number="18",value="0xfffffffe"@},
@{number="17",value="0xefffffed"@},@{number="18",value="0xfffffffe"@},
@{number="19",value="0xffffffff"@},@{number="20",value="0xffffffff"@},
@{number="19",value="0xffffffff"@},@{number="20",value="0xffffffff"@},
@{number="21",value="0xffffffff"@},@{number="22",value="0xfffffff7"@},
@{number="21",value="0xffffffff"@},@{number="22",value="0xfffffff7"@},
@{number="23",value="0xffffffff"@},@{number="24",value="0xffffffff"@},
@{number="23",value="0xffffffff"@},@{number="24",value="0xffffffff"@},
@{number="25",value="0xffffffff"@},@{number="26",value="0xfffffffb"@},
@{number="25",value="0xffffffff"@},@{number="26",value="0xfffffffb"@},
@{number="27",value="0xffffffff"@},@{number="28",value="0xf7bfffff"@},
@{number="27",value="0xffffffff"@},@{number="28",value="0xf7bfffff"@},
@{number="29",value="0x0"@},@{number="30",value="0xfe010000"@},
@{number="29",value="0x0"@},@{number="30",value="0xfe010000"@},
@{number="31",value="0x0"@},@{number="32",value="0x0"@},
@{number="31",value="0x0"@},@{number="32",value="0x0"@},
@{number="33",value="0x0"@},@{number="34",value="0x0"@},
@{number="33",value="0x0"@},@{number="34",value="0x0"@},
@{number="35",value="0x0"@},@{number="36",value="0x0"@},
@{number="35",value="0x0"@},@{number="36",value="0x0"@},
@{number="37",value="0x0"@},@{number="38",value="0x0"@},
@{number="37",value="0x0"@},@{number="38",value="0x0"@},
@{number="39",value="0x0"@},@{number="40",value="0x0"@},
@{number="39",value="0x0"@},@{number="40",value="0x0"@},
@{number="41",value="0x0"@},@{number="42",value="0x0"@},
@{number="41",value="0x0"@},@{number="42",value="0x0"@},
@{number="43",value="0x0"@},@{number="44",value="0x0"@},
@{number="43",value="0x0"@},@{number="44",value="0x0"@},
@{number="45",value="0x0"@},@{number="46",value="0x0"@},
@{number="45",value="0x0"@},@{number="46",value="0x0"@},
@{number="47",value="0x0"@},@{number="48",value="0x0"@},
@{number="47",value="0x0"@},@{number="48",value="0x0"@},
@{number="49",value="0x0"@},@{number="50",value="0x0"@},
@{number="49",value="0x0"@},@{number="50",value="0x0"@},
@{number="51",value="0x0"@},@{number="52",value="0x0"@},
@{number="51",value="0x0"@},@{number="52",value="0x0"@},
@{number="53",value="0x0"@},@{number="54",value="0x0"@},
@{number="53",value="0x0"@},@{number="54",value="0x0"@},
@{number="55",value="0x0"@},@{number="56",value="0x0"@},
@{number="55",value="0x0"@},@{number="56",value="0x0"@},
@{number="57",value="0x0"@},@{number="58",value="0x0"@},
@{number="57",value="0x0"@},@{number="58",value="0x0"@},
@{number="59",value="0x0"@},@{number="60",value="0x0"@},
@{number="59",value="0x0"@},@{number="60",value="0x0"@},
@{number="61",value="0x0"@},@{number="62",value="0x0"@},
@{number="61",value="0x0"@},@{number="62",value="0x0"@},
@{number="63",value="0x0"@},@{number="64",value="0xfe00a300"@},
@{number="63",value="0x0"@},@{number="64",value="0xfe00a300"@},
@{number="65",value="0x29002"@},@{number="66",value="0x202f04b5"@},
@{number="65",value="0x29002"@},@{number="66",value="0x202f04b5"@},
@{number="67",value="0xfe0043b0"@},@{number="68",value="0xfe00b3e4"@},
@{number="67",value="0xfe0043b0"@},@{number="68",value="0xfe00b3e4"@},
@{number="69",value="0x20002b03"@}@}
@{number="69",value="0x20002b03"@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-data-read-memory} Command
@subheading The @code{-data-read-memory} Command
@findex -data-read-memory
@findex -data-read-memory
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -data-read-memory [ -o @var{byte-offset} ]
 -data-read-memory [ -o @var{byte-offset} ]
   @var{address} @var{word-format} @var{word-size}
   @var{address} @var{word-format} @var{word-size}
   @var{nr-rows} @var{nr-cols} [ @var{aschar} ]
   @var{nr-rows} @var{nr-cols} [ @var{aschar} ]
@end example
@end example
 
 
@noindent
@noindent
where:
where:
 
 
@table @samp
@table @samp
@item @var{address}
@item @var{address}
An expression specifying the address of the first memory word to be
An expression specifying the address of the first memory word to be
read.  Complex expressions containing embedded white space should be
read.  Complex expressions containing embedded white space should be
quoted using the C convention.
quoted using the C convention.
 
 
@item @var{word-format}
@item @var{word-format}
The format to be used to print the memory words.  The notation is the
The format to be used to print the memory words.  The notation is the
same as for GDB's @code{print} command (@pxref{Output Formats, , Output
same as for GDB's @code{print} command (@pxref{Output Formats, , Output
formats}).
formats}).
 
 
@item @var{word-size}
@item @var{word-size}
The size of each memory word in bytes.
The size of each memory word in bytes.
 
 
@item @var{nr-rows}
@item @var{nr-rows}
The number of rows in the output table.
The number of rows in the output table.
 
 
@item @var{nr-cols}
@item @var{nr-cols}
The number of columns in the output table.
The number of columns in the output table.
 
 
@item @var{aschar}
@item @var{aschar}
If present, indicates that each row should include an @sc{ascii} dump.  The
If present, indicates that each row should include an @sc{ascii} dump.  The
value of @var{aschar} is used as a padding character when a byte is not a
value of @var{aschar} is used as a padding character when a byte is not a
member of the printable @sc{ascii} character set (printable @sc{ascii}
member of the printable @sc{ascii} character set (printable @sc{ascii}
characters are those whose code is between 32 and 126, inclusively).
characters are those whose code is between 32 and 126, inclusively).
 
 
@item @var{byte-offset}
@item @var{byte-offset}
An offset to add to the @var{address} before fetching memory.
An offset to add to the @var{address} before fetching memory.
@end table
@end table
 
 
This command displays memory contents as a table of @var{nr-rows} by
This command displays memory contents as a table of @var{nr-rows} by
@var{nr-cols} words, each word being @var{word-size} bytes.  In total,
@var{nr-cols} words, each word being @var{word-size} bytes.  In total,
@code{@var{nr-rows} * @var{nr-cols} * @var{word-size}} bytes are read
@code{@var{nr-rows} * @var{nr-cols} * @var{word-size}} bytes are read
(returned as @samp{total-bytes}).  Should less then the requested number
(returned as @samp{total-bytes}).  Should less then the requested number
of bytes be returned by the target, the missing words are identified
of bytes be returned by the target, the missing words are identified
using @samp{N/A}.  The number of bytes read from the target is returned
using @samp{N/A}.  The number of bytes read from the target is returned
in @samp{nr-bytes} and the starting address used to read memory in
in @samp{nr-bytes} and the starting address used to read memory in
@samp{addr}.
@samp{addr}.
 
 
The address of the next/previous page or row is available in
The address of the next/previous page or row is available in
@samp{next-row} and @samp{prev-row}, @samp{next-page} and
@samp{next-row} and @samp{prev-row}, @samp{next-page} and
@samp{prev-page}.
@samp{prev-page}.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{x}.  @code{gdbtk} has
The corresponding GDB command is @samp{x}.  @code{gdbtk} has
@samp{gdb_get_mem} memory read.
@samp{gdb_get_mem} memory read.
 
 
@subsubheading Example
@subsubheading Example
 
 
Read six bytes of memory starting at @code{bytes+6} but then offset by
Read six bytes of memory starting at @code{bytes+6} but then offset by
@code{-6} bytes.  Format as three rows of two columns. One byte per
@code{-6} bytes.  Format as three rows of two columns. One byte per
word.  Display each word in hex.
word.  Display each word in hex.
 
 
@smallexample
@smallexample
(gdb)
(gdb)
9-data-read-memory -o -6 -- bytes+6 x 1 3 2
9-data-read-memory -o -6 -- bytes+6 x 1 3 2
9^done,addr="0x00001390",nr-bytes="6",total-bytes="6",
9^done,addr="0x00001390",nr-bytes="6",total-bytes="6",
next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396",
next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396",
prev-page="0x0000138a",memory=@{
prev-page="0x0000138a",memory=@{
@{addr="0x00001390",data=@{"0x00","0x01"@}@},
@{addr="0x00001390",data=@{"0x00","0x01"@}@},
@{addr="0x00001392",data=@{"0x02","0x03"@}@},
@{addr="0x00001392",data=@{"0x02","0x03"@}@},
@{addr="0x00001394",data=@{"0x04","0x05"@}@}@}
@{addr="0x00001394",data=@{"0x04","0x05"@}@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
Read two bytes of memory starting at address @code{shorts + 64} and
Read two bytes of memory starting at address @code{shorts + 64} and
display as a single word formatted in decimal.
display as a single word formatted in decimal.
 
 
@smallexample
@smallexample
(gdb)
(gdb)
5-data-read-memory shorts+64 d 2 1 1
5-data-read-memory shorts+64 d 2 1 1
5^done,addr="0x00001510",nr-bytes="2",total-bytes="2",
5^done,addr="0x00001510",nr-bytes="2",total-bytes="2",
next-row="0x00001512",prev-row="0x0000150e",
next-row="0x00001512",prev-row="0x0000150e",
next-page="0x00001512",prev-page="0x0000150e",memory=@{
next-page="0x00001512",prev-page="0x0000150e",memory=@{
@{addr="0x00001510",data=@{"128"@}@}@}
@{addr="0x00001510",data=@{"128"@}@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
Read thirty two bytes of memory starting at @code{bytes+16} and format
Read thirty two bytes of memory starting at @code{bytes+16} and format
as eight rows of four columns.  Include a string encoding with @code{x}
as eight rows of four columns.  Include a string encoding with @code{x}
used as the non-printable character.
used as the non-printable character.
 
 
@smallexample
@smallexample
(gdb)
(gdb)
4-data-read-memory bytes+16 x 1 8 4 x
4-data-read-memory bytes+16 x 1 8 4 x
4^done,addr="0x000013a0",nr-bytes="32",total-bytes="32",
4^done,addr="0x000013a0",nr-bytes="32",total-bytes="32",
next-row="0x000013c0",prev-row="0x0000139c",
next-row="0x000013c0",prev-row="0x0000139c",
next-page="0x000013c0",prev-page="0x00001380",memory=@{
next-page="0x000013c0",prev-page="0x00001380",memory=@{
@{addr="0x000013a0",data=@{"0x10","0x11","0x12","0x13"@},ascii="xxxx"@},
@{addr="0x000013a0",data=@{"0x10","0x11","0x12","0x13"@},ascii="xxxx"@},
@{addr="0x000013a4",data=@{"0x14","0x15","0x16","0x17"@},ascii="xxxx"@},
@{addr="0x000013a4",data=@{"0x14","0x15","0x16","0x17"@},ascii="xxxx"@},
@{addr="0x000013a8",data=@{"0x18","0x19","0x1a","0x1b"@},ascii="xxxx"@},
@{addr="0x000013a8",data=@{"0x18","0x19","0x1a","0x1b"@},ascii="xxxx"@},
@{addr="0x000013ac",data=@{"0x1c","0x1d","0x1e","0x1f"@},ascii="xxxx"@},
@{addr="0x000013ac",data=@{"0x1c","0x1d","0x1e","0x1f"@},ascii="xxxx"@},
@{addr="0x000013b0",data=@{"0x20","0x21","0x22","0x23"@},ascii=" !\"#"@},
@{addr="0x000013b0",data=@{"0x20","0x21","0x22","0x23"@},ascii=" !\"#"@},
@{addr="0x000013b4",data=@{"0x24","0x25","0x26","0x27"@},ascii="$%&'"@},
@{addr="0x000013b4",data=@{"0x24","0x25","0x26","0x27"@},ascii="$%&'"@},
@{addr="0x000013b8",data=@{"0x28","0x29","0x2a","0x2b"@},ascii="()*+"@},
@{addr="0x000013b8",data=@{"0x28","0x29","0x2a","0x2b"@},ascii="()*+"@},
@{addr="0x000013bc",data=@{"0x2c","0x2d","0x2e","0x2f"@},ascii=",-./"@}@}
@{addr="0x000013bc",data=@{"0x2c","0x2d","0x2e","0x2f"@},ascii=",-./"@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@subheading The @code{-display-delete} Command
@subheading The @code{-display-delete} Command
@findex -display-delete
@findex -display-delete
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -display-delete @var{number}
 -display-delete @var{number}
@end example
@end example
 
 
Delete the display @var{number}.
Delete the display @var{number}.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{delete display}.
The corresponding GDB command is @samp{delete display}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-display-disable} Command
@subheading The @code{-display-disable} Command
@findex -display-disable
@findex -display-disable
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -display-disable @var{number}
 -display-disable @var{number}
@end example
@end example
 
 
Disable display @var{number}.
Disable display @var{number}.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{disable display}.
The corresponding GDB command is @samp{disable display}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-display-enable} Command
@subheading The @code{-display-enable} Command
@findex -display-enable
@findex -display-enable
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -display-enable @var{number}
 -display-enable @var{number}
@end example
@end example
 
 
Enable display @var{number}.
Enable display @var{number}.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{enable display}.
The corresponding GDB command is @samp{enable display}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-display-insert} Command
@subheading The @code{-display-insert} Command
@findex -display-insert
@findex -display-insert
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -display-insert @var{expression}
 -display-insert @var{expression}
@end example
@end example
 
 
Display @var{expression} every time the program stops.
Display @var{expression} every time the program stops.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{display}.
The corresponding GDB command is @samp{display}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-display-list} Command
@subheading The @code{-display-list} Command
@findex -display-list
@findex -display-list
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -display-list
 -display-list
@end example
@end example
 
 
List the displays.  Do not show the current values.
List the displays.  Do not show the current values.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{info display}.
The corresponding GDB command is @samp{info display}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-environment-cd} Command
@subheading The @code{-environment-cd} Command
@findex -environment-cd
@findex -environment-cd
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -environment-cd @var{pathdir}
 -environment-cd @var{pathdir}
@end example
@end example
 
 
Set GDB's working directory.
Set GDB's working directory.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{cd}.
The corresponding GDB command is @samp{cd}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
-environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
^done
^done
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-environment-directory} Command
@subheading The @code{-environment-directory} Command
@findex -environment-directory
@findex -environment-directory
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -environment-directory @var{pathdir}
 -environment-directory @var{pathdir}
@end example
@end example
 
 
Add directory @var{pathdir} to beginning of search path for source files.
Add directory @var{pathdir} to beginning of search path for source files.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{dir}.
The corresponding GDB command is @samp{dir}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
-environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
^done
^done
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-environment-path} Command
@subheading The @code{-environment-path} Command
@findex -environment-path
@findex -environment-path
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -environment-path ( @var{pathdir} )+
 -environment-path ( @var{pathdir} )+
@end example
@end example
 
 
Add directories to beginning of search path for object files.
Add directories to beginning of search path for object files.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{path}.
The corresponding GDB command is @samp{path}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb
-environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb
^done
^done
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-environment-pwd} Command
@subheading The @code{-environment-pwd} Command
@findex -environment-pwd
@findex -environment-pwd
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -environment-pwd
 -environment-pwd
@end example
@end example
 
 
Show the current working directory.
Show the current working directory.
 
 
@subsubheading GDB command
@subsubheading GDB command
 
 
The corresponding GDB command is @samp{pwd}.
The corresponding GDB command is @samp{pwd}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-environment-pwd
-environment-pwd
~Working directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb.
~Working directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb.
^done
^done
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Program Control
@node GDB/MI Program Control
@section @sc{gdb/mi} Program control
@section @sc{gdb/mi} Program control
 
 
@subsubheading Program termination
@subsubheading Program termination
 
 
As a result of execution, the inferior program can run to completion, if
As a result of execution, the inferior program can run to completion, if
it doesn't encouter any breakpoints.  In this case the ouput will
it doesn't encouter any breakpoints.  In this case the ouput will
include an exit code, if the program has exited exceptionally.
include an exit code, if the program has exited exceptionally.
 
 
@subsubheading Examples:
@subsubheading Examples:
 
 
@noindent
@noindent
Program exited normally:
Program exited normally:
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-exec-run
-exec-run
^running
^running
(gdb)
(gdb)
x = 55
x = 55
*stopped,reason="exited-normally"
*stopped,reason="exited-normally"
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@noindent
@noindent
Program exited exceptionally:
Program exited exceptionally:
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-exec-run
-exec-run
^running
^running
(gdb)
(gdb)
x = 55
x = 55
*stopped,reason="exited",exit-code="01"
*stopped,reason="exited",exit-code="01"
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
Another way the program can terminate is if it receives a signal such as
Another way the program can terminate is if it receives a signal such as
@code{SIGINT}.  In this case, @sc{gdb/mi} displays this:
@code{SIGINT}.  In this case, @sc{gdb/mi} displays this:
 
 
@smallexample
@smallexample
(gdb)
(gdb)
*stopped,reason="exited-signalled",signal-name="SIGINT",
*stopped,reason="exited-signalled",signal-name="SIGINT",
signal-meaning="Interrupt"
signal-meaning="Interrupt"
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-exec-abort} Command
@subheading The @code{-exec-abort} Command
@findex -exec-abort
@findex -exec-abort
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -exec-abort
 -exec-abort
@end example
@end example
 
 
Kill the inferior running program.
Kill the inferior running program.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{kill}.
The corresponding GDB command is @samp{kill}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-exec-arguments} Command
@subheading The @code{-exec-arguments} Command
@findex -exec-arguments
@findex -exec-arguments
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -exec-arguments @var{args}
 -exec-arguments @var{args}
@end example
@end example
 
 
Set the inferior program arguments, to be used in the next
Set the inferior program arguments, to be used in the next
@samp{-exec-run}.
@samp{-exec-run}.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{set args}.
The corresponding GDB command is @samp{set args}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@c FIXME!
@c FIXME!
Don't have one around.
Don't have one around.
 
 
 
 
@subheading The @code{-exec-continue} Command
@subheading The @code{-exec-continue} Command
@findex -exec-continue
@findex -exec-continue
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -exec-continue
 -exec-continue
@end example
@end example
 
 
Asynchronous command.  Resumes the execution of the inferior program
Asynchronous command.  Resumes the execution of the inferior program
until a breakpoint is encountered, or until the inferior exits.
until a breakpoint is encountered, or until the inferior exits.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB corresponding is @samp{continue}.
The corresponding GDB corresponding is @samp{continue}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
-exec-continue
-exec-continue
^running
^running
(gdb)
(gdb)
@@Hello world
@@Hello world
*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=@{@},
*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=@{@},
file="hello.c",line="13"@}
file="hello.c",line="13"@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-exec-finish} Command
@subheading The @code{-exec-finish} Command
@findex -exec-finish
@findex -exec-finish
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -exec-finish
 -exec-finish
@end example
@end example
 
 
Asynchronous command.  Resumes the execution of the inferior program
Asynchronous command.  Resumes the execution of the inferior program
until the current function is exited.  Displays the results returned by
until the current function is exited.  Displays the results returned by
the function.
the function.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{finish}.
The corresponding GDB command is @samp{finish}.
 
 
@subsubheading Example
@subsubheading Example
 
 
Function returning @code{void}.
Function returning @code{void}.
 
 
@smallexample
@smallexample
-exec-finish
-exec-finish
^running
^running
(gdb)
(gdb)
@@hello from foo
@@hello from foo
*stopped,reason="function-finished",frame=@{func="main",args=@{@},
*stopped,reason="function-finished",frame=@{func="main",args=@{@},
file="hello.c",line="7"@}
file="hello.c",line="7"@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
Function returning other than @code{void}.  The name of the internal GDB
Function returning other than @code{void}.  The name of the internal GDB
variable storing the result is printed, together with the value itself.
variable storing the result is printed, together with the value itself.
 
 
@smallexample
@smallexample
-exec-finish
-exec-finish
^running
^running
(gdb)
(gdb)
*stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo",
*stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo",
args=@{@{name="a",value="1"@},@{name="b",value="9"@}@},
args=@{@{name="a",value="1"@},@{name="b",value="9"@}@},
file="recursive2.c",line="14"@},
file="recursive2.c",line="14"@},
gdb-result-var="$1",return-value="0"
gdb-result-var="$1",return-value="0"
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-exec-interrupt} Command
@subheading The @code{-exec-interrupt} Command
@findex -exec-interrupt
@findex -exec-interrupt
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -exec-interrupt
 -exec-interrupt
@end example
@end example
 
 
Asynchronous command. Interrupts the background execution of the target.
Asynchronous command. Interrupts the background execution of the target.
Note how the token associated with the stop message is the one for the
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
execution command that has been interrupted.  The token for the interrupt
itself only appears in the '^done' output.  If the user is trying to
itself only appears in the '^done' output.  If the user is trying to
interrupt a non-running program, an error message will be printed.
interrupt a non-running program, an error message will be printed.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{interrupt}.
The corresponding GDB command is @samp{interrupt}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
111-exec-continue
111-exec-continue
111^running
111^running
 
 
(gdb)
(gdb)
222-exec-interrupt
222-exec-interrupt
222^done
222^done
(gdb)
(gdb)
111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
frame=@{addr="0x00010140",func="foo",args=@{@},file="try.c",line="13"@}
frame=@{addr="0x00010140",func="foo",args=@{@},file="try.c",line="13"@}
(gdb)
(gdb)
 
 
(gdb)
(gdb)
-exec-interrupt
-exec-interrupt
^error,msg="mi_cmd_exec_interrupt: Inferior not executing."
^error,msg="mi_cmd_exec_interrupt: Inferior not executing."
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-exec-next} Command
@subheading The @code{-exec-next} Command
@findex -exec-next
@findex -exec-next
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -exec-next
 -exec-next
@end example
@end example
 
 
Asynchronous command.  Resumes execution of the inferior program, stopping
Asynchronous command.  Resumes execution of the inferior program, stopping
when the beginning of the next source line is reached.
when the beginning of the next source line is reached.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{next}.
The corresponding GDB command is @samp{next}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
-exec-next
-exec-next
^running
^running
(gdb)
(gdb)
*stopped,reason="end-stepping-range",line="8",file="hello.c"
*stopped,reason="end-stepping-range",line="8",file="hello.c"
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-exec-next-instruction} Command
@subheading The @code{-exec-next-instruction} Command
@findex -exec-next-instruction
@findex -exec-next-instruction
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -exec-next-instruction
 -exec-next-instruction
@end example
@end example
 
 
Asynchronous command.  Executes one machine instruction.  If the
Asynchronous command.  Executes one machine instruction.  If the
instruction is a function call continues until the function returns.  If
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
the program stops at an instruction in the middle of a source line, the
address will be printed as well.
address will be printed as well.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{nexti}.
The corresponding GDB command is @samp{nexti}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-exec-next-instruction
-exec-next-instruction
^running
^running
 
 
(gdb)
(gdb)
*stopped,reason="end-stepping-range",
*stopped,reason="end-stepping-range",
addr="0x000100d4",line="5",file="hello.c"
addr="0x000100d4",line="5",file="hello.c"
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-exec-return} Command
@subheading The @code{-exec-return} Command
@findex -exec-return
@findex -exec-return
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -exec-return
 -exec-return
@end example
@end example
 
 
Makes current function return immediately.  Doesn't execute the inferior.
Makes current function return immediately.  Doesn't execute the inferior.
Displays the new current frame.
Displays the new current frame.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{return}.
The corresponding GDB command is @samp{return}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
200-break-insert callee4
200-break-insert callee4
200^done,bkpt=@{number="1",addr="0x00010734",
200^done,bkpt=@{number="1",addr="0x00010734",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
(gdb)
(gdb)
000-exec-run
000-exec-run
000^running
000^running
(gdb)
(gdb)
000*stopped,reason="breakpoint-hit",bkptno="1",
000*stopped,reason="breakpoint-hit",bkptno="1",
frame=@{func="callee4",args=@{@},
frame=@{func="callee4",args=@{@},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
(gdb)
(gdb)
205-break-delete
205-break-delete
205^done
205^done
(gdb)
(gdb)
111-exec-return
111-exec-return
111^done,frame=@{level="0 ",func="callee3",
111^done,frame=@{level="0 ",func="callee3",
args=@{@{name="strarg",
args=@{@{name="strarg",
value="0x11940 \"A string argument.\""@}@},
value="0x11940 \"A string argument.\""@}@},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-exec-run} Command
@subheading The @code{-exec-run} Command
@findex -exec-run
@findex -exec-run
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -exec-run
 -exec-run
@end example
@end example
 
 
Asynchronous command.  Starts execution of the inferior from the
Asynchronous command.  Starts execution of the inferior from the
beginning.  The inferior executes until either a breakpoint is
beginning.  The inferior executes until either a breakpoint is
encountered or the program exits.
encountered or the program exits.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{run}.
The corresponding GDB command is @samp{run}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-break-insert main
-break-insert main
^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@}
^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@}
(gdb)
(gdb)
-exec-run
-exec-run
^running
^running
(gdb)
(gdb)
*stopped,reason="breakpoint-hit",bkptno="1",
*stopped,reason="breakpoint-hit",bkptno="1",
frame=@{func="main",args=@{@},file="recursive2.c",line="4"@}
frame=@{func="main",args=@{@},file="recursive2.c",line="4"@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-exec-show-arguments} Command
@subheading The @code{-exec-show-arguments} Command
@findex -exec-show-arguments
@findex -exec-show-arguments
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -exec-show-arguments
 -exec-show-arguments
@end example
@end example
 
 
Print the arguments of the program.
Print the arguments of the program.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{show args}.
The corresponding GDB command is @samp{show args}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
@c @subheading -exec-signal
@c @subheading -exec-signal
 
 
@subheading The @code{-exec-step} Command
@subheading The @code{-exec-step} Command
@findex -exec-step
@findex -exec-step
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -exec-step
 -exec-step
@end example
@end example
 
 
Asynchronous command.  Resumes execution of the inferior program, stopping
Asynchronous command.  Resumes execution of the inferior program, stopping
when the beginning of the next source line is reached, if the next
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
source line is not a function call.  If it is, stop at the first
instruction of the called function.
instruction of the called function.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{step}.
The corresponding GDB command is @samp{step}.
 
 
@subsubheading Example
@subsubheading Example
 
 
Stepping into a function:
Stepping into a function:
 
 
@smallexample
@smallexample
-exec-step
-exec-step
^running
^running
(gdb)
(gdb)
*stopped,reason="end-stepping-range",
*stopped,reason="end-stepping-range",
frame=@{func="foo",args=@{@{name="a",value="10"@},
frame=@{func="foo",args=@{@{name="a",value="10"@},
@{name="b",value="0"@}@},file="recursive2.c",line="11"@}
@{name="b",value="0"@}@},file="recursive2.c",line="11"@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
Regular stepping:
Regular stepping:
 
 
@smallexample
@smallexample
-exec-step
-exec-step
^running
^running
(gdb)
(gdb)
*stopped,reason="end-stepping-range",line="14",file="recursive2.c"
*stopped,reason="end-stepping-range",line="14",file="recursive2.c"
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-exec-step-instruction} Command
@subheading The @code{-exec-step-instruction} Command
@findex -exec-step-instruction
@findex -exec-step-instruction
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -exec-step-instruction
 -exec-step-instruction
@end example
@end example
 
 
Asynchronous command.  Resumes the inferior which executes one machine
Asynchronous command.  Resumes the inferior which executes one machine
instruction.  The output, once GDB has stopped, will vary depending on
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
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
former case, the address at which the program stopped will be printed as
well.
well.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{stepi}.
The corresponding GDB command is @samp{stepi}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-exec-step-instruction
-exec-step-instruction
^running
^running
 
 
(gdb)
(gdb)
*stopped,reason="end-stepping-range",
*stopped,reason="end-stepping-range",
frame=@{func="foo",args=@{@},file="try.c",line="10"@}
frame=@{func="foo",args=@{@},file="try.c",line="10"@}
(gdb)
(gdb)
-exec-step-instruction
-exec-step-instruction
^running
^running
 
 
(gdb)
(gdb)
*stopped,reason="end-stepping-range",
*stopped,reason="end-stepping-range",
frame=@{addr="0x000100f4",func="foo",args=@{@},file="try.c",line="10"@}
frame=@{addr="0x000100f4",func="foo",args=@{@},file="try.c",line="10"@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-exec-until} Command
@subheading The @code{-exec-until} Command
@findex -exec-until
@findex -exec-until
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -exec-until [ @var{location} ]
 -exec-until [ @var{location} ]
@end example
@end example
 
 
Asynchronous command.  Executes the inferior until the @var{location}
Asynchronous command.  Executes the inferior until the @var{location}
specified in the argument is reached.  If there is no argument, the inferior
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.
executes until a source line greater than the current one is reached.
The reason for stopping in this case will be ``location-reached''.
The reason for stopping in this case will be ``location-reached''.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{until}.
The corresponding GDB command is @samp{until}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-exec-until recursive2.c:6
-exec-until recursive2.c:6
^running
^running
(gdb)
(gdb)
x = 55
x = 55
*stopped,reason="location-reached",frame=@{func="main",args=@{@},
*stopped,reason="location-reached",frame=@{func="main",args=@{@},
file="recursive2.c",line="6"@}
file="recursive2.c",line="6"@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@ignore
@ignore
@subheading -file-clear
@subheading -file-clear
Is this going away????
Is this going away????
@end ignore
@end ignore
 
 
 
 
@subheading The @code{-file-exec-and-symbols} Command
@subheading The @code{-file-exec-and-symbols} Command
@findex -file-exec-and-symbols
@findex -file-exec-and-symbols
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -file-exec-and-symbols @var{file}
 -file-exec-and-symbols @var{file}
@end example
@end example
 
 
Specify the executable file to be debugged.  This file is the one from
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
which the symbol table is also read.  If no file is specified, the
command clears the executable and symbol information.  If breakpoints
command clears the executable and symbol information.  If breakpoints
are set when using this command with no arguments, gdb will produce
are set when using this command with no arguments, gdb will produce
error messages.  Otherwise, no output is produced, except a completion
error messages.  Otherwise, no output is produced, except a completion
notification.
notification.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{file}.
The corresponding GDB command is @samp{file}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
-file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
^done
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-file-exec-file} Command
@subheading The @code{-file-exec-file} Command
@findex -file-exec-file
@findex -file-exec-file
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -file-exec-file @var{file}
 -file-exec-file @var{file}
@end example
@end example
 
 
Specify the executable file to be debugged.  Unlike
Specify the executable file to be debugged.  Unlike
@samp{-file-exec-and-symbols}, the symbol table is @emph{not} read
@samp{-file-exec-and-symbols}, the symbol table is @emph{not} read
from this file.  If used without argument, GDB clears the information
from this file.  If used without argument, GDB clears the information
about the executable file.  No output is produced, except a completion
about the executable file.  No output is produced, except a completion
notification.
notification.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{exec-file}.
The corresponding GDB command is @samp{exec-file}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
-file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
^done
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-file-list-exec-sections} Command
@subheading The @code{-file-list-exec-sections} Command
@findex -file-list-exec-sections
@findex -file-list-exec-sections
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -file-list-exec-sections
 -file-list-exec-sections
@end example
@end example
 
 
List the sections of the current executable file.
List the sections of the current executable file.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The GDB command @samp{info file} shows, among the rest, the same
The GDB command @samp{info file} shows, among the rest, the same
information as this command.  @code{gdbtk} has a corresponding command
information as this command.  @code{gdbtk} has a corresponding command
@samp{gdb_load_info}.
@samp{gdb_load_info}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-file-list-exec-source-files} Command
@subheading The @code{-file-list-exec-source-files} Command
@findex -file-list-exec-source-files
@findex -file-list-exec-source-files
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -file-list-exec-source-files
 -file-list-exec-source-files
@end example
@end example
 
 
List the source files for the current executable.
List the source files for the current executable.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
There's no GDB command which directly corresponds to this one.
There's no GDB command which directly corresponds to this one.
@code{gdbtk} has an analogous command @samp{gdb_listfiles}.
@code{gdbtk} has an analogous command @samp{gdb_listfiles}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-file-list-shared-libraries} Command
@subheading The @code{-file-list-shared-libraries} Command
@findex -file-list-shared-libraries
@findex -file-list-shared-libraries
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -file-list-shared-libraries
 -file-list-shared-libraries
@end example
@end example
 
 
List the shared libraries in the program.
List the shared libraries in the program.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{info shared}.
The corresponding GDB command is @samp{info shared}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-file-list-symbol-files} Command
@subheading The @code{-file-list-symbol-files} Command
@findex -file-list-symbol-files
@findex -file-list-symbol-files
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -file-list-symbol-files
 -file-list-symbol-files
@end example
@end example
 
 
List symbol files.
List symbol files.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{info file} (part of it).
The corresponding GDB command is @samp{info file} (part of it).
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-file-symbol-file} Command
@subheading The @code{-file-symbol-file} Command
@findex -file-symbol-file
@findex -file-symbol-file
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -file-symbol-file @var{file}
 -file-symbol-file @var{file}
@end example
@end example
 
 
Read symbol table info from the specified @var{file} argument.  When
Read symbol table info from the specified @var{file} argument.  When
used without arguments, clears GDB's symbol table info.  No output is
used without arguments, clears GDB's symbol table info.  No output is
produced, except for a completion notification.
produced, except for a completion notification.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{symbol-file}.
The corresponding GDB command is @samp{symbol-file}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
-file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
^done
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Miscellaneous Commands
@node GDB/MI Miscellaneous Commands
@section Miscellaneous GDB commands in @sc{gdb/mi}
@section Miscellaneous GDB commands in @sc{gdb/mi}
 
 
@c @subheading -gdb-complete
@c @subheading -gdb-complete
 
 
@subheading The @code{-gdb-exit} Command
@subheading The @code{-gdb-exit} Command
@findex -gdb-exit
@findex -gdb-exit
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -gdb-exit
 -gdb-exit
@end example
@end example
 
 
Exit GDB immediately.
Exit GDB immediately.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
Approximately corresponds to @samp{quit}.
Approximately corresponds to @samp{quit}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-gdb-exit
-gdb-exit
@end smallexample
@end smallexample
 
 
@subheading The @code{-gdb-set} Command
@subheading The @code{-gdb-set} Command
@findex -gdb-set
@findex -gdb-set
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -gdb-set
 -gdb-set
@end example
@end example
 
 
Set an internal GDB variable.
Set an internal GDB variable.
@c IS THIS A DOLLAR VARIABLE? OR SOMETHING LIKE ANNOTATE ?????
@c IS THIS A DOLLAR VARIABLE? OR SOMETHING LIKE ANNOTATE ?????
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{set}.
The corresponding GDB command is @samp{set}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-gdb-set $foo=3
-gdb-set $foo=3
^done
^done
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-gdb-show} Command
@subheading The @code{-gdb-show} Command
@findex -gdb-show
@findex -gdb-show
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -gdb-show
 -gdb-show
@end example
@end example
 
 
Show the current value of a GDB variable.
Show the current value of a GDB variable.
 
 
@subsubheading GDB command
@subsubheading GDB command
 
 
The corresponding GDB command is @samp{show}.
The corresponding GDB command is @samp{show}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-gdb-show annotate
-gdb-show annotate
^done,value="0"
^done,value="0"
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@c @subheading -gdb-source
@c @subheading -gdb-source
 
 
 
 
@subheading The @code{-gdb-version} Command
@subheading The @code{-gdb-version} Command
@findex -gdb-version
@findex -gdb-version
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -gdb-version
 -gdb-version
@end example
@end example
 
 
Show version information for GDB.  Used mostly in testing.
Show version information for GDB.  Used mostly in testing.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
There's no equivalent GDB command.  GDB by default shows this
There's no equivalent GDB command.  GDB by default shows this
information when you start an interactive session.
information when you start an interactive session.
 
 
@subsubheading Example
@subsubheading Example
 
 
@c This example modifies the actual output from GDB to avoid overfull
@c This example modifies the actual output from GDB to avoid overfull
@c box in TeX.
@c box in TeX.
@smallexample
@smallexample
(gdb)
(gdb)
-gdb-version
-gdb-version
~GNU gdb 5.2.1
~GNU gdb 5.2.1
~Copyright 2000 Free Software Foundation, Inc.
~Copyright 2000 Free Software Foundation, Inc.
~GDB is free software, covered by the GNU General Public License, and
~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
~you are welcome to change it and/or distribute copies of it under
~ certain conditions.
~ certain conditions.
~Type "show copying" to see the conditions.
~Type "show copying" to see the conditions.
~There is absolutely no warranty for GDB.  Type "show warranty" for
~There is absolutely no warranty for GDB.  Type "show warranty" for
~ details.
~ details.
~This GDB was configured as
~This GDB was configured as
 "--host=sparc-sun-solaris2.5.1 --target=ppc-eabi".
 "--host=sparc-sun-solaris2.5.1 --target=ppc-eabi".
^done
^done
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@ignore
@ignore
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Kod Commands
@node GDB/MI Kod Commands
@section @sc{gdb/mi} Kod Commands
@section @sc{gdb/mi} Kod Commands
 
 
The Kod commands are not implemented.
The Kod commands are not implemented.
 
 
@c @subheading -kod-info
@c @subheading -kod-info
 
 
@c @subheading -kod-list
@c @subheading -kod-list
 
 
@c @subheading -kod-list-object-types
@c @subheading -kod-list-object-types
 
 
@c @subheading -kod-show
@c @subheading -kod-show
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Memory Overlay Commands
@node GDB/MI Memory Overlay Commands
@section @sc{gdb/mi} Memory Overlay Commands
@section @sc{gdb/mi} Memory Overlay Commands
 
 
The memory overlay commands are not implemented.
The memory overlay commands are not implemented.
 
 
@c @subheading -overlay-auto
@c @subheading -overlay-auto
 
 
@c @subheading -overlay-list-mapping-state
@c @subheading -overlay-list-mapping-state
 
 
@c @subheading -overlay-list-overlays
@c @subheading -overlay-list-overlays
 
 
@c @subheading -overlay-map
@c @subheading -overlay-map
 
 
@c @subheading -overlay-off
@c @subheading -overlay-off
 
 
@c @subheading -overlay-on
@c @subheading -overlay-on
 
 
@c @subheading -overlay-unmap
@c @subheading -overlay-unmap
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Signal Handling Commands
@node GDB/MI Signal Handling Commands
@section @sc{gdb/mi} Signal Handling Commands
@section @sc{gdb/mi} Signal Handling Commands
 
 
Signal handling commands are not implemented.
Signal handling commands are not implemented.
 
 
@c @subheading -signal-handle
@c @subheading -signal-handle
 
 
@c @subheading -signal-list-handle-actions
@c @subheading -signal-list-handle-actions
 
 
@c @subheading -signal-list-signal-types
@c @subheading -signal-list-signal-types
@end ignore
@end ignore
 
 
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Stack Manipulation
@node GDB/MI Stack Manipulation
@section Stack manipulation commands in @sc{gdb/mi}
@section Stack manipulation commands in @sc{gdb/mi}
 
 
 
 
@subheading The @code{-stack-info-frame} Command
@subheading The @code{-stack-info-frame} Command
@findex -stack-info-frame
@findex -stack-info-frame
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -stack-info-frame
 -stack-info-frame
@end example
@end example
 
 
Get info on the current frame.
Get info on the current frame.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{info frame} or @samp{frame}
The corresponding GDB command is @samp{info frame} or @samp{frame}
(without arguments).
(without arguments).
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
@subheading The @code{-stack-info-depth} Command
@subheading The @code{-stack-info-depth} Command
@findex -stack-info-depth
@findex -stack-info-depth
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -stack-info-depth [ @var{max-depth} ]
 -stack-info-depth [ @var{max-depth} ]
@end example
@end example
 
 
Return the depth of the stack.  If the integer argument @var{max-depth}
Return the depth of the stack.  If the integer argument @var{max-depth}
is specified, do not count beyond @var{max-depth} frames.
is specified, do not count beyond @var{max-depth} frames.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
There's no equivalent GDB command.
There's no equivalent GDB command.
 
 
@subsubheading Example
@subsubheading Example
 
 
For a stack with frame levels 0 through 11:
For a stack with frame levels 0 through 11:
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-stack-info-depth
-stack-info-depth
^done,depth="12"
^done,depth="12"
(gdb)
(gdb)
-stack-info-depth 4
-stack-info-depth 4
^done,depth="4"
^done,depth="4"
(gdb)
(gdb)
-stack-info-depth 12
-stack-info-depth 12
^done,depth="12"
^done,depth="12"
(gdb)
(gdb)
-stack-info-depth 11
-stack-info-depth 11
^done,depth="11"
^done,depth="11"
(gdb)
(gdb)
-stack-info-depth 13
-stack-info-depth 13
^done,depth="12"
^done,depth="12"
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@subheading The @code{-stack-list-arguments} Command
@subheading The @code{-stack-list-arguments} Command
@findex -stack-list-arguments
@findex -stack-list-arguments
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -stack-list-arguments @var{show-values}
 -stack-list-arguments @var{show-values}
    [ @var{low-frame} @var{high-frame} ]
    [ @var{low-frame} @var{high-frame} ]
@end example
@end example
 
 
Display a list of the arguments for the frames between @var{low-frame}
Display a list of the arguments for the frames between @var{low-frame}
and @var{high-frame} (inclusive).  If @var{low-frame} and
and @var{high-frame} (inclusive).  If @var{low-frame} and
@var{high-frame} are not provided, list the arguments for the whole call
@var{high-frame} are not provided, list the arguments for the whole call
stack.
stack.
 
 
The @var{show-values} argument must have a value of 0 or 1.  A value of
The @var{show-values} 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
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.
means that both names and values of the arguments are printed.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
GDB does not have an equivalent command.  @code{gdbtk} has a
GDB does not have an equivalent command.  @code{gdbtk} has a
@samp{gdb_get_args} command which partially overlaps with the
@samp{gdb_get_args} command which partially overlaps with the
functionality of @samp{-stack-list-arguments}.
functionality of @samp{-stack-list-arguments}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-stack-list-frames
-stack-list-frames
^done,
^done,
stack=@{
stack=@{
frame=@{level="0 ",addr="0x00010734",func="callee4",
frame=@{level="0 ",addr="0x00010734",func="callee4",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
frame=@{level="1 ",addr="0x0001076c",func="callee3",
frame=@{level="1 ",addr="0x0001076c",func="callee3",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
frame=@{level="2 ",addr="0x0001078c",func="callee2",
frame=@{level="2 ",addr="0x0001078c",func="callee2",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
frame=@{level="3 ",addr="0x000107b4",func="callee1",
frame=@{level="3 ",addr="0x000107b4",func="callee1",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
frame=@{level="4 ",addr="0x000107e0",func="main",
frame=@{level="4 ",addr="0x000107e0",func="main",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}@}
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}@}
(gdb)
(gdb)
-stack-list-arguments 0
-stack-list-arguments 0
^done,
^done,
stack-args=@{
stack-args=@{
frame=@{level="0",args=@{@}@},
frame=@{level="0",args=@{@}@},
frame=@{level="1",args=@{name="strarg"@}@},
frame=@{level="1",args=@{name="strarg"@}@},
frame=@{level="2",args=@{name="intarg",name="strarg"@}@},
frame=@{level="2",args=@{name="intarg",name="strarg"@}@},
frame=@{level="3",args=@{name="intarg",name="strarg",name="fltarg"@}@},
frame=@{level="3",args=@{name="intarg",name="strarg",name="fltarg"@}@},
frame=@{level="4",args=@{@}@}@}
frame=@{level="4",args=@{@}@}@}
(gdb)
(gdb)
-stack-list-arguments 1
-stack-list-arguments 1
^done,
^done,
stack-args=@{
stack-args=@{
frame=@{level="0",args=@{@}@},
frame=@{level="0",args=@{@}@},
frame=@{level="1",
frame=@{level="1",
 args=@{@{name="strarg",value="0x11940 \"A string argument.\""@}@}@},
 args=@{@{name="strarg",value="0x11940 \"A string argument.\""@}@}@},
frame=@{level="2",args=@{
frame=@{level="2",args=@{
@{name="intarg",value="2"@},
@{name="intarg",value="2"@},
@{name="strarg",value="0x11940 \"A string argument.\""@}@}@},
@{name="strarg",value="0x11940 \"A string argument.\""@}@}@},
@{frame=@{level="3",args=@{
@{frame=@{level="3",args=@{
@{name="intarg",value="2"@},
@{name="intarg",value="2"@},
@{name="strarg",value="0x11940 \"A string argument.\""@},
@{name="strarg",value="0x11940 \"A string argument.\""@},
@{name="fltarg",value="3.5"@}@}@},
@{name="fltarg",value="3.5"@}@}@},
frame=@{level="4",args=@{@}@}@}
frame=@{level="4",args=@{@}@}@}
(gdb)
(gdb)
-stack-list-arguments 0 2 2
-stack-list-arguments 0 2 2
^done,stack-args=@{frame=@{level="2",args=@{name="intarg",name="strarg"@}@}@}
^done,stack-args=@{frame=@{level="2",args=@{name="intarg",name="strarg"@}@}@}
(gdb)
(gdb)
-stack-list-arguments 1 2 2
-stack-list-arguments 1 2 2
^done,stack-args=@{frame=@{level="2",
^done,stack-args=@{frame=@{level="2",
args=@{@{name="intarg",value="2"@},
args=@{@{name="intarg",value="2"@},
@{name="strarg",value="0x11940 \"A string argument.\""@}@}@}@}
@{name="strarg",value="0x11940 \"A string argument.\""@}@}@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@c @subheading -stack-list-exception-handlers
@c @subheading -stack-list-exception-handlers
 
 
 
 
@subheading The @code{-stack-list-frames} Command
@subheading The @code{-stack-list-frames} Command
@findex -stack-list-frames
@findex -stack-list-frames
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -stack-list-frames [ @var{low-frame} @var{high-frame} ]
 -stack-list-frames [ @var{low-frame} @var{high-frame} ]
@end example
@end example
 
 
List the frames currently on the stack.  For each frame it displays the
List the frames currently on the stack.  For each frame it displays the
following info:
following info:
 
 
@table @samp
@table @samp
@item @var{level}
@item @var{level}
The frame number, 0 being the topmost frame, i.e. the innermost function.
The frame number, 0 being the topmost frame, i.e. the innermost function.
@item @var{addr}
@item @var{addr}
The @code{$pc} value for that frame.
The @code{$pc} value for that frame.
@item @var{func}
@item @var{func}
Function name.
Function name.
@item @var{file}
@item @var{file}
File name of the source file where the function lives.
File name of the source file where the function lives.
@item @var{line}
@item @var{line}
Line number corresponding to the @code{$pc}.
Line number corresponding to the @code{$pc}.
@end table
@end table
 
 
If invoked without arguments, this command prints a backtrace for the
If invoked without arguments, this command prints a backtrace for the
whole stack.  If given two integer arguments, it shows the frames whose
whole stack.  If given two integer arguments, it shows the frames whose
levels are between the two arguments (inclusive).  If the two arguments
levels are between the two arguments (inclusive).  If the two arguments
are equal, it shows the single frame at the corresponding level.
are equal, it shows the single frame at the corresponding level.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB commands are @samp{backtrace} and @samp{where}.
The corresponding GDB commands are @samp{backtrace} and @samp{where}.
 
 
@subsubheading Example
@subsubheading Example
 
 
Full stack backtrace:
Full stack backtrace:
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-stack-list-frames
-stack-list-frames
^done,stack=
^done,stack=
@{frame=@{level="0 ",addr="0x0001076c",func="foo",
@{frame=@{level="0 ",addr="0x0001076c",func="foo",
  file="recursive2.c",line="11"@},
  file="recursive2.c",line="11"@},
frame=@{level="1 ",addr="0x000107a4",func="foo",
frame=@{level="1 ",addr="0x000107a4",func="foo",
  file="recursive2.c",line="14"@},
  file="recursive2.c",line="14"@},
frame=@{level="2 ",addr="0x000107a4",func="foo",
frame=@{level="2 ",addr="0x000107a4",func="foo",
  file="recursive2.c",line="14"@},
  file="recursive2.c",line="14"@},
frame=@{level="3 ",addr="0x000107a4",func="foo",
frame=@{level="3 ",addr="0x000107a4",func="foo",
  file="recursive2.c",line="14"@},
  file="recursive2.c",line="14"@},
frame=@{level="4 ",addr="0x000107a4",func="foo",
frame=@{level="4 ",addr="0x000107a4",func="foo",
  file="recursive2.c",line="14"@},
  file="recursive2.c",line="14"@},
frame=@{level="5 ",addr="0x000107a4",func="foo",
frame=@{level="5 ",addr="0x000107a4",func="foo",
  file="recursive2.c",line="14"@},
  file="recursive2.c",line="14"@},
frame=@{level="6 ",addr="0x000107a4",func="foo",
frame=@{level="6 ",addr="0x000107a4",func="foo",
  file="recursive2.c",line="14"@},
  file="recursive2.c",line="14"@},
frame=@{level="7 ",addr="0x000107a4",func="foo",
frame=@{level="7 ",addr="0x000107a4",func="foo",
  file="recursive2.c",line="14"@},
  file="recursive2.c",line="14"@},
frame=@{level="8 ",addr="0x000107a4",func="foo",
frame=@{level="8 ",addr="0x000107a4",func="foo",
  file="recursive2.c",line="14"@},
  file="recursive2.c",line="14"@},
frame=@{level="9 ",addr="0x000107a4",func="foo",
frame=@{level="9 ",addr="0x000107a4",func="foo",
  file="recursive2.c",line="14"@},
  file="recursive2.c",line="14"@},
frame=@{level="10",addr="0x000107a4",func="foo",
frame=@{level="10",addr="0x000107a4",func="foo",
  file="recursive2.c",line="14"@},
  file="recursive2.c",line="14"@},
frame=@{level="11",addr="0x00010738",func="main",
frame=@{level="11",addr="0x00010738",func="main",
  file="recursive2.c",line="4"@}@}
  file="recursive2.c",line="4"@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
Show frames between low_frame and high_frame:
Show frames between low_frame and high_frame:
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-stack-list-frames 3 5
-stack-list-frames 3 5
^done,stack=
^done,stack=
@{frame=@{level="3 ",addr="0x000107a4",func="foo",
@{frame=@{level="3 ",addr="0x000107a4",func="foo",
  file="recursive2.c",line="14"@},
  file="recursive2.c",line="14"@},
frame=@{level="4 ",addr="0x000107a4",func="foo",
frame=@{level="4 ",addr="0x000107a4",func="foo",
  file="recursive2.c",line="14"@},
  file="recursive2.c",line="14"@},
frame=@{level="5 ",addr="0x000107a4",func="foo",
frame=@{level="5 ",addr="0x000107a4",func="foo",
  file="recursive2.c",line="14"@}@}
  file="recursive2.c",line="14"@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
Show a single frame:
Show a single frame:
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-stack-list-frames 3 3
-stack-list-frames 3 3
^done,stack=
^done,stack=
@{frame=@{level="3 ",addr="0x000107a4",func="foo",
@{frame=@{level="3 ",addr="0x000107a4",func="foo",
  file="recursive2.c",line="14"@}@}
  file="recursive2.c",line="14"@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-stack-list-locals} Command
@subheading The @code{-stack-list-locals} Command
@findex -stack-list-locals
@findex -stack-list-locals
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -stack-list-locals @var{print-values}
 -stack-list-locals @var{print-values}
@end example
@end example
 
 
Display the local variable names for the current frame.  With an
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
argument of 0 prints only the names of the variables, with argument of 1
prints also their values.
prints also their values.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
@samp{info locals} in GDB, @samp{gdb_get_locals} in @code{gdbtk}.
@samp{info locals} in GDB, @samp{gdb_get_locals} in @code{gdbtk}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-stack-list-locals 0
-stack-list-locals 0
^done,locals=@{name="A",name="B",name="C"@}
^done,locals=@{name="A",name="B",name="C"@}
(gdb)
(gdb)
-stack-list-locals 1
-stack-list-locals 1
^done,locals=@{@{name="A",value="1"@},@{name="B",value="2"@},
^done,locals=@{@{name="A",value="1"@},@{name="B",value="2"@},
  @{name="C",value="3"@}@}
  @{name="C",value="3"@}@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-stack-select-frame} Command
@subheading The @code{-stack-select-frame} Command
@findex -stack-select-frame
@findex -stack-select-frame
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -stack-select-frame @var{framenum}
 -stack-select-frame @var{framenum}
@end example
@end example
 
 
Change the current frame.  Select a different frame @var{framenum} on
Change the current frame.  Select a different frame @var{framenum} on
the stack.
the stack.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB commands are @samp{frame}, @samp{up}, @samp{down},
The corresponding GDB commands are @samp{frame}, @samp{up}, @samp{down},
@samp{select-frame}, @samp{up-silent}, and @samp{down-silent}.
@samp{select-frame}, @samp{up-silent}, and @samp{down-silent}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-stack-select-frame 2
-stack-select-frame 2
^done
^done
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Symbol Query
@node GDB/MI Symbol Query
@section @sc{gdb/mi} Symbol Query Commands
@section @sc{gdb/mi} Symbol Query Commands
 
 
 
 
@subheading The @code{-symbol-info-address} Command
@subheading The @code{-symbol-info-address} Command
@findex -symbol-info-address
@findex -symbol-info-address
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -symbol-info-address @var{symbol}
 -symbol-info-address @var{symbol}
@end example
@end example
 
 
Describe where @var{symbol} is stored.
Describe where @var{symbol} is stored.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{info address}.
The corresponding GDB command is @samp{info address}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-symbol-info-file} Command
@subheading The @code{-symbol-info-file} Command
@findex -symbol-info-file
@findex -symbol-info-file
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -symbol-info-file
 -symbol-info-file
@end example
@end example
 
 
Show the file for the symbol.
Show the file for the symbol.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
There's no equivalent GDB command.  @code{gdbtk} has
There's no equivalent GDB command.  @code{gdbtk} has
@samp{gdb_filnd_file}.
@samp{gdb_filnd_file}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-symbol-info-function} Command
@subheading The @code{-symbol-info-function} Command
@findex -symbol-info-function
@findex -symbol-info-function
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -symbol-info-function
 -symbol-info-function
@end example
@end example
 
 
Show which function the symbol lives in.
Show which function the symbol lives in.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
@samp{gdb_get_function} in @code{gdbtk}.
@samp{gdb_get_function} in @code{gdbtk}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-symbol-info-line} Command
@subheading The @code{-symbol-info-line} Command
@findex -symbol-info-line
@findex -symbol-info-line
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -symbol-info-line
 -symbol-info-line
@end example
@end example
 
 
Show the core addresses of the code for a source line.
Show the core addresses of the code for a source line.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB comamnd is @samp{info line}.  @code{gdbtk} has the
The corresponding GDB comamnd is @samp{info line}.  @code{gdbtk} has the
@samp{gdb_get_line} @samp{gdb_get_file} commands.
@samp{gdb_get_line} @samp{gdb_get_file} commands.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-symbol-info-symbol} Command
@subheading The @code{-symbol-info-symbol} Command
@findex -symbol-info-symbol
@findex -symbol-info-symbol
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -symbol-info-symbol @var{addr}
 -symbol-info-symbol @var{addr}
@end example
@end example
 
 
Describe what symbol is at location @var{addr}.
Describe what symbol is at location @var{addr}.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{info symbol}.
The corresponding GDB command is @samp{info symbol}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-symbol-list-functions} Command
@subheading The @code{-symbol-list-functions} Command
@findex -symbol-list-functions
@findex -symbol-list-functions
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -symbol-list-functions
 -symbol-list-functions
@end example
@end example
 
 
List the functions in the executable.
List the functions in the executable.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
@samp{info functions} in GDB, @samp{gdb_listfunc} @samp{gdb_search} in
@samp{info functions} in GDB, @samp{gdb_listfunc} @samp{gdb_search} in
@code{gdbtk}.
@code{gdbtk}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-symbol-list-types} Command
@subheading The @code{-symbol-list-types} Command
@findex -symbol-list-types
@findex -symbol-list-types
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -symbol-list-types
 -symbol-list-types
@end example
@end example
 
 
List all the type names.
List all the type names.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding commands are @samp{info types} in GDB,
The corresponding commands are @samp{info types} in GDB,
@samp{gdb_search} in @code{gdbtk}.
@samp{gdb_search} in @code{gdbtk}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-symbol-list-variables} Command
@subheading The @code{-symbol-list-variables} Command
@findex -symbol-list-variables
@findex -symbol-list-variables
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -symbol-list-variables
 -symbol-list-variables
@end example
@end example
 
 
List all the global and static variable names.
List all the global and static variable names.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
@samp{info variables} in GDB, @samp{gdb_search} in @code{gdbtk}.
@samp{info variables} in GDB, @samp{gdb_search} in @code{gdbtk}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-symbol-locate} Command
@subheading The @code{-symbol-locate} Command
@findex -symbol-locate
@findex -symbol-locate
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -symbol-locate
 -symbol-locate
@end example
@end example
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
@samp{gdb_loc} in @code{gdbtk}.
@samp{gdb_loc} in @code{gdbtk}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-symbol-type} Command
@subheading The @code{-symbol-type} Command
@findex -symbol-type
@findex -symbol-type
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -symbol-type @var{variable}
 -symbol-type @var{variable}
@end example
@end example
 
 
Show type of @var{variable}.
Show type of @var{variable}.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{ptype}, @code{gdbtk} has
The corresponding GDB command is @samp{ptype}, @code{gdbtk} has
@samp{gdb_obj_variable}.
@samp{gdb_obj_variable}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Target Manipulation
@node GDB/MI Target Manipulation
@section @sc{gdb/mi} Target Manipulation Commands
@section @sc{gdb/mi} Target Manipulation Commands
 
 
 
 
@subheading The @code{-target-attach} Command
@subheading The @code{-target-attach} Command
@findex -target-attach
@findex -target-attach
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -target-attach @var{pid} | @var{file}
 -target-attach @var{pid} | @var{file}
@end example
@end example
 
 
Attach to a process @var{pid} or a file @var{file} outside of GDB.
Attach to a process @var{pid} or a file @var{file} outside of GDB.
 
 
@subsubheading GDB command
@subsubheading GDB command
 
 
The corresponding GDB command is @samp{attach}.
The corresponding GDB command is @samp{attach}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-target-compare-sections} Command
@subheading The @code{-target-compare-sections} Command
@findex -target-compare-sections
@findex -target-compare-sections
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -target-compare-sections [ @var{section} ]
 -target-compare-sections [ @var{section} ]
@end example
@end example
 
 
Compare data of section @var{section} on target to the exec file.
Compare data of section @var{section} on target to the exec file.
Without the argument, all sections are compared.
Without the argument, all sections are compared.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The GDB equivalent is @samp{compare-sections}.
The GDB equivalent is @samp{compare-sections}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-target-detach} Command
@subheading The @code{-target-detach} Command
@findex -target-detach
@findex -target-detach
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -target-detach
 -target-detach
@end example
@end example
 
 
Disconnect from the remote target.  There's no output.
Disconnect from the remote target.  There's no output.
 
 
@subsubheading GDB command
@subsubheading GDB command
 
 
The corresponding GDB command is @samp{detach}.
The corresponding GDB command is @samp{detach}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-target-detach
-target-detach
^done
^done
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-target-download} Command
@subheading The @code{-target-download} Command
@findex -target-download
@findex -target-download
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -target-download
 -target-download
@end example
@end example
 
 
Loads the executable onto the remote target.
Loads the executable onto the remote target.
It prints out an update message every half second, which includes the fields:
It prints out an update message every half second, which includes the fields:
 
 
@table @samp
@table @samp
@item section
@item section
The name of the section.
The name of the section.
@item section-sent
@item section-sent
The size of what has been sent so far for that section.
The size of what has been sent so far for that section.
@item section-size
@item section-size
The size of the section.
The size of the section.
@item total-sent
@item total-sent
The total size of what was sent so far (the current and the previous sections).
The total size of what was sent so far (the current and the previous sections).
@item total-size
@item total-size
The size of the overall executable to download.
The size of the overall executable to download.
@end table
@end table
 
 
@noindent
@noindent
Each message is sent as status record (@pxref{GDB/MI Output Syntax, ,
Each message is sent as status record (@pxref{GDB/MI Output Syntax, ,
@sc{gdb/mi} Output Syntax}).
@sc{gdb/mi} Output Syntax}).
 
 
In addition, it prints the name and size of the sections, as they are
In addition, it prints the name and size of the sections, as they are
downloaded.  These messages include the following fields:
downloaded.  These messages include the following fields:
 
 
@table @samp
@table @samp
@item section
@item section
The name of the section.
The name of the section.
@item section-size
@item section-size
The size of the section.
The size of the section.
@item total-size
@item total-size
The size of the overall executable to download.
The size of the overall executable to download.
@end table
@end table
 
 
@noindent
@noindent
At the end,  a summary is printed.
At the end,  a summary is printed.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{load}.
The corresponding GDB command is @samp{load}.
 
 
@subsubheading Example
@subsubheading Example
 
 
Note: each status message appears on a single line.  Here the messages
Note: each status message appears on a single line.  Here the messages
have been broken down so that they can fit onto a page.
have been broken down so that they can fit onto a page.
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-target-download
-target-download
+download,@{section=".text",section-size="6668",total-size="9880"@}
+download,@{section=".text",section-size="6668",total-size="9880"@}
+download,@{section=".text",section-sent="512",section-size="6668",
+download,@{section=".text",section-sent="512",section-size="6668",
total-sent="512",total-size="9880"@}
total-sent="512",total-size="9880"@}
+download,@{section=".text",section-sent="1024",section-size="6668",
+download,@{section=".text",section-sent="1024",section-size="6668",
total-sent="1024",total-size="9880"@}
total-sent="1024",total-size="9880"@}
+download,@{section=".text",section-sent="1536",section-size="6668",
+download,@{section=".text",section-sent="1536",section-size="6668",
total-sent="1536",total-size="9880"@}
total-sent="1536",total-size="9880"@}
+download,@{section=".text",section-sent="2048",section-size="6668",
+download,@{section=".text",section-sent="2048",section-size="6668",
total-sent="2048",total-size="9880"@}
total-sent="2048",total-size="9880"@}
+download,@{section=".text",section-sent="2560",section-size="6668",
+download,@{section=".text",section-sent="2560",section-size="6668",
total-sent="2560",total-size="9880"@}
total-sent="2560",total-size="9880"@}
+download,@{section=".text",section-sent="3072",section-size="6668",
+download,@{section=".text",section-sent="3072",section-size="6668",
total-sent="3072",total-size="9880"@}
total-sent="3072",total-size="9880"@}
+download,@{section=".text",section-sent="3584",section-size="6668",
+download,@{section=".text",section-sent="3584",section-size="6668",
total-sent="3584",total-size="9880"@}
total-sent="3584",total-size="9880"@}
+download,@{section=".text",section-sent="4096",section-size="6668",
+download,@{section=".text",section-sent="4096",section-size="6668",
total-sent="4096",total-size="9880"@}
total-sent="4096",total-size="9880"@}
+download,@{section=".text",section-sent="4608",section-size="6668",
+download,@{section=".text",section-sent="4608",section-size="6668",
total-sent="4608",total-size="9880"@}
total-sent="4608",total-size="9880"@}
+download,@{section=".text",section-sent="5120",section-size="6668",
+download,@{section=".text",section-sent="5120",section-size="6668",
total-sent="5120",total-size="9880"@}
total-sent="5120",total-size="9880"@}
+download,@{section=".text",section-sent="5632",section-size="6668",
+download,@{section=".text",section-sent="5632",section-size="6668",
total-sent="5632",total-size="9880"@}
total-sent="5632",total-size="9880"@}
+download,@{section=".text",section-sent="6144",section-size="6668",
+download,@{section=".text",section-sent="6144",section-size="6668",
total-sent="6144",total-size="9880"@}
total-sent="6144",total-size="9880"@}
+download,@{section=".text",section-sent="6656",section-size="6668",
+download,@{section=".text",section-sent="6656",section-size="6668",
total-sent="6656",total-size="9880"@}
total-sent="6656",total-size="9880"@}
+download,@{section=".init",section-size="28",total-size="9880"@}
+download,@{section=".init",section-size="28",total-size="9880"@}
+download,@{section=".fini",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-size="3156",total-size="9880"@}
+download,@{section=".data",section-sent="512",section-size="3156",
+download,@{section=".data",section-sent="512",section-size="3156",
total-sent="7236",total-size="9880"@}
total-sent="7236",total-size="9880"@}
+download,@{section=".data",section-sent="1024",section-size="3156",
+download,@{section=".data",section-sent="1024",section-size="3156",
total-sent="7748",total-size="9880"@}
total-sent="7748",total-size="9880"@}
+download,@{section=".data",section-sent="1536",section-size="3156",
+download,@{section=".data",section-sent="1536",section-size="3156",
total-sent="8260",total-size="9880"@}
total-sent="8260",total-size="9880"@}
+download,@{section=".data",section-sent="2048",section-size="3156",
+download,@{section=".data",section-sent="2048",section-size="3156",
total-sent="8772",total-size="9880"@}
total-sent="8772",total-size="9880"@}
+download,@{section=".data",section-sent="2560",section-size="3156",
+download,@{section=".data",section-sent="2560",section-size="3156",
total-sent="9284",total-size="9880"@}
total-sent="9284",total-size="9880"@}
+download,@{section=".data",section-sent="3072",section-size="3156",
+download,@{section=".data",section-sent="3072",section-size="3156",
total-sent="9796",total-size="9880"@}
total-sent="9796",total-size="9880"@}
^done,address="0x10004",load-size="9880",transfer-rate="6586",
^done,address="0x10004",load-size="9880",transfer-rate="6586",
write-rate="429"
write-rate="429"
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-target-exec-status} Command
@subheading The @code{-target-exec-status} Command
@findex -target-exec-status
@findex -target-exec-status
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -target-exec-status
 -target-exec-status
@end example
@end example
 
 
Provide information on the state of the target (whether it is running or
Provide information on the state of the target (whether it is running or
not, for instance).
not, for instance).
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
There's no equivalent GDB command.
There's no equivalent GDB command.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-target-list-available-targets} Command
@subheading The @code{-target-list-available-targets} Command
@findex -target-list-available-targets
@findex -target-list-available-targets
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -target-list-available-targets
 -target-list-available-targets
@end example
@end example
 
 
List the possible targets to connect to.
List the possible targets to connect to.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{help target}.
The corresponding GDB command is @samp{help target}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-target-list-current-targets} Command
@subheading The @code{-target-list-current-targets} Command
@findex -target-list-current-targets
@findex -target-list-current-targets
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -target-list-current-targets
 -target-list-current-targets
@end example
@end example
 
 
Describe the current target.
Describe the current target.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding information is printed by @samp{info file} (among
The corresponding information is printed by @samp{info file} (among
other things).
other things).
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-target-list-parameters} Command
@subheading The @code{-target-list-parameters} Command
@findex -target-list-parameters
@findex -target-list-parameters
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -target-list-parameters
 -target-list-parameters
@end example
@end example
 
 
@c ????
@c ????
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
No equivalent.
No equivalent.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-target-select} Command
@subheading The @code{-target-select} Command
@findex -target-select
@findex -target-select
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -target-select @var{type} @var{parameters ...}
 -target-select @var{type} @var{parameters ...}
@end example
@end example
 
 
Connect GDB to the remote target.  This command takes two args:
Connect GDB to the remote target.  This command takes two args:
 
 
@table @samp
@table @samp
@item @var{type}
@item @var{type}
The type of target, for instance @samp{async}, @samp{remote}, etc.
The type of target, for instance @samp{async}, @samp{remote}, etc.
@item @var{parameters}
@item @var{parameters}
Device names, host names and the like.  @xref{Target Commands, ,
Device names, host names and the like.  @xref{Target Commands, ,
Commands for managing targets}, for more details.
Commands for managing targets}, for more details.
@end table
@end table
 
 
The output is a connection notification, followed by the address at
The output is a connection notification, followed by the address at
which the target program is, in the following form:
which the target program is, in the following form:
 
 
@smallexample
@smallexample
^connected,addr="@var{address}",func="@var{function name}",
^connected,addr="@var{address}",func="@var{function name}",
  args=@{@var{arg list}@}
  args=@{@var{arg list}@}
@end smallexample
@end smallexample
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{target}.
The corresponding GDB command is @samp{target}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-target-select async /dev/ttya
-target-select async /dev/ttya
^connected,addr="0xfe00a300",func="??",args=@{@}
^connected,addr="0xfe00a300",func="??",args=@{@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Thread Commands
@node GDB/MI Thread Commands
@section @sc{gdb/mi} Thread Commands
@section @sc{gdb/mi} Thread Commands
 
 
 
 
@subheading The @code{-thread-info} Command
@subheading The @code{-thread-info} Command
@findex -thread-info
@findex -thread-info
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -thread-info
 -thread-info
@end example
@end example
 
 
@subsubheading GDB command
@subsubheading GDB command
 
 
No equivalent.
No equivalent.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-thread-list-all-threads} Command
@subheading The @code{-thread-list-all-threads} Command
@findex -thread-list-all-threads
@findex -thread-list-all-threads
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -thread-list-all-threads
 -thread-list-all-threads
@end example
@end example
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The equivalent GDB command is @samp{info threads}.
The equivalent GDB command is @samp{info threads}.
 
 
@subsubheading Example
@subsubheading Example
N.A.
N.A.
 
 
 
 
@subheading The @code{-thread-list-ids} Command
@subheading The @code{-thread-list-ids} Command
@findex -thread-list-ids
@findex -thread-list-ids
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -thread-list-ids
 -thread-list-ids
@end example
@end example
 
 
Produces a list of the currently known gdb thread ids.  At the end of the
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.
list it also prints the total number of such threads.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
Part of @samp{info threads} supplies the same information.
Part of @samp{info threads} supplies the same information.
 
 
@subsubheading Example
@subsubheading Example
 
 
No threads present, besides the main process.
No threads present, besides the main process.
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-thread-list-ids
-thread-list-ids
^done,thread-ids=@{@},number-of-threads="0"
^done,thread-ids=@{@},number-of-threads="0"
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
Several threads.
Several threads.
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-thread-list-ids
-thread-list-ids
^done,thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
^done,thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
number-of-threads="3"
number-of-threads="3"
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
 
 
@subheading The @code{-thread-select} Command
@subheading The @code{-thread-select} Command
@findex -thread-select
@findex -thread-select
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -thread-select @var{threadnum}
 -thread-select @var{threadnum}
@end example
@end example
 
 
Make @var{threadnum} the current thread.  It prints the number of the new
Make @var{threadnum} the current thread.  It prints the number of the new
current thread, and the topmost frame for that thread.
current thread, and the topmost frame for that thread.
 
 
@subsubheading GDB Command
@subsubheading GDB Command
 
 
The corresponding GDB command is @samp{thread}.
The corresponding GDB command is @samp{thread}.
 
 
@subsubheading Example
@subsubheading Example
 
 
@smallexample
@smallexample
(gdb)
(gdb)
-exec-next
-exec-next
^running
^running
(gdb)
(gdb)
*stopped,reason="end-stepping-range",thread-id="2",line="187",
*stopped,reason="end-stepping-range",thread-id="2",line="187",
file="../../../devo/gdb/testsuite/gdb.threads/linux-dp.c"
file="../../../devo/gdb/testsuite/gdb.threads/linux-dp.c"
(gdb)
(gdb)
-thread-list-ids
-thread-list-ids
^done,
^done,
thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
number-of-threads="3"
number-of-threads="3"
(gdb)
(gdb)
-thread-select 3
-thread-select 3
^done,new-thread-id="3",
^done,new-thread-id="3",
frame=@{level="0 ",func="vprintf",
frame=@{level="0 ",func="vprintf",
args=@{@{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""@},
args=@{@{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""@},
@{name="arg",value="0x2"@}@},file="vprintf.c",line="31"@}
@{name="arg",value="0x2"@}@},file="vprintf.c",line="31"@}
(gdb)
(gdb)
@end smallexample
@end smallexample
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Tracepoint Commands
@node GDB/MI Tracepoint Commands
@section @sc{gdb/mi} Tracepoint Commands
@section @sc{gdb/mi} Tracepoint Commands
 
 
The tracepoint commands are not yet implemented.
The tracepoint commands are not yet implemented.
 
 
@c @subheading -trace-actions
@c @subheading -trace-actions
 
 
@c @subheading -trace-delete
@c @subheading -trace-delete
 
 
@c @subheading -trace-disable
@c @subheading -trace-disable
 
 
@c @subheading -trace-dump
@c @subheading -trace-dump
 
 
@c @subheading -trace-enable
@c @subheading -trace-enable
 
 
@c @subheading -trace-exists
@c @subheading -trace-exists
 
 
@c @subheading -trace-find
@c @subheading -trace-find
 
 
@c @subheading -trace-frame-number
@c @subheading -trace-frame-number
 
 
@c @subheading -trace-info
@c @subheading -trace-info
 
 
@c @subheading -trace-insert
@c @subheading -trace-insert
 
 
@c @subheading -trace-list
@c @subheading -trace-list
 
 
@c @subheading -trace-pass-count
@c @subheading -trace-pass-count
 
 
@c @subheading -trace-save
@c @subheading -trace-save
 
 
@c @subheading -trace-start
@c @subheading -trace-start
 
 
@c @subheading -trace-stop
@c @subheading -trace-stop
 
 
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Variable Objects
@node GDB/MI Variable Objects
@section @sc{gdb/mi} Variable Objects
@section @sc{gdb/mi} Variable Objects
 
 
 
 
@subheading Motivation for Variable Objects in @sc{gdb/mi}
@subheading Motivation for Variable Objects in @sc{gdb/mi}
 
 
For the implementation of a variable debugger window (locals, watched
For the implementation of a variable debugger window (locals, watched
expressions, etc.), we are proposing the adaptation of the existing code
expressions, etc.), we are proposing the adaptation of the existing code
used by @code{Insight}.
used by @code{Insight}.
 
 
The two main reasons for that are:
The two main reasons for that are:
 
 
@enumerate 1
@enumerate 1
@item
@item
It has been proven in practice (it is already on its second generation).
It has been proven in practice (it is already on its second generation).
 
 
@item
@item
It will shorten development time (needless to say how important it is
It will shorten development time (needless to say how important it is
now).
now).
@end enumerate
@end enumerate
 
 
The original interface was designed to be used by Tcl code, so it was
The original interface was designed to be used by Tcl code, so it was
slightly changed so it could be used through flathead.  This document
slightly changed so it could be used through flathead.  This document
describes the flathead operations that will be available and gives some
describes the flathead operations that will be available and gives some
hints about their use.
hints about their use.
 
 
@emph{Note}: In addition to the set of operations described here, we
@emph{Note}: In addition to the set of operations described here, we
expect the @sc{gui} implementation of a variable window to require, at
expect the @sc{gui} implementation of a variable window to require, at
least, the following operations:
least, the following operations:
 
 
@itemize @bullet
@itemize @bullet
@item -gdb-show output-radix
@item -gdb-show output-radix
@item -stack-list-arguments
@item -stack-list-arguments
@item -stack-list-locals
@item -stack-list-locals
@item -stack-select-frame
@item -stack-select-frame
@end itemize
@end itemize
 
 
@subheading Introduction to Variable Objects in @sc{gdb/mi}
@subheading Introduction to Variable Objects in @sc{gdb/mi}
 
 
@cindex variable objects in @sc{gdb/mi}
@cindex variable objects in @sc{gdb/mi}
The basic idea behind variable objects is the creation of a named object
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
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
register.  For each object created, a set of operations is available for
examining or changing its properties.
examining or changing its properties.
 
 
Furthermore, complex data types, such as C structures, are represented
Furthermore, complex data types, such as C structures, are represented
in a tree format.  For instance, the @code{struct} type variable is the
in a tree format.  For instance, the @code{struct} type variable is the
root and the children will represent the struct members.  If a child
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.
is itself of a complex type, it will also have children of its own.
Appropriate language differences are handled for C, C@t{++} and Java.
Appropriate language differences are handled for C, C@t{++} and Java.
 
 
When returning the actual values of the objects, this facility allows
When returning the actual values of the objects, this facility allows
for the individual selection of the display format used in the result
for the individual selection of the display format used in the result
creation.  It can be chosen among: binary, decimal, hexadecimal, octal
creation.  It can be chosen among: binary, decimal, hexadecimal, octal
and natural.  Natural refers to a default format automatically
and natural.  Natural refers to a default format automatically
chosen based on the variable type (like decimal for an @code{int}, hex
chosen based on the variable type (like decimal for an @code{int}, hex
for pointers, etc.).
for pointers, etc.).
 
 
The following is the complete set of flathead operations defined to
The following is the complete set of flathead operations defined to
access this functionality:
access this functionality:
 
 
@multitable @columnfractions .3 .6
@multitable @columnfractions .3 .6
@item @strong{Operation}
@item @strong{Operation}
@tab @strong{Description}
@tab @strong{Description}
 
 
@item -var-create
@item -var-create
@tab create a variable object
@tab create a variable object
@item -var-delete
@item -var-delete
@tab delete the variable object and its children
@tab delete the variable object and its children
@item -var-set-format
@item -var-set-format
@tab set the display format of this variable
@tab set the display format of this variable
@item -var-show-format
@item -var-show-format
@tab show the display format of this variable
@tab show the display format of this variable
@item -var-info-num-children
@item -var-info-num-children
@tab tells how many children this object has
@tab tells how many children this object has
@item -var-list-children
@item -var-list-children
@tab return a list of the object's children
@tab return a list of the object's children
@item -var-info-type
@item -var-info-type
@tab show the type of this variable object
@tab show the type of this variable object
@item -var-info-expression
@item -var-info-expression
@tab print what this variable object represents
@tab print what this variable object represents
@item -var-show-attributes
@item -var-show-attributes
@tab is this variable editable? does it exist here?
@tab is this variable editable? does it exist here?
@item -var-evaluate-expression
@item -var-evaluate-expression
@tab get the value of this variable
@tab get the value of this variable
@item -var-assign
@item -var-assign
@tab set the value of this variable
@tab set the value of this variable
@item -var-update
@item -var-update
@tab update the variable and its children
@tab update the variable and its children
@end multitable
@end multitable
 
 
In the next subsection we describe each operation in detail and suggest
In the next subsection we describe each operation in detail and suggest
how it can be used.
how it can be used.
 
 
@subheading Description And Use of Operations on Variable Objects
@subheading Description And Use of Operations on Variable Objects
 
 
@subheading The @code{-var-create} Command
@subheading The @code{-var-create} Command
@findex -var-create
@findex -var-create
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -var-create @{@var{name} | "-"@}
 -var-create @{@var{name} | "-"@}
    @{@var{frame-addr} | "*"@} @var{expression}
    @{@var{frame-addr} | "*"@} @var{expression}
@end example
@end example
 
 
This operation creates a variable object, which allows the monitoring of
This operation creates a variable object, which allows the monitoring of
a variable, the result of an expression, a memory cell or a CPU
a variable, the result of an expression, a memory cell or a CPU
register.
register.
 
 
The @var{name} parameter is the string by which the object can be
The @var{name} parameter is the string by which the object can be
referenced.  It must be unique.  If @samp{-} is specified, the varobj
referenced.  It must be unique.  If @samp{-} is specified, the varobj
system will generate a string "varNNNNNN'' automatically.  It will be
system will generate a string "varNNNNNN'' automatically.  It will be
unique provided that one does not specify @var{name} on that format.
unique provided that one does not specify @var{name} on that format.
The command fails if a duplicate name is found.
The command fails if a duplicate name is found.
 
 
The frame under which the expression should be evaluated can be
The frame under which the expression should be evaluated can be
specified by @var{frame-addr}.  A @samp{*} indicates that the current
specified by @var{frame-addr}.  A @samp{*} indicates that the current
frame should be used.
frame should be used.
 
 
@var{expression} is any expression valid on the current language set (must not
@var{expression} is any expression valid on the current language set (must not
begin with a @samp{*}), or one of the following:
begin with a @samp{*}), or one of the following:
 
 
@itemize @bullet
@itemize @bullet
@item
@item
@samp{*@var{addr}}, where @var{addr} is the address of a memory cell
@samp{*@var{addr}}, where @var{addr} is the address of a memory cell
 
 
@item
@item
@samp{*@var{addr}-@var{addr}} -- a memory address range (TBD)
@samp{*@var{addr}-@var{addr}} -- a memory address range (TBD)
 
 
@item
@item
@samp{$@var{regname}} -- a CPU register name
@samp{$@var{regname}} -- a CPU register name
@end itemize
@end itemize
 
 
@subsubheading Result
@subsubheading Result
 
 
This operation returns the name, number of children and the type of the
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
object created.  Type is returned as a string as the ones generated by
the GDB CLI:
the GDB CLI:
 
 
@example
@example
 name="@var{name}",numchild="N",type="@var{type}"
 name="@var{name}",numchild="N",type="@var{type}"
@end example
@end example
 
 
 
 
@subheading The @code{-var-delete} Command
@subheading The @code{-var-delete} Command
@findex -var-delete
@findex -var-delete
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -var-delete @var{name}
 -var-delete @var{name}
@end example
@end example
 
 
Deletes a previously created variable object and all of its children.
Deletes a previously created variable object and all of its children.
 
 
Returns an error if the object @var{name} is not found.
Returns an error if the object @var{name} is not found.
 
 
 
 
@subheading The @code{-var-set-format} Command
@subheading The @code{-var-set-format} Command
@findex -var-set-format
@findex -var-set-format
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -var-set-format @var{name} @var{format-spec}
 -var-set-format @var{name} @var{format-spec}
@end example
@end example
 
 
Sets the output format for the value of the object @var{name} to be
Sets the output format for the value of the object @var{name} to be
@var{format-spec}.
@var{format-spec}.
 
 
The syntax for the @var{format-spec} is as follows:
The syntax for the @var{format-spec} is as follows:
 
 
@example
@example
 @var{format-spec} @expansion{}
 @var{format-spec} @expansion{}
 @{binary | decimal | hexadecimal | octal | natural@}
 @{binary | decimal | hexadecimal | octal | natural@}
@end example
@end example
 
 
 
 
@subheading The @code{-var-show-format} Command
@subheading The @code{-var-show-format} Command
@findex -var-show-format
@findex -var-show-format
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -var-show-format @var{name}
 -var-show-format @var{name}
@end example
@end example
 
 
Returns the format used to display the value of the object @var{name}.
Returns the format used to display the value of the object @var{name}.
 
 
@example
@example
 format @expansion{}
 format @expansion{}
 @var{format-spec}
 @var{format-spec}
@end example
@end example
 
 
 
 
@subheading The @code{-var-info-num-children} Command
@subheading The @code{-var-info-num-children} Command
@findex -var-info-num-children
@findex -var-info-num-children
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -var-info-num-children @var{name}
 -var-info-num-children @var{name}
@end example
@end example
 
 
Returns the number of children of a variable object @var{name}:
Returns the number of children of a variable object @var{name}:
 
 
@example
@example
 numchild=@var{n}
 numchild=@var{n}
@end example
@end example
 
 
 
 
@subheading The @code{-var-list-children} Command
@subheading The @code{-var-list-children} Command
@findex -var-list-children
@findex -var-list-children
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -var-list-children @var{name}
 -var-list-children @var{name}
@end example
@end example
 
 
Returns a list of the children of the specified variable object:
Returns a list of the children of the specified variable object:
 
 
@example
@example
 numchild=@var{n},children=@{@{name=@var{name},
 numchild=@var{n},children=@{@{name=@var{name},
 numchild=@var{n},type=@var{type}@},(repeats N times)@}
 numchild=@var{n},type=@var{type}@},(repeats N times)@}
@end example
@end example
 
 
 
 
@subheading The @code{-var-info-type} Command
@subheading The @code{-var-info-type} Command
@findex -var-info-type
@findex -var-info-type
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -var-info-type @var{name}
 -var-info-type @var{name}
@end example
@end example
 
 
Returns the type of the specified variable @var{name}.  The type is
Returns the type of the specified variable @var{name}.  The type is
returned as a string in the same format as it is output by the GDB CLI:
returned as a string in the same format as it is output by the GDB CLI:
 
 
@example
@example
 type=@var{typename}
 type=@var{typename}
@end example
@end example
 
 
 
 
@subheading The @code{-var-info-expression} Command
@subheading The @code{-var-info-expression} Command
@findex -var-info-expression
@findex -var-info-expression
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -var-info-expression @var{name}
 -var-info-expression @var{name}
@end example
@end example
 
 
Returns what is represented by the variable object @var{name}:
Returns what is represented by the variable object @var{name}:
 
 
@example
@example
 lang=@var{lang-spec},exp=@var{expression}
 lang=@var{lang-spec},exp=@var{expression}
@end example
@end example
 
 
@noindent
@noindent
where @var{lang-spec} is @code{@{"C" | "C++" | "Java"@}}.
where @var{lang-spec} is @code{@{"C" | "C++" | "Java"@}}.
 
 
@subheading The @code{-var-show-attributes} Command
@subheading The @code{-var-show-attributes} Command
@findex -var-show-attributes
@findex -var-show-attributes
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -var-show-attributes @var{name}
 -var-show-attributes @var{name}
@end example
@end example
 
 
List attributes of the specified variable object @var{name}:
List attributes of the specified variable object @var{name}:
 
 
@example
@example
 status=@var{attr} [ ( ,@var{attr} )* ]
 status=@var{attr} [ ( ,@var{attr} )* ]
@end example
@end example
 
 
@noindent
@noindent
where @var{attr} is @code{@{ @{ editable | noneditable @} | TBD @}}.
where @var{attr} is @code{@{ @{ editable | noneditable @} | TBD @}}.
 
 
@subheading The @code{-var-evaluate-expression} Command
@subheading The @code{-var-evaluate-expression} Command
@findex -var-evaluate-expression
@findex -var-evaluate-expression
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -var-evaluate-expression @var{name}
 -var-evaluate-expression @var{name}
@end example
@end example
 
 
Evaluates the expression that is represented by the specified variable
Evaluates the expression that is represented by the specified variable
object and returns its value as a string in the current format specified
object and returns its value as a string in the current format specified
for the object:
for the object:
 
 
@example
@example
 value=@var{value}
 value=@var{value}
@end example
@end example
 
 
@subheading The @code{-var-assign} Command
@subheading The @code{-var-assign} Command
@findex -var-assign
@findex -var-assign
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -var-assign @var{name} @var{expression}
 -var-assign @var{name} @var{expression}
@end example
@end example
 
 
Assigns the value of @var{expression} to the variable object specified
Assigns the value of @var{expression} to the variable object specified
by @var{name}.  The object must be ``editable''.
by @var{name}.  The object must be ``editable''.
 
 
@subheading The @code{-var-update} Command
@subheading The @code{-var-update} Command
@findex -var-update
@findex -var-update
 
 
@subsubheading Synopsis
@subsubheading Synopsis
 
 
@example
@example
 -var-update @{@var{name} | "*"@}
 -var-update @{@var{name} | "*"@}
@end example
@end example
 
 
Update the value of the variable object @var{name} by evaluating its
Update the value of the variable object @var{name} by evaluating its
expression after fetching all the new values from memory or registers.
expression after fetching all the new values from memory or registers.
A @samp{*} causes all existing variable objects to be updated.
A @samp{*} causes all existing variable objects to be updated.
 
 
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Draft Changes to Output Syntax
@node GDB/MI Draft Changes to Output Syntax
@section  @sc{gdb/mi} Draft Changes to Output Syntax
@section  @sc{gdb/mi} Draft Changes to Output Syntax
 
 
@cindex draft changes to output syntax of @sc{gdb/mi}
@cindex draft changes to output syntax of @sc{gdb/mi}
@cindex @sc{gdb/mi}, draft changes to output syntax
@cindex @sc{gdb/mi}, draft changes to output syntax
 
 
One problem identified in the existing @sc{gdb/mi} output syntax was the
One problem identified in the existing @sc{gdb/mi} output syntax was the
difficulty in differentiating between a tuple such as:
difficulty in differentiating between a tuple such as:
 
 
@example
@example
@{number="1",type="breakpoint",disp="keep",enabled="y"@}
@{number="1",type="breakpoint",disp="keep",enabled="y"@}
@end example
@end example
 
 
where each value has a unique label, and a list such as:
where each value has a unique label, and a list such as:
 
 
@example
@example
@{"1","2","4"@}
@{"1","2","4"@}
@{bp="1",bp="2",bp="4"@}
@{bp="1",bp="2",bp="4"@}
@end example
@end example
 
 
where values are un-labeled or the label is duplicated.
where values are un-labeled or the label is duplicated.
 
 
What follows is a draft revision to the output specification that
What follows is a draft revision to the output specification that
addresses this problem.
addresses this problem.
 
 
The output from @sc{gdb/mi} consists of zero or more out-of-band records
The output from @sc{gdb/mi} consists of zero or more out-of-band records
optionally followed by a single result record, the result record being
optionally followed by a single result record, the result record being
for the most recent command input.  The sequence is terminated by
for the most recent command input.  The sequence is terminated by
``(gdb)''.
``(gdb)''.
 
 
Asynchronous @sc{gdb/mi} output is similar.
Asynchronous @sc{gdb/mi} output is similar.
 
 
Each output record directly associated with an input command is prefixed
Each output record directly associated with an input command is prefixed
by the input commands @code{@var{token}}.
by the input commands @code{@var{token}}.
 
 
@table @code
@table @code
@item @var{output} @expansion{}
@item @var{output} @expansion{}
@{ @var{out-of-band-record} @} @code{[} @var{result-record} @code{]} "(gdb)" @var{nl}
@{ @var{out-of-band-record} @} @code{[} @var{result-record} @code{]} "(gdb)" @var{nl}
 
 
@item @var{result-record} @expansion{}
@item @var{result-record} @expansion{}
@code{[} @var{token} @code{]} "^" @var{result-class} @{ "," @var{result} @} @var{nl}
@code{[} @var{token} @code{]} "^" @var{result-class} @{ "," @var{result} @} @var{nl}
 
 
@item @var{out-of-band-record} @expansion{}
@item @var{out-of-band-record} @expansion{}
@var{async-record} @code{|} @var{stream-record}
@var{async-record} @code{|} @var{stream-record}
 
 
@item @var{async-record} @expansion{}
@item @var{async-record} @expansion{}
@var{exec-async-output} @code{|} @var{status-async-output} @code{|} @var{notify-async-output}
@var{exec-async-output} @code{|} @var{status-async-output} @code{|} @var{notify-async-output}
 
 
@item @var{exec-async-output} @expansion{}
@item @var{exec-async-output} @expansion{}
@code{[} @var{token} @code{]} "*" @var{async-output}
@code{[} @var{token} @code{]} "*" @var{async-output}
 
 
@item @var{status-async-output} @expansion{}
@item @var{status-async-output} @expansion{}
@code{[} @var{token} @code{]} "+" @var{async-output}
@code{[} @var{token} @code{]} "+" @var{async-output}
 
 
@item @var{notify-async-output} @expansion{}
@item @var{notify-async-output} @expansion{}
@code{[} @var{token} @code{]} "=" @var{async-output}
@code{[} @var{token} @code{]} "=" @var{async-output}
 
 
@item @var{async-output} @expansion{}
@item @var{async-output} @expansion{}
@var{async-class} @{ "," @var{result} @} @var{nl}
@var{async-class} @{ "," @var{result} @} @var{nl}
 
 
@item @var{result-class} @expansion{}
@item @var{result-class} @expansion{}
"done" @code{|} "running" @code{|} "connected" @code{|} "error" @code{|} "exit"
"done" @code{|} "running" @code{|} "connected" @code{|} "error" @code{|} "exit"
 
 
@item @var{async-class} @expansion{}
@item @var{async-class} @expansion{}
"stopped" @code{|} @emph{others depending on need as still in development}
"stopped" @code{|} @emph{others depending on need as still in development}
 
 
@item @var{result} @expansion{}
@item @var{result} @expansion{}
@var{string} "=" @var{value}
@var{string} "=" @var{value}
 
 
@item @var{value} @expansion{}
@item @var{value} @expansion{}
@var{c-string} @code{|} @var{tupple} @code{|} @var{list}
@var{c-string} @code{|} @var{tupple} @code{|} @var{list}
 
 
@item @var{tupple} @expansion{}
@item @var{tupple} @expansion{}
"@{@}" @code{|} "@{" @var{result} @{ "," @var{result} @} "@}"
"@{@}" @code{|} "@{" @var{result} @{ "," @var{result} @} "@}"
 
 
@item @var{list} @expansion{}
@item @var{list} @expansion{}
"@code{[]}" @code{|} "@code{[}" @var{value} @{ "," @var{value} @} "@code{]}"
"@code{[]}" @code{|} "@code{[}" @var{value} @{ "," @var{value} @} "@code{]}"
 
 
@item @var{string} @expansion{}
@item @var{string} @expansion{}
@emph{[-A-Za-z\.0-9_]*}
@emph{[-A-Za-z\.0-9_]*}
 
 
@item @var{c-string} @expansion{}
@item @var{c-string} @expansion{}
@emph{See the input specification}
@emph{See the input specification}
 
 
@item @var{stream-record} @expansion{}
@item @var{stream-record} @expansion{}
@var{console-stream-output} @code{|} @var{target-stream-output} @code{|} @var{log-stream-output}
@var{console-stream-output} @code{|} @var{target-stream-output} @code{|} @var{log-stream-output}
 
 
@item @var{console-stream-output} @expansion{}
@item @var{console-stream-output} @expansion{}
"~" @var{c-string}
"~" @var{c-string}
 
 
@item @var{target-stream-output} @expansion{}
@item @var{target-stream-output} @expansion{}
"@@" @var{c-string}
"@@" @var{c-string}
 
 
@item @var{log-stream-output} @expansion{}
@item @var{log-stream-output} @expansion{}
"&" @var{c-string}
"&" @var{c-string}
 
 
@item @var{nl} @expansion{}
@item @var{nl} @expansion{}
CR @code{|} CR-LF
CR @code{|} CR-LF
 
 
@item @var{token} @expansion{}
@item @var{token} @expansion{}
"any sequence of digits"
"any sequence of digits"
 
 
@end table
@end table
 
 
In addition, the following are still being developed.
In addition, the following are still being developed.
 
 
@table @code
@table @code
 
 
@item @var{query}
@item @var{query}
This action is currently undefined.
This action is currently undefined.
 
 
@end table
@end table
 
 
Notes:
Notes:
 
 
@itemize @bullet
@itemize @bullet
 
 
@item
@item
All output sequences end in a single line containing a period.
All output sequences end in a single line containing a period.
 
 
@item
@item
The @code{@var{token}} is from the corresponding request.  If an execution
The @code{@var{token}} is from the corresponding request.  If an execution
command is interrupted by the -exec-interrupt command, the token
command is interrupted by the -exec-interrupt command, the token
associated with the `*stopped' message is the one of the original
associated with the `*stopped' message is the one of the original
execution command, not the one of the interrupt-command.
execution command, not the one of the interrupt-command.
 
 
@item
@item
@var{status-async-output} contains on-going status information about the progress
@var{status-async-output} contains on-going status information about the progress
of a slow operation.  It can be discarded. All status output is prefixed by
of a slow operation.  It can be discarded. All status output is prefixed by
the prefix `+'.
the prefix `+'.
 
 
@item
@item
@var{exec-async-output} contains asynchronous state change on the target
@var{exec-async-output} contains asynchronous state change on the target
(stopped, started, disappeared). All async output is prefixed by
(stopped, started, disappeared). All async output is prefixed by
the prefix `*'.
the prefix `*'.
 
 
@item
@item
@var{notify-async-output} contains supplementary information that the client should
@var{notify-async-output} contains supplementary information that the client should
handle (new breakpoint information). All notify output is prefixed by
handle (new breakpoint information). All notify output is prefixed by
the prefix `='.
the prefix `='.
 
 
@item
@item
@var{console-stream-output} is output that should be displayed as is, in the
@var{console-stream-output} is output that should be displayed as is, in the
console.  It is the textual response to a CLI command. All the console
console.  It is the textual response to a CLI command. All the console
output is prefixed by the prefix ``~''.
output is prefixed by the prefix ``~''.
 
 
@item
@item
@var{target-stream-output} is the output produced by the target program.
@var{target-stream-output} is the output produced by the target program.
All the target output is prefixed by the prefix ``@@''.
All the target output is prefixed by the prefix ``@@''.
 
 
@item
@item
@var{log-stream-output} is output text coming from GDB's internals, for
@var{log-stream-output} is output text coming from GDB's internals, for
instance messages that should be displayed as part of an error log.  All
instance messages that should be displayed as part of an error log.  All
the log output is prefixed by the prefix ``&''.
the log output is prefixed by the prefix ``&''.
 
 
@end itemize
@end itemize
 
 
@c Local variables:
@c Local variables:
@c change-log-default-name: "ChangeLog-mi"
@c change-log-default-name: "ChangeLog-mi"
@c End:
@c End:
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.