Previous: GDB/MI File Transfer Commands, Up: GDB/MI
-gdb-exit
Command-gdb-exit
Exit gdb immediately.
Approximately corresponds to `quit'.
(gdb) -gdb-exit ^exit
-gdb-set
Command-gdb-set
Set an internal gdb variable.
The corresponding gdb command is `set'.
(gdb) -gdb-set $foo=3 ^done (gdb)
-gdb-show
Command-gdb-show
Show the current value of a gdb variable.
The corresponding gdb command is `show'.
(gdb) -gdb-show annotate ^done,value="0" (gdb)
-gdb-version
Command-gdb-version
Show version information for gdb. Used mostly in testing.
The gdb equivalent is `show version'. gdb by default shows this information when you start an interactive session.
(gdb) -gdb-version ~GNU gdb 5.2.1 ~Copyright 2000 Free Software Foundation, Inc. ~GDB is free software, covered by the GNU General Public License, and ~you are welcome to change it and/or distribute copies of it under ~ certain conditions. ~Type "show copying" to see the conditions. ~There is absolutely no warranty for GDB. Type "show warranty" for ~ details. ~This GDB was configured as "--host=sparc-sun-solaris2.5.1 --target=ppc-eabi". ^done (gdb)
-list-features
CommandReturns a list of particular features of the MI protocol that this version of gdb implements. A feature can be a command, or a new field in an output of some command, or even an important bugfix. While a frontend can sometimes detect presence of a feature at runtime, it is easier to perform detection at debugger startup.
The command returns a list of strings, with each string naming an available feature. Each returned string is just a name, it does not have any internal structure. The list of possible feature names is given below.
Example output:
(gdb) -list-features ^done,result=["feature1","feature2"]
The current list of features is:
-var-set-frozen
command, as well
as possible presense of the frozen
field in the output
of -varobj-create
.
-break-insert
command.
-var-list-children
-thread-info
command.
-data-read-memory-bytes
and the
-data-write-memory-bytes
commands.
-ada-task-info
command.
-list-target-features
Command
Returns a list of particular features that are supported by the
target. Those features affect the permitted MI commands, but
unlike the features reported by the -list-features
command, the
features depend on which target GDB is using at the moment. Whenever
a target can change, due to commands such as -target-select
,
-target-attach
or -exec-run
, the list of target features
may change, and the frontend should obtain it again.
Example output:
(gdb) -list-features ^done,result=["async"]
The current list of features is:
-list-thread-groups
Command-list-thread-groups [ --available ] [ --recurse 1 ] [ group ... ]
Lists thread groups (see Thread groups). When a single thread group is passed as the argument, lists the children of that group. When several thread group are passed, lists information about those thread groups. Without any parameters, lists information about all top-level thread groups.
Normally, thread groups that are being debugged are reported. With the `--available' option, gdb reports thread groups available on the target.
The output of this command may have either a `threads' result or a `groups' result. The `thread' result has a list of tuples as value, with each tuple describing a thread (see GDB/MI Thread Information). The `groups' result has a list of tuples as value, each tuple describing a thread group. If top-level groups are requested (that is, no parameter is passed), or when several groups are passed, the output always has a `groups' result. The format of the `group' result is described below.
To reduce the number of roundtrips it's possible to list thread groups together with their children, by passing the `--recurse' option and the recursion depth. Presently, only recursion depth of 1 is permitted. If this option is present, then every reported thread group will also include its children, either as `group' or `threads' field.
In general, any combination of option and parameters is permitted, with the following caveats:
The `groups' result is a list of tuples, where each tuple may have the following fields:
id
type
pid
num_children
threads
cores
executable
gdb -list-thread-groups ^done,groups=[{id="17",type="process",pid="yyy",num_children="2"}] -list-thread-groups 17 ^done,threads=[{id="2",target-id="Thread 0xb7e14b90 (LWP 21257)", frame={level="0",addr="0xffffe410",func="__kernel_vsyscall",args=[]},state="running"}, {id="1",target-id="Thread 0xb7e156b0 (LWP 21254)", frame={level="0",addr="0x0804891f",func="foo",args=[{name="i",value="10"}], file="/tmp/a.c",fullname="/tmp/a.c",line="158"},state="running"}]] -list-thread-groups --available ^done,groups=[{id="17",type="process",pid="yyy",num_children="2",cores=[1,2]}] -list-thread-groups --available --recurse 1 ^done,groups=[{id="17", types="process",pid="yyy",num_children="2",cores=[1,2], threads=[{id="1",target-id="Thread 0xb7e14b90",cores=[1]}, {id="2",target-id="Thread 0xb7e14b90",cores=[2]}]},..] -list-thread-groups --available --recurse 1 17 18 ^done,groups=[{id="17", types="process",pid="yyy",num_children="2",cores=[1,2], threads=[{id="1",target-id="Thread 0xb7e14b90",cores=[1]}, {id="2",target-id="Thread 0xb7e14b90",cores=[2]}]},...]
-add-inferior
Command-add-inferior
Creates a new inferior (see Inferiors and Programs). The created inferior is not associated with any executable. Such association may be established with the `-file-exec-and-symbols' command (see GDB/MI File Commands). The command response has a single field, `thread-group', whose value is the identifier of the thread group corresponding to the new inferior.
gdb -add-inferior ^done,thread-group="i3"
-interpreter-exec
Command-interpreter-exec interpreter command
Execute the specified command in the given interpreter.
The corresponding gdb command is `interpreter-exec'.
(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 (gdb)
-inferior-tty-set
Command-inferior-tty-set /dev/pts/1
Set terminal for future runs of the program being debugged.
The corresponding gdb command is `set inferior-tty' /dev/pts/1.
(gdb) -inferior-tty-set /dev/pts/1 ^done (gdb)
-inferior-tty-show
Command-inferior-tty-show
Show terminal for future runs of program being debugged.
The corresponding gdb command is `show inferior-tty'.
(gdb) -inferior-tty-set /dev/pts/1 ^done (gdb) -inferior-tty-show ^done,inferior_tty_terminal="/dev/pts/1" (gdb)
-enable-timings
Command-enable-timings [yes | no]
Toggle the printing of the wallclock, user and system times for an MI command as a field in its output. This command is to help frontend developers optimize the performance of their code. No argument is equivalent to `yes'.
No equivalent.
(gdb) -enable-timings ^done (gdb) -break-insert main ^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y", addr="0x080484ed",func="main",file="myprog.c", fullname="/home/nickrob/myprog.c",line="73",times="0"}, time={wallclock="0.05185",user="0.00800",system="0.00000"} (gdb) -enable-timings no ^done (gdb) -exec-run ^running (gdb) *stopped,reason="breakpoint-hit",disp="keep",bkptno="1",thread-id="0", frame={addr="0x080484ed",func="main",args=[{name="argc",value="1"}, {name="argv",value="0xbfb60364"}],file="myprog.c", fullname="/home/nickrob/myprog.c",line="73"} (gdb)