Oracle Solaris Studio 12.2:使用 dbx 调试程序

thread 命令

thread 命令用于列出或更改当前线程。

本地模式语法

thread

显示当前线程。

thread thread_id

切换到线程 thread_id

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

thread -info [thread_id]

输出有关指定线程的所有信息。对于 OpenMP 线程,这些信息包括 OpenMP 线程 ID、并行区域 ID、任务区域 ID 及线程状态。

thread -hide [thread_id]

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

thread -unhide [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。

Java 模式语法

thread

显示当前线程。

thread thread_id

切换到线程 thread_id

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

thread -info [thread_id]

输出有关指定线程的所有信息。

thread -hide [thread_id]

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

thread -unhide [thread_id]

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

thread -unhide all

取消隐藏所有线程。

thread -suspend thread_id

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

thread -resume thread_id

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

thread -blocks [thread_id]

列出 thread_id 拥有的 Java 监视器。

thread -blockedby [thread_id]

列出阻塞的 thread_id 所在的 Java 监视器。

其中:

thread_id 是格式为 t@numberdbx 样式的线程 ID 或为线程指定的 Java 线程名。