Sun Studio 12:使用 dbx 调试程序

本地模式语法

thread

显示当前线程。

thread thread_id

切换到线程 thread_id

在下列变量中,如果没有 thread_id,则表示当前线程。

thread -info [thread_id]

打印有关指定线程的所有信息。

thread -hide [thread_id]

隐藏指定(或当前)线程。它将不会显示在通用线程列表中。

thread -unhhide [thread_id]

取消隐藏指定(或当前)线程。

thread -unhide all

取消隐藏所有线程。

thread -suspend thread_id

阻止指定线程运行。在线程列表中挂起的线程标有 "S"。

thread -resume thread_id

撤消使用 -suspend 执行的操作。

thread -blocks [thread_id]

列出阻塞其他线程的指定线程所控制的所有锁。

thread -blockedby [thread_id]

显示哪个同步对象阻塞了指定线程(如果有)。

其中:

thread_id 是线程 ID。