thread

Show or change the current thread.

Syntax

thread [ID]

Parameters

ID

The identifier of the thread to which you want to switch.

Description

This command shows or changes the current thread. If you omit a thread identifier, the debugger shows the current thread. If you specify a thread identifier, the debugger makes that thread the current thread.

The debugger variable $curthread contains the thread identifier of the current thread. The $curthread value is updated when program execution stops or completes.

You can modify the current thread by assigning $curthread a valid thread identifier, which is equivalent to issuing the thread ID command. When there is no process or program, $curthread is set to 0.

Example

GDB Mode:

(idb) thread 2  
* 2 Thread 1026 (LWP 19515) 0x804f8f6 in __sigsuspend from /tmp/pthread_manythreads 

IDB Mode:

(idb) thread 2  
ID        STATE  
*1        stopped  

See Also


Submit feedback on this help topic

Copyright © 2001-2011, Intel Corporation. All rights reserved.