---
title: thread命令
description: "查看单个/全部thread信息、设置调试作用范围。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengdevps/debugging/debugger/KunpengDevKitCli_0141.html
sourcePath: /source/zh/kunpengdevps/debugging/debugger/KunpengDevKitCli_0141.html
indexId: 9cae109611792c0572c818ce4a012070e7695fbc6e8b34e12fe2b0d240fe2c8969
---
# thread命令

#### 命令功能

查看单个/全部thread信息、设置调试作用范围。


#### 命令格式

查看全部thread信息：

```
thread list [-h | --help]
```

查看单个thread信息：

```
thread info [-h | --help]
{THREAD_INDEX
}
```

设置调试作用范围：

```
thread set [-h | --help]
{
THREAD_INDEX
}
```

- thread命令可简写为t，例如：t info 1。
- THREAD_INDEX：是指线程索引，该参数为必选参数，取值为正整数。


#### 参数说明


**表1 list命令参数**

| 参数 | 参数说明 |
| --- | --- |
| 无 | 查看全部thread信息。 |
| \-h/\-\-help | 可选参数，获取帮助信息。 |


**表2 info命令参数**

| 参数 | 参数说明 |
| --- | --- |
| {THREAD\_INDEX} | {THREAD\_INDEX}替换为实际的线程索引，查看单个thread信息，例如thread info 1。 |
| \-h/\-\-help | 可选参数，获取帮助信息。 |


**表3 set命令参数**

| 参数 | 参数说明 |
| --- | --- |
| {THREAD\_INDEX} | {THREAD\_INDEX}替换为实际的线程索引，设置调试作用范围，例如thread set 1。 |
| \-h/\-\-help | 可选参数，获取帮助信息。 |


#### 使用示例

执行以下命令，查看thread支持的功能信息：

```
thread -h
```

返回信息如下：

```
The most commonly used thread(t) sub commands are:
    list        Displays all threads in the current rank.
    info        Displays the specified thread in the current rank.
    set         Specifies the currently operated thread.
See 'thread(t) COMMAND -h/--help' for more information on a specific command.
```
