The output from @sc{gdb/mi} consists of zero or more out-of-band records
followed, optionally, by a single result record. This result record
is for the most recent command. The sequence of output records is
-terminated by @samp{(@value{GDBP})}.
+terminated by @samp{(gdb)}.
If an input command was prefixed with a @code{@var{token}} then the
corresponding output for that command will also be prefixed by that same
@table @code
@item @var{output} @expansion{}
-@code{( @var{out-of-band-record} )* [ @var{result-record} ] "(@value{GDBP})" @var{nl}}
+@code{( @var{out-of-band-record} )* [ @var{result-record} ] "(gdb)" @var{nl}}
@item @var{result-record} @expansion{}
@code{ [ @var{token} ] "^" @var{result-class} ( "," @var{result} )* @var{nl}}
@smallexample
-> -rubbish
<- ^error,msg="Undefined MI command: rubbish"
-<- (@value{GDBP})
+<- (gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-break-insert main
^done,bkpt=@{number="1",addr="0x000100d0",file="hello.c",
fullname="/home/foo/hello.c",line="5",times="0"@}
-(@value{GDBP})
+(gdb)
-break-after 1 3
~
^done
-(@value{GDBP})
+(gdb)
-break-list
^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",fullname="/home/foo/hello.c",
line="5",times="0",ignore="3"@}]@}
-(@value{GDBP})
+(gdb)
@end smallexample
@ignore
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-break-condition 1 1
^done
-(@value{GDBP})
+(gdb)
-break-list
^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
body=[bkpt=@{number="1",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",fullname="/home/foo/hello.c",
line="5",cond="1",times="0",ignore="3"@}]@}
-(@value{GDBP})
+(gdb)
@end smallexample
@subheading The @code{-break-delete} Command
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-break-delete 1
^done
-(@value{GDBP})
+(gdb)
-break-list
^done,BreakpointTable=@{nr_rows="0",nr_cols="6",
hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
@{width="40",alignment="2",col_name="what",colhdr="What"@}],
body=[]@}
-(@value{GDBP})
+(gdb)
@end smallexample
@subheading The @code{-break-disable} Command
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-break-disable 2
^done
-(@value{GDBP})
+(gdb)
-break-list
^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
body=[bkpt=@{number="2",type="breakpoint",disp="keep",enabled="n",
addr="0x000100d0",func="main",file="hello.c",fullname="/home/foo/hello.c",
line="5",times="0"@}]@}
-(@value{GDBP})
+(gdb)
@end smallexample
@subheading The @code{-break-enable} Command
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-break-enable 2
^done
-(@value{GDBP})
+(gdb)
-break-list
^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
body=[bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
addr="0x000100d0",func="main",file="hello.c",fullname="/home/foo/hello.c",
line="5",times="0"@}]@}
-(@value{GDBP})
+(gdb)
@end smallexample
@subheading The @code{-break-info} Command
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-break-insert main
^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",
fullname="/home/foo/recursive2.c,line="4",times="0"@}
-(@value{GDBP})
+(gdb)
-break-insert -t foo
^done,bkpt=@{number="2",addr="0x00010774",file="recursive2.c",
fullname="/home/foo/recursive2.c,line="11",times="0"@}
-(@value{GDBP})
+(gdb)
-break-list
^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
bkpt=@{number="2",type="breakpoint",disp="del",enabled="y",
addr="0x00010774",func="foo",file="recursive2.c",
fullname="/home/foo/recursive2.c",line="11",times="0"@}]@}
-(@value{GDBP})
+(gdb)
-break-insert -r foo.*
~int foo(int, int);
^done,bkpt=@{number="3",addr="0x00010774",file="recursive2.c,
"fullname="/home/foo/recursive2.c",line="11",times="0"@}
-(@value{GDBP})
+(gdb)
@end smallexample
@subheading The @code{-break-list} Command
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-break-list
^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
bkpt=@{number="2",type="breakpoint",disp="keep",enabled="y",
addr="0x00010114",func="foo",file="hello.c",fullname="/home/foo/hello.c",
line="13",times="0"@}]@}
-(@value{GDBP})
+(gdb)
@end smallexample
Here's an example of the result when there are no breakpoints:
@smallexample
-(@value{GDBP})
+(gdb)
-break-list
^done,BreakpointTable=@{nr_rows="0",nr_cols="6",
hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
@{width="10",alignment="-1",col_name="addr",colhdr="Address"@},
@{width="40",alignment="2",col_name="what",colhdr="What"@}],
body=[]@}
-(@value{GDBP})
+(gdb)
@end smallexample
@subheading The @code{-break-watch} Command
Setting a watchpoint on a variable in the @code{main} function:
@smallexample
-(@value{GDBP})
+(gdb)
-break-watch x
^done,wpt=@{number="2",exp="x"@}
-(@value{GDBP})
+(gdb)
-exec-continue
^running
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="x"@},
value=@{old="-268439212",new="55"@},
frame=@{func="main",args=[],file="recursive2.c",
fullname="/home/foo/bar/recursive2.c",line="5"@}
-(@value{GDBP})
+(gdb)
@end smallexample
Setting a watchpoint on a variable local to a function. @value{GDBN} will stop
for the watchpoint going out of scope.
@smallexample
-(@value{GDBP})
+(gdb)
-break-watch C
^done,wpt=@{number="5",exp="C"@}
-(@value{GDBP})
+(gdb)
-exec-continue
^running
^done,reason="watchpoint-trigger",
frame=@{func="callee4",args=[],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
-(@value{GDBP})
+(gdb)
-exec-continue
^running
^done,reason="watchpoint-scope",wpnum="5",
value="0x11940 \"A string argument.\""@}],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
-(@value{GDBP})
+(gdb)
@end smallexample
Listing breakpoints and watchpoints, at different points in the program
deleted.
@smallexample
-(@value{GDBP})
+(gdb)
-break-watch C
^done,wpt=@{number="2",exp="C"@}
-(@value{GDBP})
+(gdb)
-break-list
^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
fullname="/home/foo/devo/gdb/testsuite/gdb.mi/basics.c"line="8",times="1"@},
bkpt=@{number="2",type="watchpoint",disp="keep",
enabled="y",addr="",what="C",times="0"@}]@}
-(@value{GDBP})
+(gdb)
-exec-continue
^running
^done,reason="watchpoint-trigger",wpt=@{number="2",exp="C"@},
frame=@{func="callee4",args=[],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="13"@}
-(@value{GDBP})
+(gdb)
-break-list
^done,BreakpointTable=@{nr_rows="2",nr_cols="6",
hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
fullname="/home/foo/devo/gdb/testsuite/gdb.mi/basics.c",line="8",times="1"@},
bkpt=@{number="2",type="watchpoint",disp="keep",
enabled="y",addr="",what="C",times="-5"@}]@}
-(@value{GDBP})
+(gdb)
-exec-continue
^running
^done,reason="watchpoint-scope",wpnum="2",
value="0x11940 \"A string argument.\""@}],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
-(@value{GDBP})
+(gdb)
-break-list
^done,BreakpointTable=@{nr_rows="1",nr_cols="6",
hdr=[@{width="3",alignment="-1",col_name="number",colhdr="Num"@},
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
fullname="/home/foo/devo/gdb/testsuite/gdb.mi/basics.c",line="8",
times="1"@}]@}
-(@value{GDBP})
+(gdb)
@end smallexample
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-environment-cd /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
^done
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-environment-directory /kwikemart/marge/ezannoni/flathead-dev/devo/gdb
^done,source-path="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd"
-(@value{GDBP})
+(gdb)
-environment-directory ""
^done,source-path="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb:$cdir:$cwd"
-(@value{GDBP})
+(gdb)
-environment-directory -r /home/jjohnstn/src/gdb /usr/src
^done,source-path="/home/jjohnstn/src/gdb:/usr/src:$cdir:$cwd"
-(@value{GDBP})
+(gdb)
-environment-directory -r
^done,source-path="$cdir:$cwd"
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-environment-path
^done,path="/usr/bin"
-(@value{GDBP})
+(gdb)
-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})
+(gdb)
-environment-path -r /usr/local/bin
^done,path="/usr/local/bin:/usr/bin"
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-environment-pwd
^done,cwd="/kwikemart/marge/ezannoni/flathead-dev/devo/gdb"
-(@value{GDBP})
+(gdb)
@end smallexample
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
No threads present, besides the main process:
@smallexample
-(@value{GDBP})
+(gdb)
-thread-list-ids
^done,thread-ids=@{@},number-of-threads="0"
-(@value{GDBP})
+(gdb)
@end smallexample
Several threads:
@smallexample
-(@value{GDBP})
+(gdb)
-thread-list-ids
^done,thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
number-of-threads="3"
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-exec-next
^running
-(@value{GDBP})
+(gdb)
*stopped,reason="end-stepping-range",thread-id="2",line="187",
file="../../../devo/gdb/testsuite/gdb.threads/linux-dp.c"
-(@value{GDBP})
+(gdb)
-thread-list-ids
^done,
thread-ids=@{thread-id="3",thread-id="2",thread-id="1"@},
number-of-threads="3"
-(@value{GDBP})
+(gdb)
-thread-select 3
^done,new-thread-id="3",
frame=@{level="0",func="vprintf",
args=[@{name="format",value="0x8048e9c \"%*s%c %d %c\\n\""@},
@{name="arg",value="0x2"@}],file="vprintf.c",line="31"@}
-(@value{GDBP})
+(gdb)
@end smallexample
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@smallexample
-exec-continue
^running
-(@value{GDBP})
+(gdb)
@@Hello world
*stopped,reason="breakpoint-hit",bkptno="2",frame=@{func="foo",args=[],
file="hello.c",fullname="/home/foo/bar/hello.c",line="13"@}
-(@value{GDBP})
+(gdb)
@end smallexample
@smallexample
-exec-finish
^running
-(@value{GDBP})
+(gdb)
@@hello from foo
*stopped,reason="function-finished",frame=@{func="main",args=[],
file="hello.c",fullname="/home/foo/bar/hello.c",line="7"@}
-(@value{GDBP})
+(gdb)
@end smallexample
Function returning other than @code{void}. The name of the internal
@smallexample
-exec-finish
^running
-(@value{GDBP})
+(gdb)
*stopped,reason="function-finished",frame=@{addr="0x000107b0",func="foo",
args=[@{name="a",value="1"],@{name="b",value="9"@}@},
file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@},
gdb-result-var="$1",return-value="0"
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
111-exec-continue
111^running
-(@value{GDBP})
+(gdb)
222-exec-interrupt
222^done
-(@value{GDBP})
+(gdb)
111*stopped,signal-name="SIGINT",signal-meaning="Interrupt",
frame=@{addr="0x00010140",func="foo",args=[],file="try.c",
fullname="/home/foo/bar/try.c",line="13"@}
-(@value{GDBP})
+(gdb)
-(@value{GDBP})
+(gdb)
-exec-interrupt
^error,msg="mi_cmd_exec_interrupt: Inferior not executing."
-(@value{GDBP})
+(gdb)
@end smallexample
@smallexample
-exec-next
^running
-(@value{GDBP})
+(gdb)
*stopped,reason="end-stepping-range",line="8",file="hello.c"
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-exec-next-instruction
^running
-(@value{GDBP})
+(gdb)
*stopped,reason="end-stepping-range",
addr="0x000100d4",line="5",file="hello.c"
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
200-break-insert callee4
200^done,bkpt=@{number="1",addr="0x00010734",
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
-(@value{GDBP})
+(gdb)
000-exec-run
000^running
-(@value{GDBP})
+(gdb)
000*stopped,reason="breakpoint-hit",bkptno="1",
frame=@{func="callee4",args=[],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="8"@}
-(@value{GDBP})
+(gdb)
205-break-delete
205^done
-(@value{GDBP})
+(gdb)
111-exec-return
111^done,frame=@{level="0",func="callee3",
args=[@{name="strarg",
value="0x11940 \"A string argument.\""@}],
file="../../../devo/gdb/testsuite/gdb.mi/basics.c",
fullname="/home/foo/bar/devo/gdb/testsuite/gdb.mi/basics.c",line="18"@}
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Examples
@smallexample
-(@value{GDBP})
+(gdb)
-break-insert main
^done,bkpt=@{number="1",addr="0x0001072c",file="recursive2.c",line="4"@}
-(@value{GDBP})
+(gdb)
-exec-run
^running
-(@value{GDBP})
+(gdb)
*stopped,reason="breakpoint-hit",bkptno="1",
frame=@{func="main",args=[],file="recursive2.c",
fullname="/home/foo/bar/recursive2.c",line="4"@}
-(@value{GDBP})
+(gdb)
@end smallexample
@noindent
Program exited normally:
@smallexample
-(@value{GDBP})
+(gdb)
-exec-run
^running
-(@value{GDBP})
+(gdb)
x = 55
*stopped,reason="exited-normally"
-(@value{GDBP})
+(gdb)
@end smallexample
@noindent
Program exited exceptionally:
@smallexample
-(@value{GDBP})
+(gdb)
-exec-run
^running
-(@value{GDBP})
+(gdb)
x = 55
*stopped,reason="exited",exit-code="01"
-(@value{GDBP})
+(gdb)
@end smallexample
Another way the program can terminate is if it receives a signal such as
@code{SIGINT}. In this case, @sc{gdb/mi} displays this:
@smallexample
-(@value{GDBP})
+(gdb)
*stopped,reason="exited-signalled",signal-name="SIGINT",
signal-meaning="Interrupt"
@end smallexample
@smallexample
-exec-step
^running
-(@value{GDBP})
+(gdb)
*stopped,reason="end-stepping-range",
frame=@{func="foo",args=[@{name="a",value="10"@},
@{name="b",value="0"@}],file="recursive2.c",
fullname="/home/foo/bar/recursive2.c",line="11"@}
-(@value{GDBP})
+(gdb)
@end smallexample
Regular stepping:
@smallexample
-exec-step
^running
-(@value{GDBP})
+(gdb)
*stopped,reason="end-stepping-range",line="14",file="recursive2.c"
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-exec-step-instruction
^running
-(@value{GDBP})
+(gdb)
*stopped,reason="end-stepping-range",
frame=@{func="foo",args=[],file="try.c",
fullname="/home/foo/bar/try.c",line="10"@}
-(@value{GDBP})
+(gdb)
-exec-step-instruction
^running
-(@value{GDBP})
+(gdb)
*stopped,reason="end-stepping-range",
frame=@{addr="0x000100f4",func="foo",args=[],file="try.c",
fullname="/home/foo/bar/try.c",line="10"@}
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-exec-until recursive2.c:6
^running
-(@value{GDBP})
+(gdb)
x = 55
*stopped,reason="location-reached",frame=@{func="main",args=[],
file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="6"@}
-(@value{GDBP})
+(gdb)
@end smallexample
@ignore
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-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})
+(gdb)
@end smallexample
@subheading The @code{-stack-info-depth} Command
For a stack with frame levels 0 through 11:
@smallexample
-(@value{GDBP})
+(gdb)
-stack-info-depth
^done,depth="12"
-(@value{GDBP})
+(gdb)
-stack-info-depth 4
^done,depth="4"
-(@value{GDBP})
+(gdb)
-stack-info-depth 12
^done,depth="12"
-(@value{GDBP})
+(gdb)
-stack-info-depth 11
^done,depth="11"
-(@value{GDBP})
+(gdb)
-stack-info-depth 13
^done,depth="12"
-(@value{GDBP})
+(gdb)
@end smallexample
@subheading The @code{-stack-list-arguments} Command
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-stack-list-frames
^done,
stack=[
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})
+(gdb)
-stack-list-arguments 0
^done,
stack-args=[
frame=@{level="2",args=[name="intarg",name="strarg"]@},
frame=@{level="3",args=[name="intarg",name="strarg",name="fltarg"]@},
frame=@{level="4",args=[]@}]
-(@value{GDBP})
+(gdb)
-stack-list-arguments 1
^done,
stack-args=[
@{name="strarg",value="0x11940 \"A string argument.\""@},
@{name="fltarg",value="3.5"@}]@},
frame=@{level="4",args=[]@}]
-(@value{GDBP})
+(gdb)
-stack-list-arguments 0 2 2
^done,stack-args=[frame=@{level="2",args=[name="intarg",name="strarg"]@}]
-(@value{GDBP})
+(gdb)
-stack-list-arguments 1 2 2
^done,stack-args=[frame=@{level="2",
args=[@{name="intarg",value="2"@},
@{name="strarg",value="0x11940 \"A string argument.\""@}]@}]
-(@value{GDBP})
+(gdb)
@end smallexample
@c @subheading -stack-list-exception-handlers
Full stack backtrace:
@smallexample
-(@value{GDBP})
+(gdb)
-stack-list-frames
^done,stack=
[frame=@{level="0",addr="0x0001076c",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})
+(gdb)
@end smallexample
Show frames between @var{low_frame} and @var{high_frame}:
@smallexample
-(@value{GDBP})
+(gdb)
-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="5",addr="0x000107a4",func="foo",
file="recursive2.c",fullname="/home/foo/bar/recursive2.c",line="14"@}]
-(@value{GDBP})
+(gdb)
@end smallexample
Show a single frame:
@smallexample
-(@value{GDBP})
+(gdb)
-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})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-stack-list-locals 0
^done,locals=[name="A",name="B",name="C"]
-(@value{GDBP})
+(gdb)
-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})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-stack-select-frame 2
^done
-(@value{GDBP})
+(gdb)
@end smallexample
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-var-list-children n
^done,numchild=@var{n},children=[@{name=@var{name},
numchild=@var{n},type=@var{type}@},@r{(repeats N times)}]
-(@value{GDBP})
+(gdb)
-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)}]
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-var-assign var1 3
^done,value="3"
-(@value{GDBP})
+(gdb)
-var-update *
^done,changelist=[@{name="var1",in_scope="true",type_changed="false"@}]
-(@value{GDBP})
+(gdb)
@end smallexample
@subheading The @code{-var-update} Command
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-var-assign var1 3
^done,value="3"
-(@value{GDBP})
+(gdb)
-var-update --all-values var1
^done,changelist=[@{name="var1",value="3",in_scope="true",
type_changed="false"@}]
-(@value{GDBP})
+(gdb)
@end smallexample
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Disassemble from the current value of @code{$pc} to @code{$pc + 20}:
@smallexample
-(@value{GDBP})
+(gdb)
-data-disassemble -s $pc -e "$pc + 20" -- 0
^done,
asm_insns=[
inst="sethi %hi(0x11800), %o2"@},
@{address="0x000107d0",func-name="main",offset="20",
inst="or %o2, 0x168, %o4\t! 0x11968 <_lib_version+48>"@}]
-(@value{GDBP})
+(gdb)
@end smallexample
Disassemble the whole @code{main} function. Line 32 is part of
[@dots{}]
@{address="0x0001081c",func-name="main",offset="96",inst="ret "@},
@{address="0x00010820",func-name="main",offset="100",inst="restore "@}]
-(@value{GDBP})
+(gdb)
@end smallexample
Disassemble 3 instructions from the start of @code{main}:
@smallexample
-(@value{GDBP})
+(gdb)
-data-disassemble -f basics.c -l 32 -n 3 -- 0
^done,asm_insns=[
@{address="0x000107bc",func-name="main",offset="0",
inst="mov 2, %o0"@},
@{address="0x000107c4",func-name="main",offset="8",
inst="sethi %hi(0x11800), %o2"@}]
-(@value{GDBP})
+(gdb)
@end smallexample
Disassemble 3 instructions from the start of @code{main} in mixed mode:
@smallexample
-(@value{GDBP})
+(gdb)
-data-disassemble -f basics.c -l 32 -n 3 -- 1
^done,asm_insns=[
src_and_asm_line=@{line="31",
inst="mov 2, %o0"@},
@{address="0x000107c4",func-name="main",offset="8",
inst="sethi %hi(0x11800), %o2"@}]@}]
-(@value{GDBP})
+(gdb)
@end smallexample
@smallexample
211-data-evaluate-expression A
211^done,value="1"
-(@value{GDBP})
+(gdb)
311-data-evaluate-expression &A
311^done,value="0xefffeb7c"
-(@value{GDBP})
+(gdb)
411-data-evaluate-expression A+3
411^done,value="4"
-(@value{GDBP})
+(gdb)
511-data-evaluate-expression "A + 3"
511^done,value="4"
-(@value{GDBP})
+(gdb)
@end smallexample
On a PPC MBX board:
@smallexample
-(@value{GDBP})
+(gdb)
-exec-continue
^running
-(@value{GDBP})
+(gdb)
*stopped,reason="breakpoint-hit",bkptno="1",frame=@{func="main",
args=[],file="try.c",fullname="/home/foo/bar/try.c",line="5"@}
-(@value{GDBP})
+(gdb)
-data-list-changed-registers
^done,changed-registers=["0","1","2","4","5","6","7","8","9",
"10","11","13","14","15","16","17","18","19","20","21","22","23",
"24","25","26","27","28","30","31","64","65","66","67","69"]
-(@value{GDBP})
+(gdb)
@end smallexample
For the PPC MBX board:
@smallexample
-(@value{GDBP})
+(gdb)
-data-list-register-names
^done,register-names=["r0","r1","r2","r3","r4","r5","r6","r7",
"r8","r9","r10","r11","r12","r13","r14","r15","r16","r17","r18",
"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})
+(gdb)
-data-list-register-names 1 2 3
^done,register-names=["r1","r2","r3"]
-(@value{GDBP})
+(gdb)
@end smallexample
@subheading The @code{-data-list-register-values} Command
don't appear in the actual output):
@smallexample
-(@value{GDBP})
+(gdb)
-data-list-register-values r 64 65
^done,register-values=[@{number="64",value="0xfe00a300"@},
@{number="65",value="0x00029002"@}]
-(@value{GDBP})
+(gdb)
-data-list-register-values x
^done,register-values=[@{number="0",value="0xfe0043c8"@},
@{number="1",value="0x3fff88"@},@{number="2",value="0xfffffffe"@},
@{number="65",value="0x29002"@},@{number="66",value="0x202f04b5"@},
@{number="67",value="0xfe0043b0"@},@{number="68",value="0xfe00b3e4"@},
@{number="69",value="0x20002b03"@}]
-(@value{GDBP})
+(gdb)
@end smallexample
word. Display each word in hex.
@smallexample
-(@value{GDBP})
+(gdb)
9-data-read-memory -o -6 -- bytes+6 x 1 3 2
9^done,addr="0x00001390",nr-bytes="6",total-bytes="6",
next-row="0x00001396",prev-row="0x0000138e",next-page="0x00001396",
@{addr="0x00001390",data=["0x00","0x01"]@},
@{addr="0x00001392",data=["0x02","0x03"]@},
@{addr="0x00001394",data=["0x04","0x05"]@}]
-(@value{GDBP})
+(gdb)
@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})
+(gdb)
5-data-read-memory shorts+64 d 2 1 1
5^done,addr="0x00001510",nr-bytes="2",total-bytes="2",
next-row="0x00001512",prev-row="0x0000150e",
next-page="0x00001512",prev-page="0x0000150e",memory=[
@{addr="0x00001510",data=["128"]@}]
-(@value{GDBP})
+(gdb)
@end smallexample
Read thirty two bytes of memory starting at @code{bytes+16} and format
used as the non-printable character.
@smallexample
-(@value{GDBP})
+(gdb)
4-data-read-memory bytes+16 x 1 8 4 x
4^done,addr="0x000013a0",nr-bytes="32",total-bytes="32",
next-row="0x000013c0",prev-row="0x0000139c",
@{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})
+(gdb)
@end smallexample
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-symbol-list-lines basics.c
^done,lines=[@{pc="0x08048554",line="7"@},@{pc="0x0804855a",line="8"@}]
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-file-exec-and-symbols /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-file-exec-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
123-file-list-exec-source-file
123^done,line="1",file="foo.c",fullname="/home/bar/foo.c"
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-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})
+(gdb)
@end smallexample
@subheading The @code{-file-list-shared-libraries} Command
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-file-symbol-file /kwikemart/marge/ezannoni/TRUNK/mbx/hello.mbx
^done
-(@value{GDBP})
+(gdb)
@end smallexample
@ignore
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-target-detach
^done
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-target-disconnect
^done
-(@value{GDBP})
+(gdb)
@end smallexample
have been broken down so that they can fit onto a page.
@smallexample
-(@value{GDBP})
+(gdb)
-target-download
+download,@{section=".text",section-size="6668",total-size="9880"@}
+download,@{section=".text",section-sent="512",section-size="6668",
total-sent="9796",total-size="9880"@}
^done,address="0x10004",load-size="9880",transfer-rate="6586",
write-rate="429"
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-target-select async /dev/ttya
^connected,addr="0xfe00a300",func="??",args=[]
-(@value{GDBP})
+(gdb)
@end smallexample
@c %%%%%%%%%%%%%%%%%%%%%%%%%%%% SECTION %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-gdb-exit
^exit
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-gdb-set $foo=3
^done
-(@value{GDBP})
+(gdb)
@end smallexample
@subsubheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-gdb-show annotate
^done,value="0"
-(@value{GDBP})
+(gdb)
@end smallexample
@c @subheading -gdb-source
@c This example modifies the actual output from GDB to avoid overfull
@c box in TeX.
@smallexample
-(@value{GDBP})
+(gdb)
-gdb-version
~GNU gdb 5.2.1
~Copyright 2000 Free Software Foundation, Inc.
~This GDB was configured as
"--host=sparc-sun-solaris2.5.1 --target=ppc-eabi".
^done
-(@value{GDBP})
+(gdb)
@end smallexample
@subheading The @code{-interpreter-exec} Command
@subheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-interpreter-exec console "break main"
&"During symbol reading, couldn't parse type; debugger out of date?.\n"
&"During symbol reading, bad structure-type format.\n"
~"Breakpoint 1 at 0x8074fc6: file ../../src/gdb/main.c, line 743.\n"
^done
-(@value{GDBP})
+(gdb)
@end smallexample
@subheading The @code{-inferior-tty-set} Command
@subheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-inferior-tty-set /dev/pts/1
^done
-(@value{GDBP})
+(gdb)
@end smallexample
@subheading The @code{-inferior-tty-show} Command
@subheading Example
@smallexample
-(@value{GDBP})
+(gdb)
-inferior-tty-set /dev/pts/1
^done
-(@value{GDBP})
+(gdb)
-inferior-tty-show
^done,inferior_tty_terminal="/dev/pts/1"
-(@value{GDBP})
+(gdb)
@end smallexample
@node Annotations