Sun Studio 12: Debugging a Program With dbx

thread Command

The thread command lists or changes the current thread.

Native Mode Syntax

thread

Display current thread.

thread thread_id

Switch to thread thread_id.

In the following variations, a missing thread_id implies the current thread.

thread -info [thread_id]

Print everything known about the given thread.

thread -hide [thread_id]

Hide the given (or current) thread. It will not show up in the generic threads listing.

thread -unhhide [thread_id]

Unhide the given (or current) thread.

thread -unhide all

Unhide all threads.

thread -suspend thread_id

Keep the given thread from ever running. A suspended thread shows up with an “S” in the threads list.

thread -resume thread_id

Undo the effect of -suspend.

thread -blocks [thread_id]

List all locks held by the given thread blocking other threads.

thread -blockedby [thread_id]

Show which synchronization object the given thread is blocked by, if any.

where:

thread_id is a thread ID.

Java Mode Syntax

thread

Display current thread.

thread thread_id

Switch to thread thread_id.

In the following variations, a missing thread_id implies the current thread.

thread -info [thread_id]

Print everything known about the given thread.

thread -hide [thread_id]

Hide the given (or current) thread. It will not show up in the generic threads listing.

thread -unhide [thread_id]

Unhide the given (or current) thread.

thread -unhide all

Unhide all threads.

thread -suspend thread_id

Keep the given thread from ever running. A suspended thread shows up with an “S” in the threads list.

thread -resume thread_id

Undo the effect of -suspend.

thread -blocks [thread_id]

Lists the Java monitor owned by thread_id.

thread -blockedby [thread_id]

Lists the Java monitor on which thread_id is blocked.

where:

thread_id is a dbx-style thread ID of the form t@number or the Java thread name specified for the thread.