diff options
author | Nick Roberts <nickrob@snap.net.nz> | 2006-06-30 21:43:22 +0000 |
---|---|---|
committer | Nick Roberts <nickrob@snap.net.nz> | 2006-06-30 21:43:22 +0000 |
commit | a2c022417703b479f231e76e116c40fbe7f3744b (patch) | |
tree | b5435312a7491dec8cf96b520742bcafa3c1690a /gdb/doc | |
parent | 7e3fb70c62a9f25d165f3952d80ed57d3cd47118 (diff) | |
download | gdb-a2c022417703b479f231e76e116c40fbe7f3744b.zip gdb-a2c022417703b479f231e76e116c40fbe7f3744b.tar.gz gdb-a2c022417703b479f231e76e116c40fbe7f3744b.tar.bz2 |
(GDB/MI Compatibility with CLI): Qualify more carefully.
(GDB/MI Simple Examples): Use @subheading for "A Bad Command".
(GDB/MI Data Manipulation): Remove description of unimplemented
display related commands as variable objects perform this function
and are superior: -display-delete, -display-disable,
-display-enable, -display-insert and -display-list. Move
-environment-cd, -environment-directory, -environment-path
and -environment-pwd to "Program Context".
(GDB/MI Program Control): Rename to "Program Execution". Move
-exec-arguments -exec-abort to...
(GDB/MI Program Context): ...here. New node split from "Data
Manipulation".
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/gdb.texinfo | 2652 |
1 files changed, 1284 insertions, 1368 deletions
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 21267f8..213fb28 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -17266,20 +17266,21 @@ may repeat one or more times. * 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 @@ -17512,15 +17513,16 @@ details about the various output records. @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 @@ -17754,7 +17756,7 @@ Quitting GDB just prints the result class @samp{^exit}. <- ^exit @end smallexample -@subsubheading A Bad Command +@subheading A Bad Command Here's what happens if you pass a non-existent command: @@ -18349,567 +18351,46 @@ times="1"@}]@} @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. - -@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 - -data-disassemble - [ -s @var{start-addr} -e @var{end-addr} ] - | [ -f @var{filename} -l @var{linenum} [ -n @var{lines} ] ] - -- @var{mode} -@end smallexample - -@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 - -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}) --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 - -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}: - -@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 - -data-evaluate-expression @var{expr} -@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. - -@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. - -@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" -(@value{GDBP}) -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{-data-list-changed-registers} Command -@findex -data-list-changed-registers - -@subsubheading Synopsis - -@smallexample - -data-list-changed-registers -@end smallexample - -Display a list of the registers that have changed. - -@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}. - -@subsubheading Example - -On a PPC MBX board: - -@smallexample -(@value{GDBP}) --exec-continue -^running - -(@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{-data-list-register-names} Command -@findex -data-list-register-names - -@subsubheading Synopsis - -@smallexample - -data-list-register-names [ ( @var{regno} )+ ] -@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. - -@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}. - -@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"] -(@value{GDBP}) -@end smallexample - -@subheading The @code{-data-list-register-values} Command -@findex -data-list-register-values - -@subsubheading Synopsis - -@smallexample - -data-list-register-values @var{fmt} [ ( @var{regno} )*] -@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 - -The corresponding @value{GDBN} commands are @samp{info reg}, @samp{info -all-reg}, and (in @code{gdbtk}) @samp{gdb_fetch_registers}. - -@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 - - -@subheading The @code{-data-read-memory} Command -@findex -data-read-memory - -@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} ] -@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}). - -@item @var{word-size} -The size of each memory word in bytes. - -@item @var{nr-rows} -The number of rows in the output table. - -@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). - -@item @var{byte-offset} -An offset to add to the @var{address} before fetching memory. -@end table - -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 - -The corresponding @value{GDBN} command is @samp{x}. @code{gdbtk} has -@samp{gdb_get_mem} memory read command. - -@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. - -@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"]@}] -(@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. - -@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=",-./"@}] -(@value{GDBP}) -@end smallexample - -@subheading The @code{-display-delete} Command -@findex -display-delete - -@subsubheading Synopsis - -@smallexample - -display-delete @var{number} -@end smallexample - -Delete the display @var{number}. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{delete display}. - -@subsubheading Example -N.A. - - -@subheading The @code{-display-disable} Command -@findex -display-disable - -@subsubheading Synopsis - -@smallexample - -display-disable @var{number} -@end smallexample - -Disable display @var{number}. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{disable display}. - -@subsubheading Example -N.A. +@node GDB/MI Program Context +@section @sc{gdb/mi} Program Context +@subheading The @code{-exec-arguments} Command +@findex -exec-arguments -@subheading The @code{-display-enable} Command -@findex -display-enable @subsubheading Synopsis @smallexample - -display-enable @var{number} + -exec-arguments @var{args} @end smallexample -Enable display @var{number}. +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{enable display}. +The corresponding @value{GDBN} command is @samp{set args}. @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. +@c FIXME! +Don't have one around. -@subheading The @code{-display-list} Command -@findex -display-list +@subheading The @code{-exec-show-arguments} Command +@findex -exec-show-arguments @subsubheading Synopsis @smallexample - -display-list + -exec-show-arguments @end smallexample -List the displays. Do not show the current values. +Print the arguments of the program. @subsubheading @value{GDBN} Command -The corresponding @value{GDBN} command is @samp{info display}. +The corresponding @value{GDBN} command is @samp{show args}. @subsubheading Example N.A. @@ -19062,54 +18543,130 @@ The corresponding @value{GDBN} command is @samp{pwd}. @end smallexample @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Program Control -@section @sc{gdb/mi} Program control +@node GDB/MI Thread Commands +@section @sc{gdb/mi} Thread Commands -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 +@subheading The @code{-thread-info} Command +@findex -thread-info @subsubheading Synopsis @smallexample - -exec-abort + -thread-info @end smallexample -Kill the inferior running program. +@subsubheading @value{GDBN} command + +No equivalent. + +@subsubheading Example +N.A. + + +@subheading The @code{-thread-list-all-threads} Command +@findex -thread-list-all-threads + +@subsubheading Synopsis + +@smallexample + -thread-list-all-threads +@end smallexample @subsubheading @value{GDBN} Command -The corresponding @value{GDBN} command is @samp{kill}. +The equivalent @value{GDBN} command is @samp{info threads}. @subsubheading Example N.A. -@subheading The @code{-exec-arguments} Command -@findex -exec-arguments +@subheading The @code{-thread-list-ids} Command +@findex -thread-list-ids @subsubheading Synopsis @smallexample - -exec-arguments @var{args} + -thread-list-ids @end smallexample -Set the inferior program arguments, to be used in the next -@samp{-exec-run}. +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{set args}. +Part of @samp{info threads} supplies the same information. @subsubheading Example -@c FIXME! -Don't have one around. +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" +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-thread-select} Command +@findex -thread-select + +@subsubheading Synopsis + +@smallexample + -thread-select @var{threadnum} +@end smallexample + +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{thread}. + +@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"@} +(@value{GDBP}) +@end smallexample + +@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-continue} Command @findex -exec-continue @@ -19402,26 +18959,9 @@ signal-meaning="Interrupt" @end smallexample -@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 - -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 @@ -19545,262 +19085,6 @@ Is this going away???? @end ignore @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 - -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{file}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx -^done -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-file-exec-file} Command -@findex -file-exec-file - -@subsubheading Synopsis - -@smallexample - -file-exec-file @var{file} -@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. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{exec-file}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx -^done -(@value{GDBP}) -@end smallexample - - -@subheading The @code{-file-list-exec-sections} Command -@findex -file-list-exec-sections - -@subsubheading Synopsis - -@smallexample - -file-list-exec-sections -@end smallexample - -List the sections of the current executable file. - -@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}. - -@subsubheading Example -N.A. - - -@subheading The @code{-file-list-exec-source-file} Command -@findex -file-list-exec-source-file - -@subsubheading Synopsis - -@smallexample - -file-list-exec-source-file -@end smallexample - -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 - -The @value{GDBN} equivalent is @samp{info source} - -@subsubheading Example - -@smallexample -(@value{GDBP}) -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{-file-list-exec-source-files} Command -@findex -file-list-exec-source-files - -@subsubheading Synopsis - -@smallexample - -file-list-exec-source-files -@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. - -@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 - -@smallexample - -file-list-shared-libraries -@end smallexample - -List the shared libraries in the program. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{info shared}. - -@subsubheading Example -N.A. - - -@subheading The @code{-file-list-symbol-files} Command -@findex -file-list-symbol-files - -@subsubheading Synopsis - -@smallexample - -file-list-symbol-files -@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 - -@subsubheading Synopsis - -@smallexample - -file-symbol-file @var{file} -@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. - -@subsubheading @value{GDBN} Command - -The corresponding @value{GDBN} command is @samp{symbol-file}. - -@subsubheading Example - -@smallexample -(@value{GDBP}) --file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx -^done -(@value{GDBP}) -@end smallexample - -@ignore -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Kod Commands -@section @sc{gdb/mi} Kod Commands - -The Kod commands are not implemented. - -@c @subheading -kod-info - -@c @subheading -kod-list - -@c @subheading -kod-list-object-types - -@c @subheading -kod-show - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Memory Overlay Commands -@section @sc{gdb/mi} Memory Overlay Commands - -The memory overlay commands are not implemented. - -@c @subheading -overlay-auto - -@c @subheading -overlay-list-mapping-state - -@c @subheading -overlay-list-overlays - -@c @subheading -overlay-map - -@c @subheading -overlay-off - -@c @subheading -overlay-on - -@c @subheading -overlay-unmap - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Signal Handling Commands -@section @sc{gdb/mi} Signal Handling Commands - -Signal handling commands are not implemented. - -@c @subheading -signal-handle - -@c @subheading -signal-list-handle-actions - -@c @subheading -signal-list-signal-types -@end ignore - - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node GDB/MI Stack Manipulation @section @sc{gdb/mi} Stack Manipulation Commands @@ -20119,6 +19403,890 @@ The corresponding @value{GDBN} commands are @samp{frame}, @samp{up}, @end smallexample @c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Variable Objects +@section @sc{gdb/mi} Variable Objects + + +@subheading Motivation for Variable Objects in @sc{gdb/mi} + +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}. + +The two main reasons for that are: + +@enumerate 1 +@item +It has been proven in practice (it is already on its second generation). + +@item +It will shorten development time (needless to say how important it is +now). +@end enumerate + +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: + +@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 + +@subheading Introduction to Variable Objects in @sc{gdb/mi} + +@cindex variable objects in @sc{gdb/mi} +The basic idea behind variable objects is the creation of a named object +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. + +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. + +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 following is the complete set of @sc{gdb/mi} operations defined to +access this functionality: + +@multitable @columnfractions .4 .6 +@item @strong{Operation} +@tab @strong{Description} + +@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 + +In the next subsection we describe each operation in detail and suggest +how it can be used. + +@subheading Description And Use of Operations on Variable Objects + +@subheading The @code{-var-create} Command +@findex -var-create + +@subsubheading Synopsis + +@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. + +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. + +@var{expression} is any expression valid on the current language set (must not +begin with a @samp{*}), or one of the following: + +@itemize @bullet +@item +@samp{*@var{addr}}, where @var{addr} is the address of a memory cell + +@item +@samp{*@var{addr}-@var{addr}} --- a memory address range (TBD) + +@item +@samp{$@var{regname}} --- a CPU register name +@end itemize + +@subsubheading Result + +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 + name="@var{name}",numchild="N",type="@var{type}" +@end smallexample + + +@subheading The @code{-var-delete} Command +@findex -var-delete + +@subsubheading Synopsis + +@smallexample + -var-delete @var{name} +@end smallexample + +Deletes a previously created variable object and all of its children. + +Returns an error if the object @var{name} is not found. + + +@subheading The @code{-var-set-format} Command +@findex -var-set-format + +@subsubheading Synopsis + +@smallexample + -var-set-format @var{name} @var{format-spec} +@end smallexample + +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 + -var-show-format @var{name} +@end smallexample + +Returns the format used to display the value of the object @var{name}. + +@smallexample + @var{format} @expansion{} + @var{format-spec} +@end smallexample + + +@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}) + -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 + + +@subheading The @code{-var-info-type} Command +@findex -var-info-type + +@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 + -var-info-expression @var{name} +@end smallexample + +Returns what is represented by the variable object @var{name}: + +@smallexample + lang=@var{lang-spec},exp=@var{expression} +@end smallexample + +@noindent +where @var{lang-spec} is @code{@{"C" | "C++" | "Java"@}}. + +@subheading The @code{-var-show-attributes} Command +@findex -var-show-attributes + +@subsubheading Synopsis + +@smallexample + -var-show-attributes @var{name} +@end smallexample + +List attributes of the specified variable object @var{name}: + +@smallexample + status=@var{attr} [ ( ,@var{attr} )* ] +@end smallexample + +@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}) +-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 + +@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}) +-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 + +@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 + -data-disassemble + [ -s @var{start-addr} -e @var{end-addr} ] + | [ -f @var{filename} -l @var{linenum} [ -n @var{lines} ] ] + -- @var{mode} +@end smallexample + +@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 + +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}) +-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 + +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}: + +@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 + -data-evaluate-expression @var{expr} +@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. + +@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. + +@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" +(@value{GDBP}) +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{-data-list-changed-registers} Command +@findex -data-list-changed-registers + +@subsubheading Synopsis + +@smallexample + -data-list-changed-registers +@end smallexample + +Display a list of the registers that have changed. + +@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}. + +@subsubheading Example + +On a PPC MBX board: + +@smallexample +(@value{GDBP}) +-exec-continue +^running + +(@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{-data-list-register-names} Command +@findex -data-list-register-names + +@subsubheading Synopsis + +@smallexample + -data-list-register-names [ ( @var{regno} )+ ] +@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. + +@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}. + +@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"] +(@value{GDBP}) +@end smallexample + +@subheading The @code{-data-list-register-values} Command +@findex -data-list-register-values + +@subsubheading Synopsis + +@smallexample + -data-list-register-values @var{fmt} [ ( @var{regno} )*] +@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 + +The corresponding @value{GDBN} commands are @samp{info reg}, @samp{info +all-reg}, and (in @code{gdbtk}) @samp{gdb_fetch_registers}. + +@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 + + +@subheading The @code{-data-read-memory} Command +@findex -data-read-memory + +@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} ] +@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}). + +@item @var{word-size} +The size of each memory word in bytes. + +@item @var{nr-rows} +The number of rows in the output table. + +@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). + +@item @var{byte-offset} +An offset to add to the @var{address} before fetching memory. +@end table + +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 + +The corresponding @value{GDBN} command is @samp{x}. @code{gdbtk} has +@samp{gdb_get_mem} memory read command. + +@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. + +@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"]@}] +(@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. + +@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=",-./"@}] +(@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 + +@c @subheading -trace-insert + +@c @subheading -trace-list + +@c @subheading -trace-pass-count + +@c @subheading -trace-save + +@c @subheading -trace-start + +@c @subheading -trace-stop + + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node GDB/MI Symbol Query @section @sc{gdb/mi} Symbol Query Commands @@ -20343,6 +20511,262 @@ 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 + -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{file}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx +^done +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-file-exec-file} Command +@findex -file-exec-file + +@subsubheading Synopsis + +@smallexample + -file-exec-file @var{file} +@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. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{exec-file}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx +^done +(@value{GDBP}) +@end smallexample + + +@subheading The @code{-file-list-exec-sections} Command +@findex -file-list-exec-sections + +@subsubheading Synopsis + +@smallexample + -file-list-exec-sections +@end smallexample + +List the sections of the current executable file. + +@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}. + +@subsubheading Example +N.A. + + +@subheading The @code{-file-list-exec-source-file} Command +@findex -file-list-exec-source-file + +@subsubheading Synopsis + +@smallexample + -file-list-exec-source-file +@end smallexample + +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 + +The @value{GDBN} equivalent is @samp{info source} + +@subsubheading Example + +@smallexample +(@value{GDBP}) +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{-file-list-exec-source-files} Command +@findex -file-list-exec-source-files + +@subsubheading Synopsis + +@smallexample + -file-list-exec-source-files +@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. + +@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 + +@smallexample + -file-list-shared-libraries +@end smallexample + +List the shared libraries in the program. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{info shared}. + +@subsubheading Example +N.A. + + +@subheading The @code{-file-list-symbol-files} Command +@findex -file-list-symbol-files + +@subsubheading Synopsis + +@smallexample + -file-list-symbol-files +@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 + +@subsubheading Synopsis + +@smallexample + -file-symbol-file @var{file} +@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. + +@subsubheading @value{GDBN} Command + +The corresponding @value{GDBN} command is @samp{symbol-file}. + +@subsubheading Example + +@smallexample +(@value{GDBP}) +-file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx +^done +(@value{GDBP}) +@end smallexample + +@ignore +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Kod Commands +@section @sc{gdb/mi} Kod Commands + +The Kod commands are not implemented. + +@c @subheading -kod-info + +@c @subheading -kod-list + +@c @subheading -kod-list-object-types + +@c @subheading -kod-show + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Memory Overlay Commands +@section @sc{gdb/mi} Memory Overlay Commands + +The memory overlay commands are not implemented. + +@c @subheading -overlay-auto + +@c @subheading -overlay-list-mapping-state + +@c @subheading -overlay-list-overlays + +@c @subheading -overlay-map + +@c @subheading -overlay-off + +@c @subheading -overlay-on + +@c @subheading -overlay-unmap + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% +@node GDB/MI Signal Handling Commands +@section @sc{gdb/mi} Signal Handling Commands + +Signal handling commands are not implemented. + +@c @subheading -signal-handle + +@c @subheading -signal-list-handle-actions + +@c @subheading -signal-list-signal-types +@end ignore + + +@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @node GDB/MI Target Manipulation @section @sc{gdb/mi} Target Manipulation Commands @@ -20661,562 +21085,53 @@ The corresponding @value{GDBN} command is @samp{target}. @end smallexample @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 - -thread-info -@end smallexample - -@subsubheading @value{GDBN} command - -No equivalent. - -@subsubheading Example -N.A. - - -@subheading The @code{-thread-list-all-threads} Command -@findex -thread-list-all-threads - -@subsubheading Synopsis - -@smallexample - -thread-list-all-threads -@end smallexample - -@subsubheading @value{GDBN} Command - -The equivalent @value{GDBN} command is @samp{info threads}. - -@subsubheading Example -N.A. - - -@subheading The @code{-thread-list-ids} Command -@findex -thread-list-ids - -@subsubheading Synopsis - -@smallexample - -thread-list-ids -@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. - -@subsubheading @value{GDBN} Command - -Part of @samp{info threads} supplies the same information. - -@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" -(@value{GDBP}) -@end smallexample +@node GDB/MI Miscellaneous Commands +@section Miscellaneous @sc{gdb/mi} Commands +@c @subheading -gdb-complete -@subheading The @code{-thread-select} Command -@findex -thread-select +@subheading The @code{-gdb-exit} Command +@findex -gdb-exit @subsubheading Synopsis @smallexample - -thread-select @var{threadnum} + -gdb-exit @end smallexample -Make @var{threadnum} the current thread. It prints the number of the new -current thread, and the topmost frame for that thread. +Exit @value{GDBN} immediately. @subsubheading @value{GDBN} Command -The corresponding @value{GDBN} command is @samp{thread}. - -@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"@} -(@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 - -@c @subheading -trace-insert - -@c @subheading -trace-list - -@c @subheading -trace-pass-count - -@c @subheading -trace-save - -@c @subheading -trace-start - -@c @subheading -trace-stop - - -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Variable Objects -@section @sc{gdb/mi} Variable Objects - - -@subheading Motivation for Variable Objects in @sc{gdb/mi} - -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}. - -The two main reasons for that are: - -@enumerate 1 -@item -It has been proven in practice (it is already on its second generation). - -@item -It will shorten development time (needless to say how important it is -now). -@end enumerate - -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: - -@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 - -@subheading Introduction to Variable Objects in @sc{gdb/mi} - -@cindex variable objects in @sc{gdb/mi} -The basic idea behind variable objects is the creation of a named object -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. - -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. - -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 following is the complete set of @sc{gdb/mi} operations defined to -access this functionality: - -@multitable @columnfractions .4 .6 -@item @strong{Operation} -@tab @strong{Description} - -@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 - -In the next subsection we describe each operation in detail and suggest -how it can be used. - -@subheading Description And Use of Operations on Variable Objects - -@subheading The @code{-var-create} Command -@findex -var-create - -@subsubheading Synopsis - -@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. - -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. - -@var{expression} is any expression valid on the current language set (must not -begin with a @samp{*}), or one of the following: - -@itemize @bullet -@item -@samp{*@var{addr}}, where @var{addr} is the address of a memory cell - -@item -@samp{*@var{addr}-@var{addr}} --- a memory address range (TBD) - -@item -@samp{$@var{regname}} --- a CPU register name -@end itemize - -@subsubheading Result - -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 - name="@var{name}",numchild="N",type="@var{type}" -@end smallexample - - -@subheading The @code{-var-delete} Command -@findex -var-delete - -@subsubheading Synopsis - -@smallexample - -var-delete @var{name} -@end smallexample - -Deletes a previously created variable object and all of its children. - -Returns an error if the object @var{name} is not found. - - -@subheading The @code{-var-set-format} Command -@findex -var-set-format - -@subsubheading Synopsis - -@smallexample - -var-set-format @var{name} @var{format-spec} -@end smallexample - -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 - -var-show-format @var{name} -@end smallexample - -Returns the format used to display the value of the object @var{name}. - -@smallexample - @var{format} @expansion{} - @var{format-spec} -@end smallexample - - -@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}) - -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 - - -@subheading The @code{-var-info-type} Command -@findex -var-info-type - -@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 - -var-info-expression @var{name} -@end smallexample - -Returns what is represented by the variable object @var{name}: - -@smallexample - lang=@var{lang-spec},exp=@var{expression} -@end smallexample - -@noindent -where @var{lang-spec} is @code{@{"C" | "C++" | "Java"@}}. - -@subheading The @code{-var-show-attributes} Command -@findex -var-show-attributes - -@subsubheading Synopsis - -@smallexample - -var-show-attributes @var{name} -@end smallexample - -List attributes of the specified variable object @var{name}: - -@smallexample - status=@var{attr} [ ( ,@var{attr} )* ] -@end smallexample - -@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}) --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 - -@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}). +Approximately corresponds to @samp{quit}. @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"@}] -(@value{GDBP}) +-gdb-exit +^exit @end smallexample -@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -@node GDB/MI Miscellaneous Commands -@section Miscellaneous @sc{gdb/mi} Commands - -@c @subheading -gdb-complete -@subheading The @code{-gdb-exit} Command -@findex -gdb-exit +@subheading The @code{-exec-abort} Command +@findex -exec-abort @subsubheading Synopsis @smallexample - -gdb-exit + -exec-abort @end smallexample -Exit @value{GDBN} immediately. +Kill the inferior running program. @subsubheading @value{GDBN} Command -Approximately corresponds to @samp{quit}. +The corresponding @value{GDBN} command is @samp{kill}. @subsubheading Example +N.A. -@smallexample -(@value{GDBP}) --gdb-exit -^exit -@end smallexample @subheading The @code{-gdb-set} Command @findex -gdb-set @@ -21316,6 +21231,7 @@ default shows this information when you start an interactive session. @smallexample -interpreter-exec @var{interpreter} @var{command} @end smallexample +@anchor{-interpreter-exec} Execute the specified @var{command} in the given @var{interpreter}. |