Debugging with GDB Manual HP WDB v6.3 (5900-2180, August 2012)
The -thread-select command
Synopsis
-thread-select threadnum
Make threadnum the current thread. It prints the number of the new current thread, and the
topmost frame for that thread.
GDB command
The corresponding GDB command is 'thread'.
Example
(gdb)
-exec-next
^running
(gdb)
~"0x7f7f0aec"
*stopped,reason="end-stepping-range",thread-id="2",frame=addr="0x00002ca4",func
="printme",args=[name="ip"],file="multithread.c",line="9"
(gdb)
-thread-list-ids
^done,thread-ids=thread-id="2",thread-id="1",number-of-threads="2"
(gdb)
-thread-select 1
^done,new-thread-id="1",frame=level="0 ",addr="0x7ad47d70",func="_lwp_create","
+0x10",args=[],from="/usr/lib/libpthread.1"
(gdb)
21.13 GDB/MI tracepoint commands
The tracepoint commands are not yet implemented.
21.14 GDB/MI variable objects
Motivation for variable objects in GDB/MI
For the implementation of a variable debugger window (locals, watched expressions, and so on.),
we are proposing the adaptation of the existing code used by Insight.
The two main reasons for that are:
1. It has been proven in practice (it is already on its second generation).
2. It will shorten development time (needless to say how important it is now).
The original interface was designed to be used by Tcl code, so it was slightly changed so it could
be used through GDB/MI. This section describes the GDB/MI operations that will be available and
gives some hints about their use.
NOTE: In addition to the set of operations described here, we expect the GUI implementation
of a variable window to require, at least, the following operations:
• -gdb-show output-radix
• -stack-list-arguments
• -stack-list-locals
• -stack-select-frame
Introduction to variable objects in 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.
282 The GDB/MI Interface