> ## Documentation Index
> Fetch the complete documentation index at: https://dragonwingdocs-staging.qualcomm.com/llms.txt
> Use this file to discover all available pages before exploring further.

# 配置调试符号

解析 coredump 需要调试符号。按照设计，Yocto Project 会编译软件包并将其拆分为多个软件包。例如，如果 `hello_0.1.bb` 文件编译 `hello.cpp` 文件，则会生成多个软件包。

下表列出了与 coredump 相关的软件包。

**表：解析 coredump 所需的软件包**

|             **软件包**             |                                                    **描述**                                                    |
| :-----------------------------: | :----------------------------------------------------------------------------------------------------------: |
|   `hello_0.1-r0_armv8-2a.rpm`   |                                  此软件包包含剥离（stripped）后的可执行文件，是唯一包含在设备镜像中的软件包。                                  |
| `hello-dbg_0.1-r0_armv8-2a.rpm` | 此软件包包含调试符号，从不打包到镜像中。调试软件包（-dbg）会显著增加镜像大小，将其包含在内会导致问题。除调试外，此软件包没有任何运行时价值。因此，作为策略，Yocto 不会在镜像中包含任何 `-dbg` 软件包。 |
| `hello-dev_0.1-r0_armv8-2a.rpm` |                                          此软件包包含依赖模块在编译期间使用的导出头文件和库。                                          |

根据 Yocto Project 标准，构建位置路径 `tmp/deploy/rpm/armv8-2a` 存储调试符号。例如，`tqftpserv-dbg_0.0+0+de42697a24-r0_armv8-2a.rpm` 软件包包含 `/usr/bin/tqftpserv` 目录的调试符号。

要将调试符号推送到设备，请使用 SSH 执行以下操作：

1. 重新挂载 rootfs。
   ```text theme={null}
   mount -o rw,remount /
   ```
2. 使用 `scp` 命令将调试符号（`tqftpserv-dbg_0.0+0+de42697a24-r0_armv8-2a.rpm`）推送到设备上任意可用的分区，例如 `/data/`。
   ```text theme={null}
   chmod 777 /data/tqftpserv-dbg_0.0+0+de42697a24-r0_armv8-2a.rpm
   ```
   ```text theme={null}
   cd data
   ```
3. 在设备上安装调试符号。
   ```text theme={null}
   dnf install tqftpserv-dbg_0.0+0+de42697a24-r0_armv8-2a.rpm
   ```
   将调试符号推送到设备后，系统会将符号保存到可执行文件所在目录路径下的 `.debug` 目录中。例如，如果可执行文件位于 `/usr/bin/tqftpserv` 目录中，则系统会将调试符号保存在 `/usr/bin/.debug` 目录中。
4. 要确认设备上可用的调试符号，请运行以下命令：
   ```text theme={null}
   cd /usr/bin/.debug
   ```
   ```text theme={null}
   ls
   ```

**示例输出：**

```text theme={null}
gencat getent locale pcprofiledump sprof zdump

getconf iconv makedb pldd tqftpserv
```
