---
title: list命令
description: "展示当前程序暂停位置的前后若干行代码。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengdevps/debugging/debugger/KunpengDevKitCli_0142.html
sourcePath: /source/zh/kunpengdevps/debugging/debugger/KunpengDevKitCli_0142.html
indexId: 14bdb26a64ef3808ce822ab324f37e5ec9ece03d9fe648db103d46977e49e06969
---
# list命令

#### 命令功能

展示当前程序暂停位置的前后若干行代码。


#### 命令格式

```
list [-h | --help] [-r RANK_ID | --rank RANK_ID] [-t THREAD_INDEX | --thread THREAD_INDEX] [-l LINE_NUMBER | --lines LINE_NUMBER]
```

list命令可简写为l。


#### 参数说明


**表1 list参数说明**

| 参数 | 参数说明 |
| --- | --- |
| \-h/\-\-help | 可选参数，获取帮助信息。 |
| \-r/\-\-rank | 可选参数，指定rank ID。 |
| \-t/\-\-thread | 可选参数，指定线程索引。 |
| \-l/\-\-lines | 可选参数，指定当前暂停位置前后代码行数，不包括当前行。 |


#### 使用示例

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

```
list -h
```

返回信息如下：

```
OVERVIEW
    Run this command to display the code context of the current pause location of the application.

USAGE
    list
    [-h | --help]
    [-r RANK_ID | --rank RANK_ID]
    [-t THREAD_INDEX | --thread THREAD_INDEX]
    [-l LINE_NUMBER | --lines LINE_NUMBER]

OPTIONS
    -h, --help
    Get help information.
    -r, --rank RANK_ID
    Specifies the rank ID of the source code to be queried.
    -t, --thread THREAD_INDEX
    Specifies the thread INDEX of the source code to be queried.
    -l, --lines LINE_NUMBER
    Specifies the number of lines of code before and after the program pause position to be displayed.

EXAMPLE
    # Displays the 10 lines of code before and after the pause location of the rank 0 application.
    list -l 10 -r 0
```
