* GDB/MI Simple Examples::
* GDB/MI Command Description Format::
* GDB/MI Breakpoint Commands::
+* GDB/MI Program Context::
+* GDB/MI Thread Commands::
+* GDB/MI Program Execution::
+* GDB/MI Stack Manipulation::
+* GDB/MI Variable Objects::
* GDB/MI Data Manipulation::
-* GDB/MI Program Control::
+* GDB/MI Tracepoint Commands::
+* GDB/MI Symbol Query::
* GDB/MI File Commands::
@ignore
* GDB/MI Kod Commands::
* GDB/MI Memory Overlay Commands::
* GDB/MI Signal Handling Commands::
@end ignore
-* GDB/MI Stack Manipulation::
-* GDB/MI Symbol Query::
* GDB/MI Target Manipulation::
-* GDB/MI Thread Commands::
-* GDB/MI Tracepoint Commands::
-* GDB/MI Variable Objects::
* GDB/MI Miscellaneous Commands::
@end menu
@cindex compatibility, @sc{gdb/mi} and CLI
@cindex @sc{gdb/mi}, compatibility with CLI
-For the developers convenience CLI commands can be entered directly.
-However, CLI commands that use sequences of commands such @code{source},
-@code{commands} will not work and commands that result in queries such
-as pending breakpoints and quitting once execution has started will
-default to yes.
+For the developers convenience CLI commands can be entered directly,
+but there may be some unexpected behaviour. For example, commands
+that query the user will behave as if the user replied yes, breakpoint
+command lists are not executed and some CLI commands, such as
+@code{if}, @code{when} and @code{define}, prompt for further input with
+@samp{>}, which is not valid MI output.
This feature may be removed at some stage in the future and it is
-recommended that front ends use the @code{-interpreter exec} command.
-@xref{GDB/MI Miscellaneous Commands}.
+recommended that front ends use the @code{-interpreter-exec} command
+(@pxref{-interpreter-exec}).
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@node GDB/MI Development and Front Ends
<- ^exit
@end smallexample
-@subsubheading A Bad Command
+@subheading A Bad Command
Here's what happens if you pass a non-existent command:
@end smallexample
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-@node GDB/MI Data Manipulation
-@section @sc{gdb/mi} Data Manipulation
-
-@cindex data manipulation, in @sc{gdb/mi}
-@cindex @sc{gdb/mi}, data manipulation
-This section describes the @sc{gdb/mi} commands that manipulate data:
-examine memory and registers, evaluate expressions, etc.
+@node GDB/MI Program Context
+@section @sc{gdb/mi} Program Context
-@c REMOVED FROM THE INTERFACE.
-@c @subheading -data-assign
-@c Change the value of a program variable. Plenty of side effects.
-@c @subsubheading GDB command
-@c set variable
-@c @subsubheading Example
-@c N.A.
+@subheading The @code{-exec-arguments} Command
+@findex -exec-arguments
-@subheading The @code{-data-disassemble} Command
-@findex -data-disassemble
@subsubheading Synopsis
@smallexample
- -data-disassemble
- [ -s @var{start-addr} -e @var{end-addr} ]
- | [ -f @var{filename} -l @var{linenum} [ -n @var{lines} ] ]
- -- @var{mode}
+ -exec-arguments @var{args}
@end smallexample
-@noindent
-Where:
+Set the inferior program arguments, to be used in the next
+@samp{-exec-run}.
-@table @samp
-@item @var{start-addr}
-is the beginning address (or @code{$pc})
-@item @var{end-addr}
-is the end address
-@item @var{filename}
-is the name of the file to disassemble
-@item @var{linenum}
-is the line number to disassemble around
-@item @var{lines}
-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
-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{start-addr} and @var{end-addr}, only @var{lines} lines are
-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}
-are displayed.
-@item @var{mode}
-is either 0 (meaning only disassembly) or 1 (meaning mixed source and
-disassembly).
-@end table
+@subsubheading @value{GDBN} Command
-@subsubheading Result
+The corresponding @value{GDBN} command is @samp{set args}.
-The output for each instruction is composed of four fields:
+@subsubheading Example
-@itemize @bullet
-@item Address
-@item Func-name
-@item Offset
-@item Instruction
-@end itemize
+@c FIXME!
+Don't have one around.
-Note that whatever included in the instruction field, is not manipulated
-directely by @sc{gdb/mi}, i.e. it is not possible to adjust its format.
+
+@subheading The @code{-exec-show-arguments} Command
+@findex -exec-show-arguments
+
+@subsubheading Synopsis
+
+@smallexample
+ -exec-show-arguments
+@end smallexample
+
+Print the arguments of the program.
@subsubheading @value{GDBN} Command
-There's no direct mapping from this command to the CLI.
+The corresponding @value{GDBN} command is @samp{show args}.
@subsubheading Example
+N.A.
-Disassemble from the current value of @code{$pc} to @code{$pc + 20}:
-@smallexample
-(@value{GDBP})
--data-disassemble -s $pc -e "$pc + 20" -- 0
-^done,
-asm_insns=[
-@{address="0x000107c0",func-name="main",offset="4",
-inst="mov 2, %o0"@},
-@{address="0x000107c4",func-name="main",offset="8",
-inst="sethi %hi(0x11800), %o2"@},
-@{address="0x000107c8",func-name="main",offset="12",
-inst="or %o2, 0x140, %o1\t! 0x11940 <_lib_version+8>"@},
-@{address="0x000107cc",func-name="main",offset="16",
-inst="sethi %hi(0x11800), %o2"@},
-@{address="0x000107d0",func-name="main",offset="20",
-inst="or %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"@}]
-(@value{GDBP})
-@end smallexample
+@subheading The @code{-environment-cd} Command
+@findex -environment-cd
-Disassemble the whole @code{main} function. Line 32 is part of
-@code{main}.
+@subsubheading Synopsis
@smallexample
--data-disassemble -f basics.c -l 32 -- 0
-^done,asm_insns=[
-@{address="0x000107bc",func-name="main",offset="0",
-inst="save %sp, -112, %sp"@},
-@{address="0x000107c0",func-name="main",offset="4",
-inst="mov 2, %o0"@},
-@{address="0x000107c4",func-name="main",offset="8",
-inst="sethi %hi(0x11800), %o2"@},
-[@dots{}]
-@{address="0x0001081c",func-name="main",offset="96",inst="ret "@},
-@{address="0x00010820",func-name="main",offset="100",inst="restore "@}]
-(@value{GDBP})
+ -environment-cd @var{pathdir}
@end smallexample
-Disassemble 3 instructions from the start of @code{main}:
+Set @value{GDBN}'s working directory.
-@smallexample
-(@value{GDBP})
--data-disassemble -f basics.c -l 32 -n 3 -- 0
-^done,asm_insns=[
-@{address="0x000107bc",func-name="main",offset="0",
-inst="save %sp, -112, %sp"@},
-@{address="0x000107c0",func-name="main",offset="4",
-inst="mov 2, %o0"@},
-@{address="0x000107c4",func-name="main",offset="8",
-inst="sethi %hi(0x11800), %o2"@}]
-(@value{GDBP})
-@end smallexample
+@subsubheading @value{GDBN} Command
-Disassemble 3 instructions from the start of @code{main} in mixed mode:
+The corresponding @value{GDBN} command is @samp{cd}.
+
+@subsubheading Example
@smallexample
(@value{GDBP})
--data-disassemble -f basics.c -l 32 -n 3 -- 1
-^done,asm_insns=[
-src_and_asm_line=@{line="31",
-file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
- testsuite/gdb.mi/basics.c",line_asm_insn=[
-@{address="0x000107bc",func-name="main",offset="0",
-inst="save %sp, -112, %sp"@}]@},
-src_and_asm_line=@{line="32",
-file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
- testsuite/gdb.mi/basics.c",line_asm_insn=[
-@{address="0x000107c0",func-name="main",offset="4",
-inst="mov 2, %o0"@},
-@{address="0x000107c4",func-name="main",offset="8",
-inst="sethi %hi(0x11800), %o2"@}]@}]
+-environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
+^done
(@value{GDBP})
@end smallexample
-@subheading The @code{-data-evaluate-expression} Command
-@findex -data-evaluate-expression
+@subheading The @code{-environment-directory} Command
+@findex -environment-directory
@subsubheading Synopsis
@smallexample
- -data-evaluate-expression @var{expr}
+ -environment-directory [ -r ] [ @var{pathdir} ]+
@end smallexample
-Evaluate @var{expr} as an expression. The expression could contain an
-inferior function call. The function call will execute synchronously.
-If the expression contains spaces, it must be enclosed in double quotes.
+Add directories @var{pathdir} to beginning of search path for source files.
+If the @samp{-r} option is used, the search path is reset to the default
+search path. If directories @var{pathdir} are supplied in addition to the
+@samp{-r} option, the search path is first reset and then addition
+occurs as normal.
+Multiple directories may be specified, separated by blanks. Specifying
+multiple directories in a single command
+results in the directories added to the beginning of the
+search path in the same order they were presented in the command.
+If blanks are needed as
+part of a directory name, double-quotes should be used around
+the name. In the command output, the path will show up separated
+by the system directory-separator character. The directory-seperator
+character must not be used
+in any directory name.
+If no directories are specified, the current search path is displayed.
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} commands are @samp{print}, @samp{output}, and
-@samp{call}. In @code{gdbtk} only, there's a corresponding
-@samp{gdb_eval} command.
+The corresponding @value{GDBN} command is @samp{dir}.
@subsubheading Example
-In the following example, the numbers that precede the commands are the
-@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
-output.
-
@smallexample
-211-data-evaluate-expression A
-211^done,value="1"
(@value{GDBP})
-311-data-evaluate-expression &A
-311^done,value="0xefffeb7c"
+-environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
+^done,source-path="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd"
(@value{GDBP})
-411-data-evaluate-expression A+3
-411^done,value="4"
+-environment-directory ""
+^done,source-path="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd"
(@value{GDBP})
-511-data-evaluate-expression "A + 3"
-511^done,value="4"
+-environment-directory -r /home/jjohnstn/src/gdb /usr/src
+^done,source-path="/home/jjohnstn/src/gdb:/usr/src:$cdir:$cwd"
+(@value{GDBP})
+-environment-directory -r
+^done,source-path="$cdir:$cwd"
(@value{GDBP})
@end smallexample
-@subheading The @code{-data-list-changed-registers} Command
-@findex -data-list-changed-registers
+@subheading The @code{-environment-path} Command
+@findex -environment-path
@subsubheading Synopsis
@smallexample
- -data-list-changed-registers
+ -environment-path [ -r ] [ @var{pathdir} ]+
@end smallexample
-Display a list of the registers that have changed.
+Add directories @var{pathdir} to beginning of search path for object files.
+If the @samp{-r} option is used, the search path is reset to the original
+search path that existed at gdb start-up. If directories @var{pathdir} are
+supplied in addition to the
+@samp{-r} option, the search path is first reset and then addition
+occurs as normal.
+Multiple directories may be specified, separated by blanks. Specifying
+multiple directories in a single command
+results in the directories added to the beginning of the
+search path in the same order they were presented in the command.
+If blanks are needed as
+part of a directory name, double-quotes should be used around
+the name. In the command output, the path will show up separated
+by the system directory-separator character. The directory-seperator
+character must not be used
+in any directory name.
+If no directories are specified, the current path is displayed.
+
@subsubheading @value{GDBN} Command
-@value{GDBN} doesn't have a direct analog for this command; @code{gdbtk}
-has the corresponding command @samp{gdb_changed_register_list}.
+The corresponding @value{GDBN} command is @samp{path}.
@subsubheading Example
-On a PPC MBX board:
-
@smallexample
(@value{GDBP})
--exec-continue
-^running
-
+-environment-path
+^done,path="/usr/bin"
(@value{GDBP})
-*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
-args=[],file="try.c",fullname="/home/foo/bar/try.c",line="5"@}
+-environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb /bin
+^done,path="/kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb:/bin:/usr/bin"
(@value{GDBP})
--data-list-changed-registers
-^done,changed-registers=["0","1","2","4","5","6","7","8","9",
-"10","11","13","14","15","16","17","18","19","20","21","22","23",
-"24","25","26","27","28","30","31","64","65","66","67","69"]
+-environment-path -r /usr/local/bin
+^done,path="/usr/local/bin:/usr/bin"
(@value{GDBP})
@end smallexample
-@subheading The @code{-data-list-register-names} Command
-@findex -data-list-register-names
+@subheading The @code{-environment-pwd} Command
+@findex -environment-pwd
@subsubheading Synopsis
@smallexample
- -data-list-register-names [ ( @var{regno} )+ ]
+ -environment-pwd
@end smallexample
-Show a list of register names for the current target. If no arguments
-are given, it shows a list of the names of all the registers. If
-integer numbers are given as arguments, it will print a list of the
-names of the registers corresponding to the arguments. To ensure
-consistency between a register name and its number, the output list may
-include empty register names.
+Show the current working directory.
-@subsubheading @value{GDBN} Command
+@subsubheading @value{GDBN} command
-@value{GDBN} does not have a command which corresponds to
-@samp{-data-list-register-names}. In @code{gdbtk} there is a
-corresponding command @samp{gdb_regnames}.
+The corresponding @value{GDBN} command is @samp{pwd}.
@subsubheading Example
-For the PPC MBX board:
@smallexample
(@value{GDBP})
--data-list-register-names
-^done,register-names=["r0","r1","r2","r3","r4","r5","r6","r7",
-"r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18",
-"r19","r20","r21","r22","r23","r24","r25","r26","r27","r28","r29",
-"r30","r31","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9",
-"f10","f11","f12","f13","f14","f15","f16","f17","f18","f19","f20",
-"f21","f22","f23","f24","f25","f26","f27","f28","f29","f30","f31",
-"", "pc","ps","cr","lr","ctr","xer"]
-(@value{GDBP})
--data-list-register-names 1 2 3
-^done,register-names=["r1","r2","r3"]
+-environment-pwd
+^done,cwd="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb"
(@value{GDBP})
@end smallexample
-@subheading The @code{-data-list-register-values} Command
-@findex -data-list-register-values
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Thread Commands
+@section @sc{gdb/mi} Thread Commands
+
+
+@subheading The @code{-thread-info} Command
+@findex -thread-info
@subsubheading Synopsis
@smallexample
- -data-list-register-values @var{fmt} [ ( @var{regno} )*]
+ -thread-info
@end smallexample
-Display the registers' contents. @var{fmt} is the format according to
-which the registers' contents are to be returned, followed by an optional
-list of numbers specifying the registers to display. A missing list of
-numbers indicates that the contents of all the registers must be returned.
-
-Allowed formats for @var{fmt} are:
-
-@table @code
-@item x
-Hexadecimal
-@item o
-Octal
-@item t
-Binary
-@item d
-Decimal
-@item r
-Raw
-@item N
-Natural
-@end table
-
-@subsubheading @value{GDBN} Command
+@subsubheading @value{GDBN} command
-The corresponding @value{GDBN} commands are @samp{info reg}, @samp{info
-all-reg}, and (in @code{gdbtk}) @samp{gdb_fetch_registers}.
+No equivalent.
@subsubheading Example
-
-For a PPC MBX board (note: line breaks are for readability only, they
-don't appear in the actual output):
-
-@smallexample
-(@value{GDBP})
--data-list-register-values r 64 65
-^done,register-values=[@{number="64",value="0xfe00a300"@},
-@{number="65",value="0x00029002"@}]
-(@value{GDBP})
--data-list-register-values x
-^done,register-values=[@{number="0",value="0xfe0043c8"@},
-@{number="1",value="0x3fff88"@},@{number="2",value="0xfffffffe"@},
-@{number="3",value="0x0"@},@{number="4",value="0xa"@},
-@{number="5",value="0x3fff68"@},@{number="6",value="0x3fff58"@},
-@{number="7",value="0xfe011e98"@},@{number="8",value="0x2"@},
-@{number="9",value="0xfa202820"@},@{number="10",value="0xfa202808"@},
-@{number="11",value="0x1"@},@{number="12",value="0x0"@},
-@{number="13",value="0x4544"@},@{number="14",value="0xffdfffff"@},
-@{number="15",value="0xffffffff"@},@{number="16",value="0xfffffeff"@},
-@{number="17",value="0xefffffed"@},@{number="18",value="0xfffffffe"@},
-@{number="19",value="0xffffffff"@},@{number="20",value="0xffffffff"@},
-@{number="21",value="0xffffffff"@},@{number="22",value="0xfffffff7"@},
-@{number="23",value="0xffffffff"@},@{number="24",value="0xffffffff"@},
-@{number="25",value="0xffffffff"@},@{number="26",value="0xfffffffb"@},
-@{number="27",value="0xffffffff"@},@{number="28",value="0xf7bfffff"@},
-@{number="29",value="0x0"@},@{number="30",value="0xfe010000"@},
-@{number="31",value="0x0"@},@{number="32",value="0x0"@},
-@{number="33",value="0x0"@},@{number="34",value="0x0"@},
-@{number="35",value="0x0"@},@{number="36",value="0x0"@},
-@{number="37",value="0x0"@},@{number="38",value="0x0"@},
-@{number="39",value="0x0"@},@{number="40",value="0x0"@},
-@{number="41",value="0x0"@},@{number="42",value="0x0"@},
-@{number="43",value="0x0"@},@{number="44",value="0x0"@},
-@{number="45",value="0x0"@},@{number="46",value="0x0"@},
-@{number="47",value="0x0"@},@{number="48",value="0x0"@},
-@{number="49",value="0x0"@},@{number="50",value="0x0"@},
-@{number="51",value="0x0"@},@{number="52",value="0x0"@},
-@{number="53",value="0x0"@},@{number="54",value="0x0"@},
-@{number="55",value="0x0"@},@{number="56",value="0x0"@},
-@{number="57",value="0x0"@},@{number="58",value="0x0"@},
-@{number="59",value="0x0"@},@{number="60",value="0x0"@},
-@{number="61",value="0x0"@},@{number="62",value="0x0"@},
-@{number="63",value="0x0"@},@{number="64",value="0xfe00a300"@},
-@{number="65",value="0x29002"@},@{number="66",value="0x202f04b5"@},
-@{number="67",value="0xfe0043b0"@},@{number="68",value="0xfe00b3e4"@},
-@{number="69",value="0x20002b03"@}]
-(@value{GDBP})
-@end smallexample
+N.A.
-@subheading The @code{-data-read-memory} Command
-@findex -data-read-memory
+@subheading The @code{-thread-list-all-threads} Command
+@findex -thread-list-all-threads
@subsubheading Synopsis
@smallexample
- -data-read-memory [ -o @var{byte-offset} ]
- @var{address} @var{word-format} @var{word-size}
- @var{nr-rows} @var{nr-cols} [ @var{aschar} ]
+ -thread-list-all-threads
@end smallexample
-@noindent
-where:
-
-@table @samp
-@item @var{address}
-An expression specifying the address of the first memory word to be
-read. Complex expressions containing embedded white space should be
-quoted using the C convention.
-
-@item @var{word-format}
-The format to be used to print the memory words. The notation is the
-same as for @value{GDBN}'s @code{print} command (@pxref{Output Formats,
-,Output formats}).
+@subsubheading @value{GDBN} Command
-@item @var{word-size}
-The size of each memory word in bytes.
+The equivalent @value{GDBN} command is @samp{info threads}.
-@item @var{nr-rows}
-The number of rows in the output table.
+@subsubheading Example
+N.A.
-@item @var{nr-cols}
-The number of columns in the output table.
-@item @var{aschar}
-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
-member of the printable @sc{ascii} character set (printable @sc{ascii}
-characters are those whose code is between 32 and 126, inclusively).
+@subheading The @code{-thread-list-ids} Command
+@findex -thread-list-ids
-@item @var{byte-offset}
-An offset to add to the @var{address} before fetching memory.
-@end table
+@subsubheading Synopsis
-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,
-@code{@var{nr-rows} * @var{nr-cols} * @var{word-size}} bytes are read
-(returned as @samp{total-bytes}). Should less than the requested number
-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
-in @samp{nr-bytes} and the starting address used to read memory in
-@samp{addr}.
+@smallexample
+ -thread-list-ids
+@end smallexample
-The address of the next/previous row or page is available in
-@samp{next-row} and @samp{prev-row}, @samp{next-page} and
-@samp{prev-page}.
+Produces a list of the currently known @value{GDBN} thread ids. At the
+end of the list it also prints the total number of such threads.
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{x}. @code{gdbtk} has
-@samp{gdb_get_mem} memory read command.
+Part of @samp{info threads} supplies the same information.
@subsubheading Example
-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
-word. Display each word in hex.
+No threads present, besides the main process:
@smallexample
(@value{GDBP})
-9-data-read-memory -o -6 -- bytes+6 x 1 3 2
-9^done,addr="0x00001390",nr-bytes="6",total-bytes="6",
-next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396",
-prev-page="0x0000138a",memory=[
-@{addr="0x00001390",data=["0x00","0x01"]@},
-@{addr="0x00001392",data=["0x02","0x03"]@},
-@{addr="0x00001394",data=["0x04","0x05"]@}]
+-thread-list-ids
+^done,thread-ids=@{@},number-of-threads="0"
(@value{GDBP})
@end smallexample
-Read two bytes of memory starting at address @code{shorts + 64} and
-display as a single word formatted in decimal.
-
-@smallexample
-(@value{GDBP})
-5-data-read-memory shorts+64 d 2 1 1
-5^done,addr="0x00001510",nr-bytes="2",total-bytes="2",
-next-row="0x00001512",prev-row="0x0000150e",
-next-page="0x00001512",prev-page="0x0000150e",memory=[
-@{addr="0x00001510",data=["128"]@}]
-(@value{GDBP})
-@end smallexample
-Read thirty two bytes of memory starting at @code{bytes+16} and format
-as eight rows of four columns. Include a string encoding with @samp{x}
-used as the non-printable character.
+Several threads:
@smallexample
(@value{GDBP})
-4-data-read-memory bytes+16 x 1 8 4 x
-4^done,addr="0x000013a0",nr-bytes="32",total-bytes="32",
-next-row="0x000013c0",prev-row="0x0000139c",
-next-page="0x000013c0",prev-page="0x00001380",memory=[
-@{addr="0x000013a0",data=["0x10","0x11","0x12","0x13"],ascii="xxxx"@},
-@{addr="0x000013a4",data=["0x14","0x15","0x16","0x17"],ascii="xxxx"@},
-@{addr="0x000013a8",data=["0x18","0x19","0x1a","0x1b"],ascii="xxxx"@},
-@{addr="0x000013ac",data=["0x1c","0x1d","0x1e","0x1f"],ascii="xxxx"@},
-@{addr="0x000013b0",data=["0x20","0x21","0x22","0x23"],ascii=" !\"#"@},
-@{addr="0x000013b4",data=["0x24","0x25","0x26","0x27"],ascii="$%&'"@},
-@{addr="0x000013b8",data=["0x28","0x29","0x2a","0x2b"],ascii="()*+"@},
-@{addr="0x000013bc",data=["0x2c","0x2d","0x2e","0x2f"],ascii=",-./"@}]
+-thread-list-ids
+^done,thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
+number-of-threads="3"
(@value{GDBP})
@end smallexample
-@subheading The @code{-display-delete} Command
-@findex -display-delete
+
+@subheading The @code{-thread-select} Command
+@findex -thread-select
@subsubheading Synopsis
@smallexample
- -display-delete @var{number}
+ -thread-select @var{threadnum}
@end smallexample
-Delete the display @var{number}.
+Make @var{threadnum} the current thread. It prints the number of the new
+current thread, and the topmost frame for that thread.
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{delete display}.
+The corresponding @value{GDBN} command is @samp{thread}.
@subsubheading Example
-N.A.
-
-
-@subheading The @code{-display-disable} Command
-@findex -display-disable
-
-@subsubheading Synopsis
@smallexample
- -display-disable @var{number}
+(@value{GDBP})
+-exec-next
+^running
+(@value{GDBP})
+*stopped,reason="end-stepping-range",thread-id="2",line="187",
+file="../../../devo/gdb/testsuite/gdb.threads/linux-dp.c"
+(@value{GDBP})
+-thread-list-ids
+^done,
+thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
+number-of-threads="3"
+(@value{GDBP})
+-thread-select 3
+^done,new-thread-id="3",
+frame=@{level="0",func="vprintf",
+args=[@{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""@},
+@{name="arg",value="0x2"@}],file="vprintf.c",line="31"@}
+(@value{GDBP})
@end smallexample
-Disable display @var{number}.
-
-@subsubheading @value{GDBN} Command
-
-The corresponding @value{GDBN} command is @samp{disable display}.
-
-@subsubheading Example
-N.A.
-
-
-@subheading The @code{-display-enable} Command
-@findex -display-enable
-
-@subsubheading Synopsis
-
-@smallexample
- -display-enable @var{number}
-@end smallexample
-
-Enable display @var{number}.
-
-@subsubheading @value{GDBN} Command
-
-The corresponding @value{GDBN} command is @samp{enable display}.
-
-@subsubheading Example
-N.A.
-
-
-@subheading The @code{-display-insert} Command
-@findex -display-insert
-
-@subsubheading Synopsis
-
-@smallexample
- -display-insert @var{expression}
-@end smallexample
-
-Display @var{expression} every time the program stops.
-
-@subsubheading @value{GDBN} Command
-
-The corresponding @value{GDBN} command is @samp{display}.
-
-@subsubheading Example
-N.A.
-
-
-@subheading The @code{-display-list} Command
-@findex -display-list
-
-@subsubheading Synopsis
-
-@smallexample
- -display-list
-@end smallexample
-
-List the displays. Do not show the current values.
-
-@subsubheading @value{GDBN} Command
-
-The corresponding @value{GDBN} command is @samp{info display}.
-
-@subsubheading Example
-N.A.
-
-
-@subheading The @code{-environment-cd} Command
-@findex -environment-cd
-
-@subsubheading Synopsis
-
-@smallexample
- -environment-cd @var{pathdir}
-@end smallexample
-
-Set @value{GDBN}'s working directory.
-
-@subsubheading @value{GDBN} Command
-
-The corresponding @value{GDBN} command is @samp{cd}.
-
-@subsubheading Example
-
-@smallexample
-(@value{GDBP})
--environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
-^done
-(@value{GDBP})
-@end smallexample
-
-
-@subheading The @code{-environment-directory} Command
-@findex -environment-directory
-
-@subsubheading Synopsis
-
-@smallexample
- -environment-directory [ -r ] [ @var{pathdir} ]+
-@end smallexample
-
-Add directories @var{pathdir} to beginning of search path for source files.
-If the @samp{-r} option is used, the search path is reset to the default
-search path. If directories @var{pathdir} are supplied in addition to the
-@samp{-r} option, the search path is first reset and then addition
-occurs as normal.
-Multiple directories may be specified, separated by blanks. Specifying
-multiple directories in a single command
-results in the directories added to the beginning of the
-search path in the same order they were presented in the command.
-If blanks are needed as
-part of a directory name, double-quotes should be used around
-the name. In the command output, the path will show up separated
-by the system directory-separator character. The directory-seperator
-character must not be used
-in any directory name.
-If no directories are specified, the current search path is displayed.
-
-@subsubheading @value{GDBN} Command
-
-The corresponding @value{GDBN} command is @samp{dir}.
-
-@subsubheading Example
-
-@smallexample
-(@value{GDBP})
--environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
-^done,source-path="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd"
-(@value{GDBP})
--environment-directory ""
-^done,source-path="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd"
-(@value{GDBP})
--environment-directory -r /home/jjohnstn/src/gdb /usr/src
-^done,source-path="/home/jjohnstn/src/gdb:/usr/src:$cdir:$cwd"
-(@value{GDBP})
--environment-directory -r
-^done,source-path="$cdir:$cwd"
-(@value{GDBP})
-@end smallexample
-
-
-@subheading The @code{-environment-path} Command
-@findex -environment-path
-
-@subsubheading Synopsis
-
-@smallexample
- -environment-path [ -r ] [ @var{pathdir} ]+
-@end smallexample
-
-Add directories @var{pathdir} to beginning of search path for object files.
-If the @samp{-r} option is used, the search path is reset to the original
-search path that existed at gdb start-up. If directories @var{pathdir} are
-supplied in addition to the
-@samp{-r} option, the search path is first reset and then addition
-occurs as normal.
-Multiple directories may be specified, separated by blanks. Specifying
-multiple directories in a single command
-results in the directories added to the beginning of the
-search path in the same order they were presented in the command.
-If blanks are needed as
-part of a directory name, double-quotes should be used around
-the name. In the command output, the path will show up separated
-by the system directory-separator character. The directory-seperator
-character must not be used
-in any directory name.
-If no directories are specified, the current path is displayed.
-
-
-@subsubheading @value{GDBN} Command
-
-The corresponding @value{GDBN} command is @samp{path}.
-
-@subsubheading Example
-
-@smallexample
-(@value{GDBP})
--environment-path
-^done,path="/usr/bin"
-(@value{GDBP})
--environment-path /kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb /bin
-^done,path="/kwikemart/marge/ezannoni/flathead-dev/ppc-eabi/gdb:/bin:/usr/bin"
-(@value{GDBP})
--environment-path -r /usr/local/bin
-^done,path="/usr/local/bin:/usr/bin"
-(@value{GDBP})
-@end smallexample
-
-
-@subheading The @code{-environment-pwd} Command
-@findex -environment-pwd
-
-@subsubheading Synopsis
-
-@smallexample
- -environment-pwd
-@end smallexample
-
-Show the current working directory.
-
-@subsubheading @value{GDBN} command
-
-The corresponding @value{GDBN} command is @samp{pwd}.
-
-@subsubheading Example
-
-@smallexample
-(@value{GDBP})
--environment-pwd
-^done,cwd="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb"
-(@value{GDBP})
-@end smallexample
-
-@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-@node GDB/MI Program Control
-@section @sc{gdb/mi} Program control
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Program Execution
+@section @sc{gdb/mi} Program Execution
These are the asynchronous commands which generate the out-of-band
record @samp{*stopped}. Currently GDB only really executes
asynchronously with remote targets and this interaction is mimicked in
other cases.
-@subheading The @code{-exec-abort} Command
-@findex -exec-abort
-
-@subsubheading Synopsis
-
-@smallexample
- -exec-abort
-@end smallexample
-
-Kill the inferior running program.
-
-@subsubheading @value{GDBN} Command
-
-The corresponding @value{GDBN} command is @samp{kill}.
-
-@subsubheading Example
-N.A.
-
-
-@subheading The @code{-exec-arguments} Command
-@findex -exec-arguments
-
-@subsubheading Synopsis
-
-@smallexample
- -exec-arguments @var{args}
-@end smallexample
-
-Set the inferior program arguments, to be used in the next
-@samp{-exec-run}.
-
-@subsubheading @value{GDBN} Command
-
-The corresponding @value{GDBN} command is @samp{set args}.
-
-@subsubheading Example
-
-@c FIXME!
-Don't have one around.
-
-
@subheading The @code{-exec-continue} Command
@findex -exec-continue
@end smallexample
-@subheading The @code{-exec-show-arguments} Command
-@findex -exec-show-arguments
+@c @subheading -exec-signal
+
+
+@subheading The @code{-exec-step} Command
+@findex -exec-step
@subsubheading Synopsis
@smallexample
- -exec-show-arguments
+ -exec-step
@end smallexample
-Print the arguments of the program.
+Resumes execution of the inferior program, stopping when the beginning
+of the next source line is reached, if the next source line is not a
+function call. If it is, stop at the first instruction of the called
+function.
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{show args}.
-
-@subsubheading Example
-N.A.
-
-@c @subheading -exec-signal
-
-@subheading The @code{-exec-step} Command
-@findex -exec-step
-
-@subsubheading Synopsis
-
-@smallexample
- -exec-step
-@end smallexample
-
-Resumes execution of the inferior program, stopping when the beginning
-of the next source line is reached, if the next source line is not a
-function call. If it is, stop at the first instruction of the called
-function.
-
-@subsubheading @value{GDBN} Command
-
-The corresponding @value{GDBN} command is @samp{step}.
+The corresponding @value{GDBN} command is @samp{step}.
@subsubheading Example
@end ignore
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-@node GDB/MI File Commands
-@section @sc{gdb/mi} File Commands
+@node GDB/MI Stack Manipulation
+@section @sc{gdb/mi} Stack Manipulation Commands
-This section describes the GDB/MI commands to specify executable file names
-and to read in and obtain symbol table information.
-@subheading The @code{-file-exec-and-symbols} Command
-@findex -file-exec-and-symbols
+@subheading The @code{-stack-info-frame} Command
+@findex -stack-info-frame
@subsubheading Synopsis
@smallexample
- -file-exec-and-symbols @var{file}
+ -stack-info-frame
@end smallexample
-Specify the executable file to be debugged. This file is the one from
-which the symbol table is also read. If no file is specified, the
-command clears the executable and symbol information. If breakpoints
-are set when using this command with no arguments, @value{GDBN} will produce
-error messages. Otherwise, no output is produced, except a completion
-notification.
+Get info on the selected frame.
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{file}.
+The corresponding @value{GDBN} command is @samp{info frame} or @samp{frame}
+(without arguments).
@subsubheading Example
@smallexample
(@value{GDBP})
--file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
-^done
+-stack-info-frame
+^done,frame=@{level="1",addr="0x0001076c",func="callee3",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="17"@}
(@value{GDBP})
@end smallexample
-
-@subheading The @code{-file-exec-file} Command
-@findex -file-exec-file
+@subheading The @code{-stack-info-depth} Command
+@findex -stack-info-depth
@subsubheading Synopsis
@smallexample
- -file-exec-file @var{file}
+ -stack-info-depth [ @var{max-depth} ]
@end smallexample
-Specify the executable file to be debugged. Unlike
-@samp{-file-exec-and-symbols}, the symbol table is @emph{not} read
-from this file. If used without argument, @value{GDBN} clears the information
-about the executable file. No output is produced, except a completion
-notification.
+Return the depth of the stack. If the integer argument @var{max-depth}
+is specified, do not count beyond @var{max-depth} frames.
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{exec-file}.
+There's no equivalent @value{GDBN} command.
@subsubheading Example
+For a stack with frame levels 0 through 11:
+
@smallexample
(@value{GDBP})
--file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
-^done
+-stack-info-depth
+^done,depth="12"
+(@value{GDBP})
+-stack-info-depth 4
+^done,depth="4"
+(@value{GDBP})
+-stack-info-depth 12
+^done,depth="12"
+(@value{GDBP})
+-stack-info-depth 11
+^done,depth="11"
+(@value{GDBP})
+-stack-info-depth 13
+^done,depth="12"
(@value{GDBP})
@end smallexample
-
-@subheading The @code{-file-list-exec-sections} Command
-@findex -file-list-exec-sections
+@subheading The @code{-stack-list-arguments} Command
+@findex -stack-list-arguments
@subsubheading Synopsis
@smallexample
- -file-list-exec-sections
+ -stack-list-arguments @var{show-values}
+ [ @var{low-frame} @var{high-frame} ]
@end smallexample
-List the sections of the current executable file.
+Display a list of the arguments for the frames between @var{low-frame}
+and @var{high-frame} (inclusive). If @var{low-frame} and
+@var{high-frame} are not provided, list the arguments for the whole call
+stack.
+
+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
+means that both names and values of the arguments are printed.
@subsubheading @value{GDBN} Command
-The @value{GDBN} command @samp{info file} shows, among the rest, the same
-information as this command. @code{gdbtk} has a corresponding command
-@samp{gdb_load_info}.
+@value{GDBN} does not have an equivalent command. @code{gdbtk} has a
+@samp{gdb_get_args} command which partially overlaps with the
+functionality of @samp{-stack-list-arguments}.
@subsubheading Example
-N.A.
+@smallexample
+(@value{GDBP})
+-stack-list-frames
+^done,
+stack=[
+frame=@{level="0",addr="0x00010734",func="callee4",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
+frame=@{level="1",addr="0x0001076c",func="callee3",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
+frame=@{level="2",addr="0x0001078c",func="callee2",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
+frame=@{level="3",addr="0x000107b4",func="callee1",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
+frame=@{level="4",addr="0x000107e0",func="main",
+file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
+fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}]
+(@value{GDBP})
+-stack-list-arguments 0
+^done,
+stack-args=[
+frame=@{level="0",args=[]@},
+frame=@{level="1",args=[name="strarg"]@},
+frame=@{level="2",args=[name="intarg",name="strarg"]@},
+frame=@{level="3",args=[name="intarg",name="strarg",name="fltarg"]@},
+frame=@{level="4",args=[]@}]
+(@value{GDBP})
+-stack-list-arguments 1
+^done,
+stack-args=[
+frame=@{level="0",args=[]@},
+frame=@{level="1",
+ args=[@{name="strarg",value="0x11940 \"A string argument.\""@}]@},
+frame=@{level="2",args=[
+@{name="intarg",value="2"@},
+@{name="strarg",value="0x11940 \"A string argument.\""@}]@},
+@{frame=@{level="3",args=[
+@{name="intarg",value="2"@},
+@{name="strarg",value="0x11940 \"A string argument.\""@},
+@{name="fltarg",value="3.5"@}]@},
+frame=@{level="4",args=[]@}]
+(@value{GDBP})
+-stack-list-arguments 0 2 2
+^done,stack-args=[frame=@{level="2",args=[name="intarg",name="strarg"]@}]
+(@value{GDBP})
+-stack-list-arguments 1 2 2
+^done,stack-args=[frame=@{level="2",
+args=[@{name="intarg",value="2"@},
+@{name="strarg",value="0x11940 \"A string argument.\""@}]@}]
+(@value{GDBP})
+@end smallexample
+
+@c @subheading -stack-list-exception-handlers
-@subheading The @code{-file-list-exec-source-file} Command
-@findex -file-list-exec-source-file
+
+@subheading The @code{-stack-list-frames} Command
+@findex -stack-list-frames
@subsubheading Synopsis
@smallexample
- -file-list-exec-source-file
+ -stack-list-frames [ @var{low-frame} @var{high-frame} ]
@end smallexample
-List the line number, the current source file, and the absolute path
-to the current source file for the current executable.
+List the frames currently on the stack. For each frame it displays the
+following info:
+
+@table @samp
+@item @var{level}
+The frame number, 0 being the topmost frame, i.e. the innermost function.
+@item @var{addr}
+The @code{$pc} value for that frame.
+@item @var{func}
+Function name.
+@item @var{file}
+File name of the source file where the function lives.
+@item @var{line}
+Line number corresponding to the @code{$pc}.
+@end table
+
+If invoked without arguments, this command prints a backtrace for the
+whole stack. If given two integer arguments, it shows the frames whose
+levels are between the two arguments (inclusive). If the two arguments
+are equal, it shows the single frame at the corresponding level.
@subsubheading @value{GDBN} Command
-The @value{GDBN} equivalent is @samp{info source}
+The corresponding @value{GDBN} commands are @samp{backtrace} and @samp{where}.
@subsubheading Example
+Full stack backtrace:
+
@smallexample
(@value{GDBP})
-123-file-list-exec-source-file
-123^done,line="1",file="foo.c",fullname="/home/bar/foo.c"
+-stack-list-frames
+^done,stack=
+[frame=@{level="0",addr="0x0001076c",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="11"@},
+frame=@{level="1",addr="0x000107a4",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
+frame=@{level="2",addr="0x000107a4",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
+frame=@{level="3",addr="0x000107a4",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
+frame=@{level="4",addr="0x000107a4",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
+frame=@{level="5",addr="0x000107a4",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
+frame=@{level="6",addr="0x000107a4",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
+frame=@{level="7",addr="0x000107a4",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
+frame=@{level="8",addr="0x000107a4",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
+frame=@{level="9",addr="0x000107a4",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
+frame=@{level="10",addr="0x000107a4",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
+frame=@{level="11",addr="0x00010738",func="main",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="4"@}]
(@value{GDBP})
@end smallexample
+Show frames between @var{low_frame} and @var{high_frame}:
-@subheading The @code{-file-list-exec-source-files} Command
-@findex -file-list-exec-source-files
+@smallexample
+(@value{GDBP})
+-stack-list-frames 3 5
+^done,stack=
+[frame=@{level="3",addr="0x000107a4",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
+frame=@{level="4",addr="0x000107a4",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
+frame=@{level="5",addr="0x000107a4",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@}]
+(@value{GDBP})
+@end smallexample
-@subsubheading Synopsis
+Show a single frame:
@smallexample
- -file-list-exec-source-files
+(@value{GDBP})
+-stack-list-frames 3 3
+^done,stack=
+[frame=@{level="3",addr="0x000107a4",func="foo",
+ file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@}]
+(@value{GDBP})
@end smallexample
-List the source files for the current executable.
-It will always output the filename, but only when GDB can find the absolute
-file name of a source file, will it output the fullname.
+@subheading The @code{-stack-list-locals} Command
+@findex -stack-list-locals
-@subsubheading @value{GDBN} Command
-
-The @value{GDBN} equivalent is @samp{info sources}.
-@code{gdbtk} has an analogous command @samp{gdb_listfiles}.
-
-@subsubheading Example
-@smallexample
-(@value{GDBP})
--file-list-exec-source-files
-^done,files=[
-@{file=foo.c,fullname=/home/foo.c@},
-@{file=/home/bar.c,fullname=/home/bar.c@},
-@{file=gdb_could_not_find_fullpath.c@}]
-(@value{GDBP})
-@end smallexample
-
-@subheading The @code{-file-list-shared-libraries} Command
-@findex -file-list-shared-libraries
-
-@subsubheading Synopsis
+@subsubheading Synopsis
@smallexample
- -file-list-shared-libraries
+ -stack-list-locals @var{print-values}
@end smallexample
-List the shared libraries in the program.
+Display the local variable names for the selected frame. If
+@var{print-values} is 0 or @code{--no-values}, print only the names of
+the variables; if it is 1 or @code{--all-values}, print also their
+values; and if it is 2 or @code{--simple-values}, print the name,
+type and value for simple data types and the name and type for arrays,
+structures and unions. In this last case, a frontend can immediately
+display the value of simple data types and create variable objects for
+other data types when the the user wishes to explore their values in
+more detail.
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{info shared}.
+@samp{info locals} in @value{GDBN}, @samp{gdb_get_locals} in @code{gdbtk}.
@subsubheading Example
-N.A.
-
-
-@subheading The @code{-file-list-symbol-files} Command
-@findex -file-list-symbol-files
-
-@subsubheading Synopsis
@smallexample
- -file-list-symbol-files
+(@value{GDBP})
+-stack-list-locals 0
+^done,locals=[name="A",name="B",name="C"]
+(@value{GDBP})
+-stack-list-locals --all-values
+^done,locals=[@{name="A",value="1"@},@{name="B",value="2"@},
+ @{name="C",value="@{1, 2, 3@}"@}]
+-stack-list-locals --simple-values
+^done,locals=[@{name="A",type="int",value="1"@},
+ @{name="B",type="int",value="2"@},@{name="C",type="int [3]"@}]
+(@value{GDBP})
@end smallexample
-List symbol files.
-
-@subsubheading @value{GDBN} Command
-
-The corresponding @value{GDBN} command is @samp{info file} (part of it).
-
-@subsubheading Example
-N.A.
-
-@subheading The @code{-file-symbol-file} Command
-@findex -file-symbol-file
+@subheading The @code{-stack-select-frame} Command
+@findex -stack-select-frame
@subsubheading Synopsis
@smallexample
- -file-symbol-file @var{file}
+ -stack-select-frame @var{framenum}
@end smallexample
-Read symbol table info from the specified @var{file} argument. When
-used without arguments, clears @value{GDBN}'s symbol table info. No output is
-produced, except for a completion notification.
+Change the selected frame. Select a different frame @var{framenum} on
+the stack.
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{symbol-file}.
+The corresponding @value{GDBN} commands are @samp{frame}, @samp{up},
+@samp{down}, @samp{select-frame}, @samp{up-silent}, and @samp{down-silent}.
@subsubheading Example
@smallexample
(@value{GDBP})
--file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
+-stack-select-frame 2
^done
(@value{GDBP})
@end smallexample
-@ignore
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-@node GDB/MI Kod Commands
-@section @sc{gdb/mi} Kod Commands
+@node GDB/MI Variable Objects
+@section @sc{gdb/mi} Variable Objects
-The Kod commands are not implemented.
-@c @subheading -kod-info
+@subheading Motivation for Variable Objects in @sc{gdb/mi}
-@c @subheading -kod-list
+For the implementation of a variable debugger window (locals, watched
+expressions, etc.), we are proposing the adaptation of the existing code
+used by @code{Insight}.
-@c @subheading -kod-list-object-types
+The two main reasons for that are:
-@c @subheading -kod-show
+@enumerate 1
+@item
+It has been proven in practice (it is already on its second generation).
-@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-@node GDB/MI Memory Overlay Commands
-@section @sc{gdb/mi} Memory Overlay Commands
+@item
+It will shorten development time (needless to say how important it is
+now).
+@end enumerate
-The memory overlay commands are not implemented.
+The original interface was designed to be used by Tcl code, so it was
+slightly changed so it could be used through @sc{gdb/mi}. This section
+describes the @sc{gdb/mi} operations that will be available and gives some
+hints about their use.
-@c @subheading -overlay-auto
+@emph{Note}: In addition to the set of operations described here, we
+expect the @sc{gui} implementation of a variable window to require, at
+least, the following operations:
-@c @subheading -overlay-list-mapping-state
+@itemize @bullet
+@item @code{-gdb-show} @code{output-radix}
+@item @code{-stack-list-arguments}
+@item @code{-stack-list-locals}
+@item @code{-stack-select-frame}
+@end itemize
-@c @subheading -overlay-list-overlays
+@subheading Introduction to Variable Objects in @sc{gdb/mi}
-@c @subheading -overlay-map
+@cindex variable objects in @sc{gdb/mi}
+The basic idea behind variable objects is the creation of a named object
+to represent a variable, an expression, a memory location or even a CPU
+register. For each object created, a set of operations is available for
+examining or changing its properties.
-@c @subheading -overlay-off
+Furthermore, complex data types, such as C structures, are represented
+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
+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.
-@c @subheading -overlay-on
+When returning the actual values of the objects, this facility allows
+for the individual selection of the display format used in the result
+creation. It can be chosen among: binary, decimal, hexadecimal, octal
+and natural. Natural refers to a default format automatically
+chosen based on the variable type (like decimal for an @code{int}, hex
+for pointers, etc.).
-@c @subheading -overlay-unmap
+The following is the complete set of @sc{gdb/mi} operations defined to
+access this functionality:
-@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-@node GDB/MI Signal Handling Commands
-@section @sc{gdb/mi} Signal Handling Commands
+@multitable @columnfractions .4 .6
+@item @strong{Operation}
+@tab @strong{Description}
-Signal handling commands are not implemented.
+@item @code{-var-create}
+@tab create a variable object
+@item @code{-var-delete}
+@tab delete the variable object and its children
+@item @code{-var-set-format}
+@tab set the display format of this variable
+@item @code{-var-show-format}
+@tab show the display format of this variable
+@item @code{-var-info-num-children}
+@tab tells how many children this object has
+@item @code{-var-list-children}
+@tab return a list of the object's children
+@item @code{-var-info-type}
+@tab show the type of this variable object
+@item @code{-var-info-expression}
+@tab print what this variable object represents
+@item @code{-var-show-attributes}
+@tab is this variable editable? does it exist here?
+@item @code{-var-evaluate-expression}
+@tab get the value of this variable
+@item @code{-var-assign}
+@tab set the value of this variable
+@item @code{-var-update}
+@tab update the variable and its children
+@end multitable
-@c @subheading -signal-handle
+In the next subsection we describe each operation in detail and suggest
+how it can be used.
-@c @subheading -signal-list-handle-actions
+@subheading Description And Use of Operations on Variable Objects
-@c @subheading -signal-list-signal-types
-@end ignore
+@subheading The @code{-var-create} Command
+@findex -var-create
+@subsubheading Synopsis
-@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-@node GDB/MI Stack Manipulation
-@section @sc{gdb/mi} Stack Manipulation Commands
+@smallexample
+ -var-create @{@var{name} | "-"@}
+ @{@var{frame-addr} | "*"@} @var{expression}
+@end smallexample
+
+This operation creates a variable object, which allows the monitoring of
+a variable, the result of an expression, a memory cell or a CPU
+register.
+The @var{name} parameter is the string by which the object can be
+referenced. It must be unique. If @samp{-} is specified, the varobj
+system will generate a string ``varNNNNNN'' automatically. It will be
+unique provided that one does not specify @var{name} on that format.
+The command fails if a duplicate name is found.
-@subheading The @code{-stack-info-frame} Command
-@findex -stack-info-frame
+The frame under which the expression should be evaluated can be
+specified by @var{frame-addr}. A @samp{*} indicates that the current
+frame should be used.
-@subsubheading Synopsis
+@var{expression} is any expression valid on the current language set (must not
+begin with a @samp{*}), or one of the following:
-@smallexample
- -stack-info-frame
-@end smallexample
+@itemize @bullet
+@item
+@samp{*@var{addr}}, where @var{addr} is the address of a memory cell
-Get info on the selected frame.
+@item
+@samp{*@var{addr}-@var{addr}} --- a memory address range (TBD)
-@subsubheading @value{GDBN} Command
+@item
+@samp{$@var{regname}} --- a CPU register name
+@end itemize
-The corresponding @value{GDBN} command is @samp{info frame} or @samp{frame}
-(without arguments).
+@subsubheading Result
-@subsubheading Example
+This operation returns the name, number of children and the type of the
+object created. Type is returned as a string as the ones generated by
+the @value{GDBN} CLI:
@smallexample
-(@value{GDBP})
--stack-info-frame
-^done,frame=@{level="1",addr="0x0001076c",func="callee3",
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
-fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="17"@}
-(@value{GDBP})
+ name="@var{name}",numchild="N",type="@var{type}"
@end smallexample
-@subheading The @code{-stack-info-depth} Command
-@findex -stack-info-depth
+
+@subheading The @code{-var-delete} Command
+@findex -var-delete
@subsubheading Synopsis
@smallexample
- -stack-info-depth [ @var{max-depth} ]
+ -var-delete @var{name}
@end smallexample
-Return the depth of the stack. If the integer argument @var{max-depth}
-is specified, do not count beyond @var{max-depth} frames.
+Deletes a previously created variable object and all of its children.
-@subsubheading @value{GDBN} Command
+Returns an error if the object @var{name} is not found.
-There's no equivalent @value{GDBN} command.
-@subsubheading Example
+@subheading The @code{-var-set-format} Command
+@findex -var-set-format
-For a stack with frame levels 0 through 11:
+@subsubheading Synopsis
@smallexample
-(@value{GDBP})
--stack-info-depth
-^done,depth="12"
-(@value{GDBP})
--stack-info-depth 4
-^done,depth="4"
-(@value{GDBP})
--stack-info-depth 12
-^done,depth="12"
-(@value{GDBP})
--stack-info-depth 11
-^done,depth="11"
-(@value{GDBP})
--stack-info-depth 13
-^done,depth="12"
-(@value{GDBP})
+ -var-set-format @var{name} @var{format-spec}
@end smallexample
-@subheading The @code{-stack-list-arguments} Command
-@findex -stack-list-arguments
+Sets the output format for the value of the object @var{name} to be
+@var{format-spec}.
+
+The syntax for the @var{format-spec} is as follows:
+
+@smallexample
+ @var{format-spec} @expansion{}
+ @{binary | decimal | hexadecimal | octal | natural@}
+@end smallexample
+
+
+@subheading The @code{-var-show-format} Command
+@findex -var-show-format
@subsubheading Synopsis
@smallexample
- -stack-list-arguments @var{show-values}
- [ @var{low-frame} @var{high-frame} ]
+ -var-show-format @var{name}
@end smallexample
-Display a list of the arguments for the frames between @var{low-frame}
-and @var{high-frame} (inclusive). If @var{low-frame} and
-@var{high-frame} are not provided, list the arguments for the whole call
-stack.
+Returns the format used to display the value of the object @var{name}.
-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
-means that both names and values of the arguments are printed.
+@smallexample
+ @var{format} @expansion{}
+ @var{format-spec}
+@end smallexample
-@subsubheading @value{GDBN} Command
-@value{GDBN} does not have an equivalent command. @code{gdbtk} has a
-@samp{gdb_get_args} command which partially overlaps with the
-functionality of @samp{-stack-list-arguments}.
+@subheading The @code{-var-info-num-children} Command
+@findex -var-info-num-children
+
+@subsubheading Synopsis
+
+@smallexample
+ -var-info-num-children @var{name}
+@end smallexample
+
+Returns the number of children of a variable object @var{name}:
+
+@smallexample
+ numchild=@var{n}
+@end smallexample
+
+
+@subheading The @code{-var-list-children} Command
+@findex -var-list-children
+
+@subsubheading Synopsis
+
+@smallexample
+ -var-list-children [@var{print-values}] @var{name}
+@end smallexample
+@anchor{-var-list-children}
+
+Return a list of the children of the specified variable object and
+create variable objects for them, if they do not already exist. With
+a single argument or if @var{print-values} has a value for of 0 or
+@code{--no-values}, print only the names of the variables; if
+@var{print-values} is 1 or @code{--all-values}, also print their
+values; and if it is 2 or @code{--simple-values} print the name and
+value for simple data types and just the name for arrays, structures
+and unions.
@subsubheading Example
@smallexample
(@value{GDBP})
--stack-list-frames
-^done,
-stack=[
-frame=@{level="0",addr="0x00010734",func="callee4",
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
-fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="8"@},
-frame=@{level="1",addr="0x0001076c",func="callee3",
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
-fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="17"@},
-frame=@{level="2",addr="0x0001078c",func="callee2",
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
-fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="22"@},
-frame=@{level="3",addr="0x000107b4",func="callee1",
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
-fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="27"@},
-frame=@{level="4",addr="0x000107e0",func="main",
-file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
-fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="32"@}]
-(@value{GDBP})
--stack-list-arguments 0
-^done,
-stack-args=[
-frame=@{level="0",args=[]@},
-frame=@{level="1",args=[name="strarg"]@},
-frame=@{level="2",args=[name="intarg",name="strarg"]@},
-frame=@{level="3",args=[name="intarg",name="strarg",name="fltarg"]@},
-frame=@{level="4",args=[]@}]
-(@value{GDBP})
--stack-list-arguments 1
-^done,
-stack-args=[
-frame=@{level="0",args=[]@},
-frame=@{level="1",
- args=[@{name="strarg",value="0x11940 \"A string argument.\""@}]@},
-frame=@{level="2",args=[
-@{name="intarg",value="2"@},
-@{name="strarg",value="0x11940 \"A string argument.\""@}]@},
-@{frame=@{level="3",args=[
-@{name="intarg",value="2"@},
-@{name="strarg",value="0x11940 \"A string argument.\""@},
-@{name="fltarg",value="3.5"@}]@},
-frame=@{level="4",args=[]@}]
-(@value{GDBP})
--stack-list-arguments 0 2 2
-^done,stack-args=[frame=@{level="2",args=[name="intarg",name="strarg"]@}]
-(@value{GDBP})
--stack-list-arguments 1 2 2
-^done,stack-args=[frame=@{level="2",
-args=[@{name="intarg",value="2"@},
-@{name="strarg",value="0x11940 \"A string argument.\""@}]@}]
+ -var-list-children n
+ ^done,numchild=@var{n},children=[@{name=@var{name},
+ numchild=@var{n},type=@var{type}@},@r{(repeats N times)}]
(@value{GDBP})
+ -var-list-children --all-values n
+ ^done,numchild=@var{n},children=[@{name=@var{name},
+ numchild=@var{n},value=@var{value},type=@var{type}@},@r{(repeats N times)}]
@end smallexample
-@c @subheading -stack-list-exception-handlers
+@subheading The @code{-var-info-type} Command
+@findex -var-info-type
-@subheading The @code{-stack-list-frames} Command
-@findex -stack-list-frames
+@subsubheading Synopsis
+
+@smallexample
+ -var-info-type @var{name}
+@end smallexample
+
+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
+@value{GDBN} CLI:
+
+@smallexample
+ type=@var{typename}
+@end smallexample
+
+
+@subheading The @code{-var-info-expression} Command
+@findex -var-info-expression
@subsubheading Synopsis
@smallexample
- -stack-list-frames [ @var{low-frame} @var{high-frame} ]
+ -var-info-expression @var{name}
@end smallexample
-List the frames currently on the stack. For each frame it displays the
-following info:
+Returns what is represented by the variable object @var{name}:
-@table @samp
-@item @var{level}
-The frame number, 0 being the topmost frame, i.e. the innermost function.
-@item @var{addr}
-The @code{$pc} value for that frame.
-@item @var{func}
-Function name.
-@item @var{file}
-File name of the source file where the function lives.
-@item @var{line}
-Line number corresponding to the @code{$pc}.
-@end table
+@smallexample
+ lang=@var{lang-spec},exp=@var{expression}
+@end smallexample
-If invoked without arguments, this command prints a backtrace for the
-whole stack. If given two integer arguments, it shows the frames whose
-levels are between the two arguments (inclusive). If the two arguments
-are equal, it shows the single frame at the corresponding level.
+@noindent
+where @var{lang-spec} is @code{@{"C" | "C++" | "Java"@}}.
-@subsubheading @value{GDBN} Command
+@subheading The @code{-var-show-attributes} Command
+@findex -var-show-attributes
-The corresponding @value{GDBN} commands are @samp{backtrace} and @samp{where}.
+@subsubheading Synopsis
-@subsubheading Example
+@smallexample
+ -var-show-attributes @var{name}
+@end smallexample
-Full stack backtrace:
+List attributes of the specified variable object @var{name}:
@smallexample
-(@value{GDBP})
--stack-list-frames
-^done,stack=
-[frame=@{level="0",addr="0x0001076c",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="11"@},
-frame=@{level="1",addr="0x000107a4",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
-frame=@{level="2",addr="0x000107a4",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
-frame=@{level="3",addr="0x000107a4",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
-frame=@{level="4",addr="0x000107a4",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
-frame=@{level="5",addr="0x000107a4",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
-frame=@{level="6",addr="0x000107a4",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
-frame=@{level="7",addr="0x000107a4",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
-frame=@{level="8",addr="0x000107a4",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
-frame=@{level="9",addr="0x000107a4",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
-frame=@{level="10",addr="0x000107a4",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
-frame=@{level="11",addr="0x00010738",func="main",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="4"@}]
-(@value{GDBP})
+ status=@var{attr} [ ( ,@var{attr} )* ]
@end smallexample
-Show frames between @var{low_frame} and @var{high_frame}:
+@noindent
+where @var{attr} is @code{@{ @{ editable | noneditable @} | TBD @}}.
+
+@subheading The @code{-var-evaluate-expression} Command
+@findex -var-evaluate-expression
+
+@subsubheading Synopsis
+
+@smallexample
+ -var-evaluate-expression @var{name}
+@end smallexample
+
+Evaluates the expression that is represented by the specified variable
+object and returns its value as a string in the current format specified
+for the object:
+
+@smallexample
+ value=@var{value}
+@end smallexample
+
+Note that one must invoke @code{-var-list-children} for a variable
+before the value of a child variable can be evaluated.
+
+@subheading The @code{-var-assign} Command
+@findex -var-assign
+
+@subsubheading Synopsis
+
+@smallexample
+ -var-assign @var{name} @var{expression}
+@end smallexample
+
+Assigns the value of @var{expression} to the variable object specified
+by @var{name}. The object must be @samp{editable}. If the variable's
+value is altered by the assign, the variable will show up in any
+subsequent @code{-var-update} list.
+
+@subsubheading Example
@smallexample
(@value{GDBP})
--stack-list-frames 3 5
-^done,stack=
-[frame=@{level="3",addr="0x000107a4",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
-frame=@{level="4",addr="0x000107a4",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
-frame=@{level="5",addr="0x000107a4",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@}]
+-var-assign var1 3
+^done,value="3"
+(@value{GDBP})
+-var-update *
+^done,changelist=[@{name="var1",in_scope="true",type_changed="false"@}]
(@value{GDBP})
@end smallexample
-Show a single frame:
+@subheading The @code{-var-update} Command
+@findex -var-update
+
+@subsubheading Synopsis
+
+@smallexample
+ -var-update [@var{print-values}] @{@var{name} | "*"@}
+@end smallexample
+
+Update the value of the variable object @var{name} by evaluating its
+expression after fetching all the new values from memory or registers.
+A @samp{*} causes all existing variable objects to be updated. The
+option @var{print-values} determines whether names both and values, or
+just names are printed in the manner described for
+@code{-var-list-children} (@pxref{-var-list-children}).
+
+@subsubheading Example
@smallexample
(@value{GDBP})
--stack-list-frames 3 3
-^done,stack=
-[frame=@{level="3",addr="0x000107a4",func="foo",
- file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@}]
+-var-assign var1 3
+^done,value="3"
+(@value{GDBP})
+-var-update --all-values var1
+^done,changelist=[@{name="var1",value="3",in_scope="true",
+type_changed="false"@}]
(@value{GDBP})
@end smallexample
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Data Manipulation
+@section @sc{gdb/mi} Data Manipulation
-@subheading The @code{-stack-list-locals} Command
-@findex -stack-list-locals
+@cindex data manipulation, in @sc{gdb/mi}
+@cindex @sc{gdb/mi}, data manipulation
+This section describes the @sc{gdb/mi} commands that manipulate data:
+examine memory and registers, evaluate expressions, etc.
+
+@c REMOVED FROM THE INTERFACE.
+@c @subheading -data-assign
+@c Change the value of a program variable. Plenty of side effects.
+@c @subsubheading GDB command
+@c set variable
+@c @subsubheading Example
+@c N.A.
+
+@subheading The @code{-data-disassemble} Command
+@findex -data-disassemble
@subsubheading Synopsis
@smallexample
- -stack-list-locals @var{print-values}
+ -data-disassemble
+ [ -s @var{start-addr} -e @var{end-addr} ]
+ | [ -f @var{filename} -l @var{linenum} [ -n @var{lines} ] ]
+ -- @var{mode}
@end smallexample
-Display the local variable names for the selected frame. If
-@var{print-values} is 0 or @code{--no-values}, print only the names of
-the variables; if it is 1 or @code{--all-values}, print also their
-values; and if it is 2 or @code{--simple-values}, print the name,
-type and value for simple data types and the name and type for arrays,
-structures and unions. In this last case, a frontend can immediately
-display the value of simple data types and create variable objects for
-other data types when the the user wishes to explore their values in
-more detail.
+@noindent
+Where:
+
+@table @samp
+@item @var{start-addr}
+is the beginning address (or @code{$pc})
+@item @var{end-addr}
+is the end address
+@item @var{filename}
+is the name of the file to disassemble
+@item @var{linenum}
+is the line number to disassemble around
+@item @var{lines}
+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
+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{start-addr} and @var{end-addr}, only @var{lines} lines are
+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}
+are displayed.
+@item @var{mode}
+is either 0 (meaning only disassembly) or 1 (meaning mixed source and
+disassembly).
+@end table
+
+@subsubheading Result
+
+The output for each instruction is composed of four fields:
+
+@itemize @bullet
+@item Address
+@item Func-name
+@item Offset
+@item Instruction
+@end itemize
+
+Note that whatever included in the instruction field, is not manipulated
+directely by @sc{gdb/mi}, i.e. it is not possible to adjust its format.
@subsubheading @value{GDBN} Command
-@samp{info locals} in @value{GDBN}, @samp{gdb_get_locals} in @code{gdbtk}.
+There's no direct mapping from this command to the CLI.
@subsubheading Example
+Disassemble from the current value of @code{$pc} to @code{$pc + 20}:
+
@smallexample
(@value{GDBP})
--stack-list-locals 0
-^done,locals=[name="A",name="B",name="C"]
+-data-disassemble -s $pc -e "$pc + 20" -- 0
+^done,
+asm_insns=[
+@{address="0x000107c0",func-name="main",offset="4",
+inst="mov 2, %o0"@},
+@{address="0x000107c4",func-name="main",offset="8",
+inst="sethi %hi(0x11800), %o2"@},
+@{address="0x000107c8",func-name="main",offset="12",
+inst="or %o2, 0x140, %o1\t! 0x11940 <_lib_version+8>"@},
+@{address="0x000107cc",func-name="main",offset="16",
+inst="sethi %hi(0x11800), %o2"@},
+@{address="0x000107d0",func-name="main",offset="20",
+inst="or %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"@}]
(@value{GDBP})
--stack-list-locals --all-values
-^done,locals=[@{name="A",value="1"@},@{name="B",value="2"@},
- @{name="C",value="@{1, 2, 3@}"@}]
--stack-list-locals --simple-values
-^done,locals=[@{name="A",type="int",value="1"@},
- @{name="B",type="int",value="2"@},@{name="C",type="int [3]"@}]
+@end smallexample
+
+Disassemble the whole @code{main} function. Line 32 is part of
+@code{main}.
+
+@smallexample
+-data-disassemble -f basics.c -l 32 -- 0
+^done,asm_insns=[
+@{address="0x000107bc",func-name="main",offset="0",
+inst="save %sp, -112, %sp"@},
+@{address="0x000107c0",func-name="main",offset="4",
+inst="mov 2, %o0"@},
+@{address="0x000107c4",func-name="main",offset="8",
+inst="sethi %hi(0x11800), %o2"@},
+[@dots{}]
+@{address="0x0001081c",func-name="main",offset="96",inst="ret "@},
+@{address="0x00010820",func-name="main",offset="100",inst="restore "@}]
(@value{GDBP})
@end smallexample
+Disassemble 3 instructions from the start of @code{main}:
-@subheading The @code{-stack-select-frame} Command
-@findex -stack-select-frame
+@smallexample
+(@value{GDBP})
+-data-disassemble -f basics.c -l 32 -n 3 -- 0
+^done,asm_insns=[
+@{address="0x000107bc",func-name="main",offset="0",
+inst="save %sp, -112, %sp"@},
+@{address="0x000107c0",func-name="main",offset="4",
+inst="mov 2, %o0"@},
+@{address="0x000107c4",func-name="main",offset="8",
+inst="sethi %hi(0x11800), %o2"@}]
+(@value{GDBP})
+@end smallexample
+
+Disassemble 3 instructions from the start of @code{main} in mixed mode:
+
+@smallexample
+(@value{GDBP})
+-data-disassemble -f basics.c -l 32 -n 3 -- 1
+^done,asm_insns=[
+src_and_asm_line=@{line="31",
+file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
+ testsuite/gdb.mi/basics.c",line_asm_insn=[
+@{address="0x000107bc",func-name="main",offset="0",
+inst="save %sp, -112, %sp"@}]@},
+src_and_asm_line=@{line="32",
+file="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb/ \
+ testsuite/gdb.mi/basics.c",line_asm_insn=[
+@{address="0x000107c0",func-name="main",offset="4",
+inst="mov 2, %o0"@},
+@{address="0x000107c4",func-name="main",offset="8",
+inst="sethi %hi(0x11800), %o2"@}]@}]
+(@value{GDBP})
+@end smallexample
+
+
+@subheading The @code{-data-evaluate-expression} Command
+@findex -data-evaluate-expression
@subsubheading Synopsis
@smallexample
- -stack-select-frame @var{framenum}
+ -data-evaluate-expression @var{expr}
@end smallexample
-Change the selected frame. Select a different frame @var{framenum} on
-the stack.
+Evaluate @var{expr} as an expression. The expression could contain an
+inferior function call. The function call will execute synchronously.
+If the expression contains spaces, it must be enclosed in double quotes.
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} commands are @samp{frame}, @samp{up},
-@samp{down}, @samp{select-frame}, @samp{up-silent}, and @samp{down-silent}.
+The corresponding @value{GDBN} commands are @samp{print}, @samp{output}, and
+@samp{call}. In @code{gdbtk} only, there's a corresponding
+@samp{gdb_eval} command.
@subsubheading Example
+In the following example, the numbers that precede the commands are the
+@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
+output.
+
@smallexample
+211-data-evaluate-expression A
+211^done,value="1"
(@value{GDBP})
--stack-select-frame 2
-^done
+311-data-evaluate-expression &A
+311^done,value="0xefffeb7c"
(@value{GDBP})
-@end smallexample
-
-@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-@node GDB/MI Symbol Query
-@section @sc{gdb/mi} Symbol Query Commands
+411-data-evaluate-expression A+3
+411^done,value="4"
+(@value{GDBP})
+511-data-evaluate-expression "A + 3"
+511^done,value="4"
+(@value{GDBP})
+@end smallexample
-@subheading The @code{-symbol-info-address} Command
-@findex -symbol-info-address
+@subheading The @code{-data-list-changed-registers} Command
+@findex -data-list-changed-registers
@subsubheading Synopsis
@smallexample
- -symbol-info-address @var{symbol}
+ -data-list-changed-registers
@end smallexample
-Describe where @var{symbol} is stored.
+Display a list of the registers that have changed.
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{info address}.
+@value{GDBN} doesn't have a direct analog for this command; @code{gdbtk}
+has the corresponding command @samp{gdb_changed_register_list}.
@subsubheading Example
-N.A.
-
-
-@subheading The @code{-symbol-info-file} Command
-@findex -symbol-info-file
-@subsubheading Synopsis
+On a PPC MBX board:
@smallexample
- -symbol-info-file
-@end smallexample
-
-Show the file for the symbol.
-
-@subsubheading @value{GDBN} Command
-
-There's no equivalent @value{GDBN} command. @code{gdbtk} has
-@samp{gdb_find_file}.
+(@value{GDBP})
+-exec-continue
+^running
-@subsubheading Example
-N.A.
+(@value{GDBP})
+*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
+args=[],file="try.c",fullname="/home/foo/bar/try.c",line="5"@}
+(@value{GDBP})
+-data-list-changed-registers
+^done,changed-registers=["0","1","2","4","5","6","7","8","9",
+"10","11","13","14","15","16","17","18","19","20","21","22","23",
+"24","25","26","27","28","30","31","64","65","66","67","69"]
+(@value{GDBP})
+@end smallexample
-@subheading The @code{-symbol-info-function} Command
-@findex -symbol-info-function
+@subheading The @code{-data-list-register-names} Command
+@findex -data-list-register-names
@subsubheading Synopsis
@smallexample
- -symbol-info-function
+ -data-list-register-names [ ( @var{regno} )+ ]
@end smallexample
-Show which function the symbol lives in.
+Show a list of register names for the current target. If no arguments
+are given, it shows a list of the names of all the registers. If
+integer numbers are given as arguments, it will print a list of the
+names of the registers corresponding to the arguments. To ensure
+consistency between a register name and its number, the output list may
+include empty register names.
@subsubheading @value{GDBN} Command
-@samp{gdb_get_function} in @code{gdbtk}.
+@value{GDBN} does not have a command which corresponds to
+@samp{-data-list-register-names}. In @code{gdbtk} there is a
+corresponding command @samp{gdb_regnames}.
@subsubheading Example
-N.A.
+For the PPC MBX board:
+@smallexample
+(@value{GDBP})
+-data-list-register-names
+^done,register-names=["r0","r1","r2","r3","r4","r5","r6","r7",
+"r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18",
+"r19","r20","r21","r22","r23","r24","r25","r26","r27","r28","r29",
+"r30","r31","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9",
+"f10","f11","f12","f13","f14","f15","f16","f17","f18","f19","f20",
+"f21","f22","f23","f24","f25","f26","f27","f28","f29","f30","f31",
+"", "pc","ps","cr","lr","ctr","xer"]
+(@value{GDBP})
+-data-list-register-names 1 2 3
+^done,register-names=["r1","r2","r3"]
+(@value{GDBP})
+@end smallexample
-@subheading The @code{-symbol-info-line} Command
-@findex -symbol-info-line
+@subheading The @code{-data-list-register-values} Command
+@findex -data-list-register-values
@subsubheading Synopsis
@smallexample
- -symbol-info-line
+ -data-list-register-values @var{fmt} [ ( @var{regno} )*]
@end smallexample
-Show the core addresses of the code for a source line.
+Display the registers' contents. @var{fmt} is the format according to
+which the registers' contents are to be returned, followed by an optional
+list of numbers specifying the registers to display. A missing list of
+numbers indicates that the contents of all the registers must be returned.
+
+Allowed formats for @var{fmt} are:
+
+@table @code
+@item x
+Hexadecimal
+@item o
+Octal
+@item t
+Binary
+@item d
+Decimal
+@item r
+Raw
+@item N
+Natural
+@end table
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{info line}.
-@code{gdbtk} has the @samp{gdb_get_line} and @samp{gdb_get_file} commands.
+The corresponding @value{GDBN} commands are @samp{info reg}, @samp{info
+all-reg}, and (in @code{gdbtk}) @samp{gdb_fetch_registers}.
@subsubheading Example
-N.A.
+For a PPC MBX board (note: line breaks are for readability only, they
+don't appear in the actual output):
+
+@smallexample
+(@value{GDBP})
+-data-list-register-values r 64 65
+^done,register-values=[@{number="64",value="0xfe00a300"@},
+@{number="65",value="0x00029002"@}]
+(@value{GDBP})
+-data-list-register-values x
+^done,register-values=[@{number="0",value="0xfe0043c8"@},
+@{number="1",value="0x3fff88"@},@{number="2",value="0xfffffffe"@},
+@{number="3",value="0x0"@},@{number="4",value="0xa"@},
+@{number="5",value="0x3fff68"@},@{number="6",value="0x3fff58"@},
+@{number="7",value="0xfe011e98"@},@{number="8",value="0x2"@},
+@{number="9",value="0xfa202820"@},@{number="10",value="0xfa202808"@},
+@{number="11",value="0x1"@},@{number="12",value="0x0"@},
+@{number="13",value="0x4544"@},@{number="14",value="0xffdfffff"@},
+@{number="15",value="0xffffffff"@},@{number="16",value="0xfffffeff"@},
+@{number="17",value="0xefffffed"@},@{number="18",value="0xfffffffe"@},
+@{number="19",value="0xffffffff"@},@{number="20",value="0xffffffff"@},
+@{number="21",value="0xffffffff"@},@{number="22",value="0xfffffff7"@},
+@{number="23",value="0xffffffff"@},@{number="24",value="0xffffffff"@},
+@{number="25",value="0xffffffff"@},@{number="26",value="0xfffffffb"@},
+@{number="27",value="0xffffffff"@},@{number="28",value="0xf7bfffff"@},
+@{number="29",value="0x0"@},@{number="30",value="0xfe010000"@},
+@{number="31",value="0x0"@},@{number="32",value="0x0"@},
+@{number="33",value="0x0"@},@{number="34",value="0x0"@},
+@{number="35",value="0x0"@},@{number="36",value="0x0"@},
+@{number="37",value="0x0"@},@{number="38",value="0x0"@},
+@{number="39",value="0x0"@},@{number="40",value="0x0"@},
+@{number="41",value="0x0"@},@{number="42",value="0x0"@},
+@{number="43",value="0x0"@},@{number="44",value="0x0"@},
+@{number="45",value="0x0"@},@{number="46",value="0x0"@},
+@{number="47",value="0x0"@},@{number="48",value="0x0"@},
+@{number="49",value="0x0"@},@{number="50",value="0x0"@},
+@{number="51",value="0x0"@},@{number="52",value="0x0"@},
+@{number="53",value="0x0"@},@{number="54",value="0x0"@},
+@{number="55",value="0x0"@},@{number="56",value="0x0"@},
+@{number="57",value="0x0"@},@{number="58",value="0x0"@},
+@{number="59",value="0x0"@},@{number="60",value="0x0"@},
+@{number="61",value="0x0"@},@{number="62",value="0x0"@},
+@{number="63",value="0x0"@},@{number="64",value="0xfe00a300"@},
+@{number="65",value="0x29002"@},@{number="66",value="0x202f04b5"@},
+@{number="67",value="0xfe0043b0"@},@{number="68",value="0xfe00b3e4"@},
+@{number="69",value="0x20002b03"@}]
+(@value{GDBP})
+@end smallexample
-@subheading The @code{-symbol-info-symbol} Command
-@findex -symbol-info-symbol
+
+@subheading The @code{-data-read-memory} Command
+@findex -data-read-memory
@subsubheading Synopsis
@smallexample
- -symbol-info-symbol @var{addr}
+ -data-read-memory [ -o @var{byte-offset} ]
+ @var{address} @var{word-format} @var{word-size}
+ @var{nr-rows} @var{nr-cols} [ @var{aschar} ]
@end smallexample
-Describe what symbol is at location @var{addr}.
+@noindent
+where:
-@subsubheading @value{GDBN} Command
+@table @samp
+@item @var{address}
+An expression specifying the address of the first memory word to be
+read. Complex expressions containing embedded white space should be
+quoted using the C convention.
-The corresponding @value{GDBN} command is @samp{info symbol}.
+@item @var{word-format}
+The format to be used to print the memory words. The notation is the
+same as for @value{GDBN}'s @code{print} command (@pxref{Output Formats,
+,Output formats}).
-@subsubheading Example
-N.A.
+@item @var{word-size}
+The size of each memory word in bytes.
+@item @var{nr-rows}
+The number of rows in the output table.
-@subheading The @code{-symbol-list-functions} Command
-@findex -symbol-list-functions
+@item @var{nr-cols}
+The number of columns in the output table.
-@subsubheading Synopsis
+@item @var{aschar}
+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
+member of the printable @sc{ascii} character set (printable @sc{ascii}
+characters are those whose code is between 32 and 126, inclusively).
-@smallexample
- -symbol-list-functions
-@end smallexample
+@item @var{byte-offset}
+An offset to add to the @var{address} before fetching memory.
+@end table
-List the functions in the executable.
+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,
+@code{@var{nr-rows} * @var{nr-cols} * @var{word-size}} bytes are read
+(returned as @samp{total-bytes}). Should less than the requested number
+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
+in @samp{nr-bytes} and the starting address used to read memory in
+@samp{addr}.
+
+The address of the next/previous row or page is available in
+@samp{next-row} and @samp{prev-row}, @samp{next-page} and
+@samp{prev-page}.
@subsubheading @value{GDBN} Command
-@samp{info functions} in @value{GDBN}, @samp{gdb_listfunc} and
-@samp{gdb_search} in @code{gdbtk}.
+The corresponding @value{GDBN} command is @samp{x}. @code{gdbtk} has
+@samp{gdb_get_mem} memory read command.
@subsubheading Example
-N.A.
-
-
-@subheading The @code{-symbol-list-lines} Command
-@findex -symbol-list-lines
-@subsubheading Synopsis
+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
+word. Display each word in hex.
@smallexample
- -symbol-list-lines @var{filename}
+(@value{GDBP})
+9-data-read-memory -o -6 -- bytes+6 x 1 3 2
+9^done,addr="0x00001390",nr-bytes="6",total-bytes="6",
+next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396",
+prev-page="0x0000138a",memory=[
+@{addr="0x00001390",data=["0x00","0x01"]@},
+@{addr="0x00001392",data=["0x02","0x03"]@},
+@{addr="0x00001394",data=["0x04","0x05"]@}]
+(@value{GDBP})
@end smallexample
-Print the list of lines that contain code and their associated program
-addresses for the given source filename. The entries are sorted in
-ascending PC order.
-
-@subsubheading @value{GDBN} Command
-
-There is no corresponding @value{GDBN} command.
+Read two bytes of memory starting at address @code{shorts + 64} and
+display as a single word formatted in decimal.
-@subsubheading Example
@smallexample
(@value{GDBP})
--symbol-list-lines basics.c
-^done,lines=[@{pc="0x08048554",line="7"@},@{pc="0x0804855a",line="8"@}]
+5-data-read-memory shorts+64 d 2 1 1
+5^done,addr="0x00001510",nr-bytes="2",total-bytes="2",
+next-row="0x00001512",prev-row="0x0000150e",
+next-page="0x00001512",prev-page="0x0000150e",memory=[
+@{addr="0x00001510",data=["128"]@}]
(@value{GDBP})
@end smallexample
-
-@subheading The @code{-symbol-list-types} Command
-@findex -symbol-list-types
-
-@subsubheading Synopsis
+Read thirty two bytes of memory starting at @code{bytes+16} and format
+as eight rows of four columns. Include a string encoding with @samp{x}
+used as the non-printable character.
@smallexample
- -symbol-list-types
+(@value{GDBP})
+4-data-read-memory bytes+16 x 1 8 4 x
+4^done,addr="0x000013a0",nr-bytes="32",total-bytes="32",
+next-row="0x000013c0",prev-row="0x0000139c",
+next-page="0x000013c0",prev-page="0x00001380",memory=[
+@{addr="0x000013a0",data=["0x10","0x11","0x12","0x13"],ascii="xxxx"@},
+@{addr="0x000013a4",data=["0x14","0x15","0x16","0x17"],ascii="xxxx"@},
+@{addr="0x000013a8",data=["0x18","0x19","0x1a","0x1b"],ascii="xxxx"@},
+@{addr="0x000013ac",data=["0x1c","0x1d","0x1e","0x1f"],ascii="xxxx"@},
+@{addr="0x000013b0",data=["0x20","0x21","0x22","0x23"],ascii=" !\"#"@},
+@{addr="0x000013b4",data=["0x24","0x25","0x26","0x27"],ascii="$%&'"@},
+@{addr="0x000013b8",data=["0x28","0x29","0x2a","0x2b"],ascii="()*+"@},
+@{addr="0x000013bc",data=["0x2c","0x2d","0x2e","0x2f"],ascii=",-./"@}]
+(@value{GDBP})
@end smallexample
-List all the type names.
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Tracepoint Commands
+@section @sc{gdb/mi} Tracepoint Commands
-@subsubheading @value{GDBN} Command
+The tracepoint commands are not yet implemented.
-The corresponding commands are @samp{info types} in @value{GDBN},
-@samp{gdb_search} in @code{gdbtk}.
+@c @subheading -trace-actions
-@subsubheading Example
-N.A.
+@c @subheading -trace-delete
+@c @subheading -trace-disable
-@subheading The @code{-symbol-list-variables} Command
-@findex -symbol-list-variables
+@c @subheading -trace-dump
-@subsubheading Synopsis
+@c @subheading -trace-enable
-@smallexample
- -symbol-list-variables
-@end smallexample
+@c @subheading -trace-exists
-List all the global and static variable names.
+@c @subheading -trace-find
-@subsubheading @value{GDBN} Command
+@c @subheading -trace-frame-number
-@samp{info variables} in @value{GDBN}, @samp{gdb_search} in @code{gdbtk}.
+@c @subheading -trace-info
-@subsubheading Example
-N.A.
+@c @subheading -trace-insert
+@c @subheading -trace-list
-@subheading The @code{-symbol-locate} Command
-@findex -symbol-locate
+@c @subheading -trace-pass-count
-@subsubheading Synopsis
+@c @subheading -trace-save
-@smallexample
- -symbol-locate
-@end smallexample
+@c @subheading -trace-start
-@subsubheading @value{GDBN} Command
+@c @subheading -trace-stop
-@samp{gdb_loc} in @code{gdbtk}.
-@subsubheading Example
-N.A.
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Symbol Query
+@section @sc{gdb/mi} Symbol Query Commands
-@subheading The @code{-symbol-type} Command
-@findex -symbol-type
+@subheading The @code{-symbol-info-address} Command
+@findex -symbol-info-address
@subsubheading Synopsis
@smallexample
- -symbol-type @var{variable}
+ -symbol-info-address @var{symbol}
@end smallexample
-Show type of @var{variable}.
+Describe where @var{symbol} is stored.
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{ptype}, @code{gdbtk} has
-@samp{gdb_obj_variable}.
+The corresponding @value{GDBN} command is @samp{info address}.
@subsubheading Example
N.A.
-@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-@node GDB/MI Target Manipulation
-@section @sc{gdb/mi} Target Manipulation Commands
-
-
-@subheading The @code{-target-attach} Command
-@findex -target-attach
+@subheading The @code{-symbol-info-file} Command
+@findex -symbol-info-file
@subsubheading Synopsis
@smallexample
- -target-attach @var{pid} | @var{file}
+ -symbol-info-file
@end smallexample
-Attach to a process @var{pid} or a file @var{file} outside of @value{GDBN}.
+Show the file for the symbol.
-@subsubheading @value{GDBN} command
+@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{attach}.
+There's no equivalent @value{GDBN} command. @code{gdbtk} has
+@samp{gdb_find_file}.
@subsubheading Example
N.A.
-@subheading The @code{-target-compare-sections} Command
-@findex -target-compare-sections
+@subheading The @code{-symbol-info-function} Command
+@findex -symbol-info-function
@subsubheading Synopsis
@smallexample
- -target-compare-sections [ @var{section} ]
+ -symbol-info-function
@end smallexample
-Compare data of section @var{section} on target to the exec file.
-Without the argument, all sections are compared.
+Show which function the symbol lives in.
@subsubheading @value{GDBN} Command
-The @value{GDBN} equivalent is @samp{compare-sections}.
+@samp{gdb_get_function} in @code{gdbtk}.
@subsubheading Example
N.A.
-@subheading The @code{-target-detach} Command
-@findex -target-detach
+@subheading The @code{-symbol-info-line} Command
+@findex -symbol-info-line
@subsubheading Synopsis
@smallexample
- -target-detach
+ -symbol-info-line
@end smallexample
-Detach from the remote target which normally resumes its execution.
-There's no output.
+Show the core addresses of the code for a source line.
-@subsubheading @value{GDBN} command
+@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{detach}.
+The corresponding @value{GDBN} command is @samp{info line}.
+@code{gdbtk} has the @samp{gdb_get_line} and @samp{gdb_get_file} commands.
@subsubheading Example
-
-@smallexample
-(@value{GDBP})
--target-detach
-^done
-(@value{GDBP})
-@end smallexample
+N.A.
-@subheading The @code{-target-disconnect} Command
-@findex -target-disconnect
+@subheading The @code{-symbol-info-symbol} Command
+@findex -symbol-info-symbol
@subsubheading Synopsis
-@example
- -target-disconnect
-@end example
+@smallexample
+ -symbol-info-symbol @var{addr}
+@end smallexample
-Disconnect from the remote target. There's no output and the target is
-generally not resumed.
+Describe what symbol is at location @var{addr}.
-@subsubheading @value{GDBN} command
+@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{disconnect}.
+The corresponding @value{GDBN} command is @samp{info symbol}.
@subsubheading Example
-
-@smallexample
-(@value{GDBP})
--target-disconnect
-^done
-(@value{GDBP})
-@end smallexample
+N.A.
-@subheading The @code{-target-download} Command
-@findex -target-download
+@subheading The @code{-symbol-list-functions} Command
+@findex -symbol-list-functions
@subsubheading Synopsis
@smallexample
- -target-download
+ -symbol-list-functions
@end smallexample
-Loads the executable onto the remote target.
-It prints out an update message every half second, which includes the fields:
-
-@table @samp
-@item section
-The name of the section.
-@item section-sent
-The size of what has been sent so far for that section.
-@item section-size
-The size of the section.
-@item total-sent
-The total size of what was sent so far (the current and the previous sections).
-@item total-size
-The size of the overall executable to download.
-@end table
-
-@noindent
-Each message is sent as status record (@pxref{GDB/MI Output Syntax, ,
-@sc{gdb/mi} Output Syntax}).
-
-In addition, it prints the name and size of the sections, as they are
-downloaded. These messages include the following fields:
-
-@table @samp
-@item section
-The name of the section.
-@item section-size
-The size of the section.
-@item total-size
-The size of the overall executable to download.
-@end table
-
-@noindent
-At the end, a summary is printed.
+List the functions in the executable.
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{load}.
+@samp{info functions} in @value{GDBN}, @samp{gdb_listfunc} and
+@samp{gdb_search} in @code{gdbtk}.
@subsubheading Example
-
-Note: each status message appears on a single line. Here the messages
-have been broken down so that they can fit onto a page.
-
-@smallexample
-(@value{GDBP})
--target-download
-+download,@{section=".text",section-size="6668",total-size="9880"@}
-+download,@{section=".text",section-sent="512",section-size="6668",
-total-sent="512",total-size="9880"@}
-+download,@{section=".text",section-sent="1024",section-size="6668",
-total-sent="1024",total-size="9880"@}
-+download,@{section=".text",section-sent="1536",section-size="6668",
-total-sent="1536",total-size="9880"@}
-+download,@{section=".text",section-sent="2048",section-size="6668",
-total-sent="2048",total-size="9880"@}
-+download,@{section=".text",section-sent="2560",section-size="6668",
-total-sent="2560",total-size="9880"@}
-+download,@{section=".text",section-sent="3072",section-size="6668",
-total-sent="3072",total-size="9880"@}
-+download,@{section=".text",section-sent="3584",section-size="6668",
-total-sent="3584",total-size="9880"@}
-+download,@{section=".text",section-sent="4096",section-size="6668",
-total-sent="4096",total-size="9880"@}
-+download,@{section=".text",section-sent="4608",section-size="6668",
-total-sent="4608",total-size="9880"@}
-+download,@{section=".text",section-sent="5120",section-size="6668",
-total-sent="5120",total-size="9880"@}
-+download,@{section=".text",section-sent="5632",section-size="6668",
-total-sent="5632",total-size="9880"@}
-+download,@{section=".text",section-sent="6144",section-size="6668",
-total-sent="6144",total-size="9880"@}
-+download,@{section=".text",section-sent="6656",section-size="6668",
-total-sent="6656",total-size="9880"@}
-+download,@{section=".init",section-size="28",total-size="9880"@}
-+download,@{section=".fini",section-size="28",total-size="9880"@}
-+download,@{section=".data",section-size="3156",total-size="9880"@}
-+download,@{section=".data",section-sent="512",section-size="3156",
-total-sent="7236",total-size="9880"@}
-+download,@{section=".data",section-sent="1024",section-size="3156",
-total-sent="7748",total-size="9880"@}
-+download,@{section=".data",section-sent="1536",section-size="3156",
-total-sent="8260",total-size="9880"@}
-+download,@{section=".data",section-sent="2048",section-size="3156",
-total-sent="8772",total-size="9880"@}
-+download,@{section=".data",section-sent="2560",section-size="3156",
-total-sent="9284",total-size="9880"@}
-+download,@{section=".data",section-sent="3072",section-size="3156",
-total-sent="9796",total-size="9880"@}
-^done,address="0x10004",load-size="9880",transfer-rate="6586",
-write-rate="429"
-(@value{GDBP})
-@end smallexample
+N.A.
-@subheading The @code{-target-exec-status} Command
-@findex -target-exec-status
+@subheading The @code{-symbol-list-lines} Command
+@findex -symbol-list-lines
@subsubheading Synopsis
@smallexample
- -target-exec-status
+ -symbol-list-lines @var{filename}
@end smallexample
-Provide information on the state of the target (whether it is running or
-not, for instance).
+Print the list of lines that contain code and their associated program
+addresses for the given source filename. The entries are sorted in
+ascending PC order.
@subsubheading @value{GDBN} Command
-There's no equivalent @value{GDBN} command.
+There is no corresponding @value{GDBN} command.
@subsubheading Example
-N.A.
+@smallexample
+(@value{GDBP})
+-symbol-list-lines basics.c
+^done,lines=[@{pc="0x08048554",line="7"@},@{pc="0x0804855a",line="8"@}]
+(@value{GDBP})
+@end smallexample
-@subheading The @code{-target-list-available-targets} Command
-@findex -target-list-available-targets
+@subheading The @code{-symbol-list-types} Command
+@findex -symbol-list-types
@subsubheading Synopsis
@smallexample
- -target-list-available-targets
+ -symbol-list-types
@end smallexample
-List the possible targets to connect to.
+List all the type names.
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{help target}.
+The corresponding commands are @samp{info types} in @value{GDBN},
+@samp{gdb_search} in @code{gdbtk}.
@subsubheading Example
N.A.
-@subheading The @code{-target-list-current-targets} Command
-@findex -target-list-current-targets
+@subheading The @code{-symbol-list-variables} Command
+@findex -symbol-list-variables
@subsubheading Synopsis
@smallexample
- -target-list-current-targets
+ -symbol-list-variables
@end smallexample
-Describe the current target.
+List all the global and static variable names.
@subsubheading @value{GDBN} Command
-The corresponding information is printed by @samp{info file} (among
-other things).
+@samp{info variables} in @value{GDBN}, @samp{gdb_search} in @code{gdbtk}.
@subsubheading Example
N.A.
-@subheading The @code{-target-list-parameters} Command
-@findex -target-list-parameters
+@subheading The @code{-symbol-locate} Command
+@findex -symbol-locate
@subsubheading Synopsis
@smallexample
- -target-list-parameters
+ -symbol-locate
@end smallexample
-@c ????
-
@subsubheading @value{GDBN} Command
-No equivalent.
+@samp{gdb_loc} in @code{gdbtk}.
@subsubheading Example
N.A.
-@subheading The @code{-target-select} Command
-@findex -target-select
+@subheading The @code{-symbol-type} Command
+@findex -symbol-type
@subsubheading Synopsis
@smallexample
- -target-select @var{type} @var{parameters @dots{}}
+ -symbol-type @var{variable}
@end smallexample
-Connect @value{GDBN} to the remote target. This command takes two args:
+Show type of @var{variable}.
-@table @samp
-@item @var{type}
-The type of target, for instance @samp{async}, @samp{remote}, etc.
-@item @var{parameters}
-Device names, host names and the like. @xref{Target Commands, ,
-Commands for managing targets}, for more details.
-@end table
+@subsubheading @value{GDBN} Command
-The output is a connection notification, followed by the address at
-which the target program is, in the following form:
+The corresponding @value{GDBN} command is @samp{ptype}, @code{gdbtk} has
+@samp{gdb_obj_variable}.
+
+@subsubheading Example
+N.A.
+
+
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI File Commands
+@section @sc{gdb/mi} File Commands
+
+This section describes the GDB/MI commands to specify executable file names
+and to read in and obtain symbol table information.
+
+@subheading The @code{-file-exec-and-symbols} Command
+@findex -file-exec-and-symbols
+
+@subsubheading Synopsis
@smallexample
-^connected,addr="@var{address}",func="@var{function name}",
- args=[@var{arg list}]
+ -file-exec-and-symbols @var{file}
@end smallexample
+Specify the executable file to be debugged. This file is the one from
+which the symbol table is also read. If no file is specified, the
+command clears the executable and symbol information. If breakpoints
+are set when using this command with no arguments, @value{GDBN} will produce
+error messages. Otherwise, no output is produced, except a completion
+notification.
+
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{target}.
+The corresponding @value{GDBN} command is @samp{file}.
@subsubheading Example
@smallexample
(@value{GDBP})
--target-select async /dev/ttya
-^connected,addr="0xfe00a300",func="??",args=[]
+-file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
+^done
(@value{GDBP})
@end smallexample
-@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-@node GDB/MI Thread Commands
-@section @sc{gdb/mi} Thread Commands
-
-@subheading The @code{-thread-info} Command
-@findex -thread-info
+@subheading The @code{-file-exec-file} Command
+@findex -file-exec-file
@subsubheading Synopsis
@smallexample
- -thread-info
+ -file-exec-file @var{file}
@end smallexample
-@subsubheading @value{GDBN} command
+Specify the executable file to be debugged. Unlike
+@samp{-file-exec-and-symbols}, the symbol table is @emph{not} read
+from this file. If used without argument, @value{GDBN} clears the information
+about the executable file. No output is produced, except a completion
+notification.
-No equivalent.
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{exec-file}.
@subsubheading Example
-N.A.
+
+@smallexample
+(@value{GDBP})
+-file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
+^done
+(@value{GDBP})
+@end smallexample
-@subheading The @code{-thread-list-all-threads} Command
-@findex -thread-list-all-threads
+@subheading The @code{-file-list-exec-sections} Command
+@findex -file-list-exec-sections
@subsubheading Synopsis
@smallexample
- -thread-list-all-threads
+ -file-list-exec-sections
@end smallexample
+List the sections of the current executable file.
+
@subsubheading @value{GDBN} Command
-The equivalent @value{GDBN} command is @samp{info threads}.
+The @value{GDBN} command @samp{info file} shows, among the rest, the same
+information as this command. @code{gdbtk} has a corresponding command
+@samp{gdb_load_info}.
@subsubheading Example
N.A.
-@subheading The @code{-thread-list-ids} Command
-@findex -thread-list-ids
+@subheading The @code{-file-list-exec-source-file} Command
+@findex -file-list-exec-source-file
@subsubheading Synopsis
@smallexample
- -thread-list-ids
+ -file-list-exec-source-file
@end smallexample
-Produces a list of the currently known @value{GDBN} thread ids. At the
-end of the list it also prints the total number of such threads.
+List the line number, the current source file, and the absolute path
+to the current source file for the current executable.
@subsubheading @value{GDBN} Command
-Part of @samp{info threads} supplies the same information.
+The @value{GDBN} equivalent is @samp{info source}
@subsubheading Example
-No threads present, besides the main process:
-
-@smallexample
-(@value{GDBP})
--thread-list-ids
-^done,thread-ids=@{@},number-of-threads="0"
-(@value{GDBP})
-@end smallexample
-
-
-Several threads:
-
@smallexample
(@value{GDBP})
--thread-list-ids
-^done,thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
-number-of-threads="3"
+123-file-list-exec-source-file
+123^done,line="1",file="foo.c",fullname="/home/bar/foo.c"
(@value{GDBP})
@end smallexample
-@subheading The @code{-thread-select} Command
-@findex -thread-select
+@subheading The @code{-file-list-exec-source-files} Command
+@findex -file-list-exec-source-files
@subsubheading Synopsis
@smallexample
- -thread-select @var{threadnum}
+ -file-list-exec-source-files
@end smallexample
-Make @var{threadnum} the current thread. It prints the number of the new
-current thread, and the topmost frame for that thread.
+List the source files for the current executable.
+
+It will always output the filename, but only when GDB can find the absolute
+file name of a source file, will it output the fullname.
@subsubheading @value{GDBN} Command
-The corresponding @value{GDBN} command is @samp{thread}.
+The @value{GDBN} equivalent is @samp{info sources}.
+@code{gdbtk} has an analogous command @samp{gdb_listfiles}.
@subsubheading Example
-
@smallexample
(@value{GDBP})
--exec-next
-^running
-(@value{GDBP})
-*stopped,reason="end-stepping-range",thread-id="2",line="187",
-file="../../../devo/gdb/testsuite/gdb.threads/linux-dp.c"
-(@value{GDBP})
--thread-list-ids
-^done,
-thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
-number-of-threads="3"
-(@value{GDBP})
--thread-select 3
-^done,new-thread-id="3",
-frame=@{level="0",func="vprintf",
-args=[@{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""@},
-@{name="arg",value="0x2"@}],file="vprintf.c",line="31"@}
+-file-list-exec-source-files
+^done,files=[
+@{file=foo.c,fullname=/home/foo.c@},
+@{file=/home/bar.c,fullname=/home/bar.c@},
+@{file=gdb_could_not_find_fullpath.c@}]
(@value{GDBP})
@end smallexample
-@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-@node GDB/MI Tracepoint Commands
-@section @sc{gdb/mi} Tracepoint Commands
-
-The tracepoint commands are not yet implemented.
-
-@c @subheading -trace-actions
-
-@c @subheading -trace-delete
-
-@c @subheading -trace-disable
-
-@c @subheading -trace-dump
-
-@c @subheading -trace-enable
-
-@c @subheading -trace-exists
-
-@c @subheading -trace-find
-
-@c @subheading -trace-frame-number
-
-@c @subheading -trace-info
+@subheading The @code{-file-list-shared-libraries} Command
+@findex -file-list-shared-libraries
-@c @subheading -trace-insert
+@subsubheading Synopsis
-@c @subheading -trace-list
+@smallexample
+ -file-list-shared-libraries
+@end smallexample
-@c @subheading -trace-pass-count
+List the shared libraries in the program.
-@c @subheading -trace-save
+@subsubheading @value{GDBN} Command
-@c @subheading -trace-start
+The corresponding @value{GDBN} command is @samp{info shared}.
-@c @subheading -trace-stop
+@subsubheading Example
+N.A.
-@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-@node GDB/MI Variable Objects
-@section @sc{gdb/mi} Variable Objects
+@subheading The @code{-file-list-symbol-files} Command
+@findex -file-list-symbol-files
+@subsubheading Synopsis
-@subheading Motivation for Variable Objects in @sc{gdb/mi}
+@smallexample
+ -file-list-symbol-files
+@end smallexample
-For the implementation of a variable debugger window (locals, watched
-expressions, etc.), we are proposing the adaptation of the existing code
-used by @code{Insight}.
+List symbol files.
-The two main reasons for that are:
+@subsubheading @value{GDBN} Command
-@enumerate 1
-@item
-It has been proven in practice (it is already on its second generation).
+The corresponding @value{GDBN} command is @samp{info file} (part of it).
-@item
-It will shorten development time (needless to say how important it is
-now).
-@end enumerate
+@subsubheading Example
+N.A.
-The original interface was designed to be used by Tcl code, so it was
-slightly changed so it could be used through @sc{gdb/mi}. This section
-describes the @sc{gdb/mi} operations that will be available and gives some
-hints about their use.
-@emph{Note}: In addition to the set of operations described here, we
-expect the @sc{gui} implementation of a variable window to require, at
-least, the following operations:
+@subheading The @code{-file-symbol-file} Command
+@findex -file-symbol-file
-@itemize @bullet
-@item @code{-gdb-show} @code{output-radix}
-@item @code{-stack-list-arguments}
-@item @code{-stack-list-locals}
-@item @code{-stack-select-frame}
-@end itemize
+@subsubheading Synopsis
-@subheading Introduction to Variable Objects in @sc{gdb/mi}
+@smallexample
+ -file-symbol-file @var{file}
+@end smallexample
-@cindex variable objects in @sc{gdb/mi}
-The basic idea behind variable objects is the creation of a named object
-to represent a variable, an expression, a memory location or even a CPU
-register. For each object created, a set of operations is available for
-examining or changing its properties.
+Read symbol table info from the specified @var{file} argument. When
+used without arguments, clears @value{GDBN}'s symbol table info. No output is
+produced, except for a completion notification.
-Furthermore, complex data types, such as C structures, are represented
-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
-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.
+@subsubheading @value{GDBN} Command
-When returning the actual values of the objects, this facility allows
-for the individual selection of the display format used in the result
-creation. It can be chosen among: binary, decimal, hexadecimal, octal
-and natural. Natural refers to a default format automatically
-chosen based on the variable type (like decimal for an @code{int}, hex
-for pointers, etc.).
+The corresponding @value{GDBN} command is @samp{symbol-file}.
-The following is the complete set of @sc{gdb/mi} operations defined to
-access this functionality:
+@subsubheading Example
-@multitable @columnfractions .4 .6
-@item @strong{Operation}
-@tab @strong{Description}
+@smallexample
+(@value{GDBP})
+-file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
+^done
+(@value{GDBP})
+@end smallexample
-@item @code{-var-create}
-@tab create a variable object
-@item @code{-var-delete}
-@tab delete the variable object and its children
-@item @code{-var-set-format}
-@tab set the display format of this variable
-@item @code{-var-show-format}
-@tab show the display format of this variable
-@item @code{-var-info-num-children}
-@tab tells how many children this object has
-@item @code{-var-list-children}
-@tab return a list of the object's children
-@item @code{-var-info-type}
-@tab show the type of this variable object
-@item @code{-var-info-expression}
-@tab print what this variable object represents
-@item @code{-var-show-attributes}
-@tab is this variable editable? does it exist here?
-@item @code{-var-evaluate-expression}
-@tab get the value of this variable
-@item @code{-var-assign}
-@tab set the value of this variable
-@item @code{-var-update}
-@tab update the variable and its children
-@end multitable
+@ignore
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Kod Commands
+@section @sc{gdb/mi} Kod Commands
-In the next subsection we describe each operation in detail and suggest
-how it can be used.
+The Kod commands are not implemented.
-@subheading Description And Use of Operations on Variable Objects
+@c @subheading -kod-info
-@subheading The @code{-var-create} Command
-@findex -var-create
+@c @subheading -kod-list
-@subsubheading Synopsis
+@c @subheading -kod-list-object-types
-@smallexample
- -var-create @{@var{name} | "-"@}
- @{@var{frame-addr} | "*"@} @var{expression}
-@end smallexample
+@c @subheading -kod-show
-This operation creates a variable object, which allows the monitoring of
-a variable, the result of an expression, a memory cell or a CPU
-register.
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Memory Overlay Commands
+@section @sc{gdb/mi} Memory Overlay Commands
-The @var{name} parameter is the string by which the object can be
-referenced. It must be unique. If @samp{-} is specified, the varobj
-system will generate a string ``varNNNNNN'' automatically. It will be
-unique provided that one does not specify @var{name} on that format.
-The command fails if a duplicate name is found.
+The memory overlay commands are not implemented.
-The frame under which the expression should be evaluated can be
-specified by @var{frame-addr}. A @samp{*} indicates that the current
-frame should be used.
+@c @subheading -overlay-auto
-@var{expression} is any expression valid on the current language set (must not
-begin with a @samp{*}), or one of the following:
+@c @subheading -overlay-list-mapping-state
-@itemize @bullet
-@item
-@samp{*@var{addr}}, where @var{addr} is the address of a memory cell
+@c @subheading -overlay-list-overlays
-@item
-@samp{*@var{addr}-@var{addr}} --- a memory address range (TBD)
+@c @subheading -overlay-map
-@item
-@samp{$@var{regname}} --- a CPU register name
-@end itemize
+@c @subheading -overlay-off
-@subsubheading Result
+@c @subheading -overlay-on
-This operation returns the name, number of children and the type of the
-object created. Type is returned as a string as the ones generated by
-the @value{GDBN} CLI:
+@c @subheading -overlay-unmap
-@smallexample
- name="@var{name}",numchild="N",type="@var{type}"
-@end smallexample
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Signal Handling Commands
+@section @sc{gdb/mi} Signal Handling Commands
+Signal handling commands are not implemented.
-@subheading The @code{-var-delete} Command
-@findex -var-delete
+@c @subheading -signal-handle
-@subsubheading Synopsis
+@c @subheading -signal-list-handle-actions
-@smallexample
- -var-delete @var{name}
-@end smallexample
+@c @subheading -signal-list-signal-types
+@end ignore
-Deletes a previously created variable object and all of its children.
-Returns an error if the object @var{name} is not found.
+@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+@node GDB/MI Target Manipulation
+@section @sc{gdb/mi} Target Manipulation Commands
-@subheading The @code{-var-set-format} Command
-@findex -var-set-format
+@subheading The @code{-target-attach} Command
+@findex -target-attach
@subsubheading Synopsis
@smallexample
- -var-set-format @var{name} @var{format-spec}
+ -target-attach @var{pid} | @var{file}
@end smallexample
-Sets the output format for the value of the object @var{name} to be
-@var{format-spec}.
+Attach to a process @var{pid} or a file @var{file} outside of @value{GDBN}.
-The syntax for the @var{format-spec} is as follows:
+@subsubheading @value{GDBN} command
-@smallexample
- @var{format-spec} @expansion{}
- @{binary | decimal | hexadecimal | octal | natural@}
-@end smallexample
+The corresponding @value{GDBN} command is @samp{attach}.
+@subsubheading Example
+N.A.
-@subheading The @code{-var-show-format} Command
-@findex -var-show-format
+
+@subheading The @code{-target-compare-sections} Command
+@findex -target-compare-sections
@subsubheading Synopsis
@smallexample
- -var-show-format @var{name}
+ -target-compare-sections [ @var{section} ]
@end smallexample
-Returns the format used to display the value of the object @var{name}.
+Compare data of section @var{section} on target to the exec file.
+Without the argument, all sections are compared.
-@smallexample
- @var{format} @expansion{}
- @var{format-spec}
-@end smallexample
+@subsubheading @value{GDBN} Command
+The @value{GDBN} equivalent is @samp{compare-sections}.
-@subheading The @code{-var-info-num-children} Command
-@findex -var-info-num-children
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-target-detach} Command
+@findex -target-detach
@subsubheading Synopsis
@smallexample
- -var-info-num-children @var{name}
+ -target-detach
@end smallexample
-Returns the number of children of a variable object @var{name}:
+Detach from the remote target which normally resumes its execution.
+There's no output.
+
+@subsubheading @value{GDBN} command
+
+The corresponding @value{GDBN} command is @samp{detach}.
+
+@subsubheading Example
@smallexample
- numchild=@var{n}
+(@value{GDBP})
+-target-detach
+^done
+(@value{GDBP})
@end smallexample
-@subheading The @code{-var-list-children} Command
-@findex -var-list-children
+@subheading The @code{-target-disconnect} Command
+@findex -target-disconnect
@subsubheading Synopsis
-@smallexample
- -var-list-children [@var{print-values}] @var{name}
-@end smallexample
-@anchor{-var-list-children}
+@example
+ -target-disconnect
+@end example
-Return a list of the children of the specified variable object and
-create variable objects for them, if they do not already exist. With
-a single argument or if @var{print-values} has a value for of 0 or
-@code{--no-values}, print only the names of the variables; if
-@var{print-values} is 1 or @code{--all-values}, also print their
-values; and if it is 2 or @code{--simple-values} print the name and
-value for simple data types and just the name for arrays, structures
-and unions.
+Disconnect from the remote target. There's no output and the target is
+generally not resumed.
+
+@subsubheading @value{GDBN} command
+
+The corresponding @value{GDBN} command is @samp{disconnect}.
@subsubheading Example
@smallexample
(@value{GDBP})
- -var-list-children n
- ^done,numchild=@var{n},children=[@{name=@var{name},
- numchild=@var{n},type=@var{type}@},@r{(repeats N times)}]
+-target-disconnect
+^done
(@value{GDBP})
- -var-list-children --all-values n
- ^done,numchild=@var{n},children=[@{name=@var{name},
- numchild=@var{n},value=@var{value},type=@var{type}@},@r{(repeats N times)}]
@end smallexample
-@subheading The @code{-var-info-type} Command
-@findex -var-info-type
+@subheading The @code{-target-download} Command
+@findex -target-download
@subsubheading Synopsis
@smallexample
- -var-info-type @var{name}
+ -target-download
@end smallexample
-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
-@value{GDBN} CLI:
+Loads the executable onto the remote target.
+It prints out an update message every half second, which includes the fields:
+
+@table @samp
+@item section
+The name of the section.
+@item section-sent
+The size of what has been sent so far for that section.
+@item section-size
+The size of the section.
+@item total-sent
+The total size of what was sent so far (the current and the previous sections).
+@item total-size
+The size of the overall executable to download.
+@end table
+
+@noindent
+Each message is sent as status record (@pxref{GDB/MI Output Syntax, ,
+@sc{gdb/mi} Output Syntax}).
+
+In addition, it prints the name and size of the sections, as they are
+downloaded. These messages include the following fields:
+
+@table @samp
+@item section
+The name of the section.
+@item section-size
+The size of the section.
+@item total-size
+The size of the overall executable to download.
+@end table
+
+@noindent
+At the end, a summary is printed.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{load}.
+
+@subsubheading Example
+
+Note: each status message appears on a single line. Here the messages
+have been broken down so that they can fit onto a page.
@smallexample
- type=@var{typename}
+(@value{GDBP})
+-target-download
++download,@{section=".text",section-size="6668",total-size="9880"@}
++download,@{section=".text",section-sent="512",section-size="6668",
+total-sent="512",total-size="9880"@}
++download,@{section=".text",section-sent="1024",section-size="6668",
+total-sent="1024",total-size="9880"@}
++download,@{section=".text",section-sent="1536",section-size="6668",
+total-sent="1536",total-size="9880"@}
++download,@{section=".text",section-sent="2048",section-size="6668",
+total-sent="2048",total-size="9880"@}
++download,@{section=".text",section-sent="2560",section-size="6668",
+total-sent="2560",total-size="9880"@}
++download,@{section=".text",section-sent="3072",section-size="6668",
+total-sent="3072",total-size="9880"@}
++download,@{section=".text",section-sent="3584",section-size="6668",
+total-sent="3584",total-size="9880"@}
++download,@{section=".text",section-sent="4096",section-size="6668",
+total-sent="4096",total-size="9880"@}
++download,@{section=".text",section-sent="4608",section-size="6668",
+total-sent="4608",total-size="9880"@}
++download,@{section=".text",section-sent="5120",section-size="6668",
+total-sent="5120",total-size="9880"@}
++download,@{section=".text",section-sent="5632",section-size="6668",
+total-sent="5632",total-size="9880"@}
++download,@{section=".text",section-sent="6144",section-size="6668",
+total-sent="6144",total-size="9880"@}
++download,@{section=".text",section-sent="6656",section-size="6668",
+total-sent="6656",total-size="9880"@}
++download,@{section=".init",section-size="28",total-size="9880"@}
++download,@{section=".fini",section-size="28",total-size="9880"@}
++download,@{section=".data",section-size="3156",total-size="9880"@}
++download,@{section=".data",section-sent="512",section-size="3156",
+total-sent="7236",total-size="9880"@}
++download,@{section=".data",section-sent="1024",section-size="3156",
+total-sent="7748",total-size="9880"@}
++download,@{section=".data",section-sent="1536",section-size="3156",
+total-sent="8260",total-size="9880"@}
++download,@{section=".data",section-sent="2048",section-size="3156",
+total-sent="8772",total-size="9880"@}
++download,@{section=".data",section-sent="2560",section-size="3156",
+total-sent="9284",total-size="9880"@}
++download,@{section=".data",section-sent="3072",section-size="3156",
+total-sent="9796",total-size="9880"@}
+^done,address="0x10004",load-size="9880",transfer-rate="6586",
+write-rate="429"
+(@value{GDBP})
@end smallexample
-@subheading The @code{-var-info-expression} Command
-@findex -var-info-expression
+@subheading The @code{-target-exec-status} Command
+@findex -target-exec-status
@subsubheading Synopsis
@smallexample
- -var-info-expression @var{name}
+ -target-exec-status
@end smallexample
-Returns what is represented by the variable object @var{name}:
+Provide information on the state of the target (whether it is running or
+not, for instance).
-@smallexample
- lang=@var{lang-spec},exp=@var{expression}
-@end smallexample
+@subsubheading @value{GDBN} Command
-@noindent
-where @var{lang-spec} is @code{@{"C" | "C++" | "Java"@}}.
+There's no equivalent @value{GDBN} command.
+
+@subsubheading Example
+N.A.
-@subheading The @code{-var-show-attributes} Command
-@findex -var-show-attributes
+
+@subheading The @code{-target-list-available-targets} Command
+@findex -target-list-available-targets
@subsubheading Synopsis
@smallexample
- -var-show-attributes @var{name}
+ -target-list-available-targets
@end smallexample
-List attributes of the specified variable object @var{name}:
+List the possible targets to connect to.
-@smallexample
- status=@var{attr} [ ( ,@var{attr} )* ]
-@end smallexample
+@subsubheading @value{GDBN} Command
-@noindent
-where @var{attr} is @code{@{ @{ editable | noneditable @} | TBD @}}.
+The corresponding @value{GDBN} command is @samp{help target}.
-@subheading The @code{-var-evaluate-expression} Command
-@findex -var-evaluate-expression
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-target-list-current-targets} Command
+@findex -target-list-current-targets
@subsubheading Synopsis
@smallexample
- -var-evaluate-expression @var{name}
+ -target-list-current-targets
@end smallexample
-Evaluates the expression that is represented by the specified variable
-object and returns its value as a string in the current format specified
-for the object:
+Describe the current target.
-@smallexample
- value=@var{value}
-@end smallexample
+@subsubheading @value{GDBN} Command
-Note that one must invoke @code{-var-list-children} for a variable
-before the value of a child variable can be evaluated.
+The corresponding information is printed by @samp{info file} (among
+other things).
-@subheading The @code{-var-assign} Command
-@findex -var-assign
+@subsubheading Example
+N.A.
+
+
+@subheading The @code{-target-list-parameters} Command
+@findex -target-list-parameters
@subsubheading Synopsis
@smallexample
- -var-assign @var{name} @var{expression}
+ -target-list-parameters
@end smallexample
-Assigns the value of @var{expression} to the variable object specified
-by @var{name}. The object must be @samp{editable}. If the variable's
-value is altered by the assign, the variable will show up in any
-subsequent @code{-var-update} list.
+@c ????
+
+@subsubheading @value{GDBN} Command
+
+No equivalent.
@subsubheading Example
+N.A.
+
+
+@subheading The @code{-target-select} Command
+@findex -target-select
+
+@subsubheading Synopsis
@smallexample
-(@value{GDBP})
--var-assign var1 3
-^done,value="3"
-(@value{GDBP})
--var-update *
-^done,changelist=[@{name="var1",in_scope="true",type_changed="false"@}]
-(@value{GDBP})
+ -target-select @var{type} @var{parameters @dots{}}
@end smallexample
-@subheading The @code{-var-update} Command
-@findex -var-update
+Connect @value{GDBN} to the remote target. This command takes two args:
-@subsubheading Synopsis
+@table @samp
+@item @var{type}
+The type of target, for instance @samp{async}, @samp{remote}, etc.
+@item @var{parameters}
+Device names, host names and the like. @xref{Target Commands, ,
+Commands for managing targets}, for more details.
+@end table
+
+The output is a connection notification, followed by the address at
+which the target program is, in the following form:
@smallexample
- -var-update [@var{print-values}] @{@var{name} | "*"@}
+^connected,addr="@var{address}",func="@var{function name}",
+ args=[@var{arg list}]
@end smallexample
-Update the value of the variable object @var{name} by evaluating its
-expression after fetching all the new values from memory or registers.
-A @samp{*} causes all existing variable objects to be updated. The
-option @var{print-values} determines whether names both and values, or
-just names are printed in the manner described for
-@code{-var-list-children} (@pxref{-var-list-children}).
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{target}.
@subsubheading Example
@smallexample
(@value{GDBP})
--var-assign var1 3
-^done,value="3"
-(@value{GDBP})
--var-update --all-values var1
-^done,changelist=[@{name="var1",value="3",in_scope="true",
-type_changed="false"@}]
+-target-select async /dev/ttya
+^connected,addr="0xfe00a300",func="??",args=[]
(@value{GDBP})
@end smallexample
^exit
@end smallexample
+
+@subheading The @code{-exec-abort} Command
+@findex -exec-abort
+
+@subsubheading Synopsis
+
+@smallexample
+ -exec-abort
+@end smallexample
+
+Kill the inferior running program.
+
+@subsubheading @value{GDBN} Command
+
+The corresponding @value{GDBN} command is @samp{kill}.
+
+@subsubheading Example
+N.A.
+
+
@subheading The @code{-gdb-set} Command
@findex -gdb-set
@smallexample
-interpreter-exec @var{interpreter} @var{command}
@end smallexample
+@anchor{-interpreter-exec}
Execute the specified @var{command} in the given @var{interpreter}.