### 25.9 gdb/mi Thread Commands

#### The `-thread-info` Command

##### Synopsis

          -thread-info

##### gdb Command

No equivalent.

##### Example

N.A.

#### The `-thread-list-all-threads` Command

##### Synopsis

          -thread-list-all-threads

##### gdb Command

The equivalent gdb command is ``info threads`'.

##### Example

N.A.

#### The `-thread-list-ids` Command

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

##### gdb Command

Part of ``info threads`' supplies the same information.

##### 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)

#### 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)
         *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)