26.16. gdb/mi Thread Commands

26.16.1. The -thread-infoCommand

26.16.1.1. Synopsis

 -thread-info

26.16.1.2. gdb command

No equivalent.

26.16.1.3. Example

N.A.

26.16.2. The -thread-list-all-threadsCommand

26.16.2.1. Synopsis

 -thread-list-all-threads

26.16.2.2. gdb Command

The equivalent gdb command is info threads.

26.16.2.3. Example

N.A.

26.16.3. The -thread-list-idsCommand

26.16.3.1. Synopsis

 -thread-list-ids

Produces a list of the currently known gdb thread ids. At the end of the list it also prints the total number of such threads.

26.16.3.2. gdb Command

Part of info threads supplies the same information.

26.16.3.3. Example

No threads present, besides the main process:

(gdb)
-thread-list-ids
^done,thread-ids={},number-of-threads="0"
(gdb)

Several threads:

(gdb)
-thread-list-ids
^done,thread-ids={thread-id="3",thread-id="2",thread-id="1"},
number-of-threads="3"
(gdb)

26.16.4. The -thread-selectCommand

26.16.4.1. 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.

26.16.4.2. gdb Command

The corresponding gdb command is thread.

26.16.4.3. Example

(gdb)
-exec-next
^running
(gdb)
*stopped,reason="end-stepping-range",thread-id="2",line="187",
file="../../../devo/gdb/testsuite/gdb.threads/linux-dp.c"
(gdb)
-thread-list-ids
^done,
thread-ids={thread-id="3",thread-id="2",thread-id="1"},
number-of-threads="3"
(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"}
(gdb)