# 调试文档

使用调试工具和日志诊断子系统差异，帮助您排查系统级问题。

## 调试概述

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg>  调试工作流

识别错误并找到需要调试的组件。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/Debug-overview.html#identify-subsystem-to-be-debugged

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 调试方法

应用调试方法修复硬件和软件问题。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/Debug-overview.html#debugging-approaches

## 调试 Linux 用户空间问题

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 使用 ltrace 调试

跟踪库调用并调试应用程序行为。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/using_open_source_debug_tools.html#ltrace

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 使用 Valgrind 调试

识别内存问题。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/using_open_source_debug_tools.html#debug-using-valgrind

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 使用 GDB 调试

启用 GNU 项目调试器来识别应用程序问题。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/using_open_source_debug_tools.html#debug-using-gdb

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 收集 coredump

使用 coredump 分析，找到进程崩溃的位置并找出根本原因。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/using_open_source_debug_tools.html#collect-coredumps

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 使用 gdbserver 调试

即使设备用于调试符号的空间有限，也能有效地进行故障排查。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/using_open_source_debug_tools.html#debug-using-gdbserver

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 使用用户空间日志进行调试

使用 SSH 连接并使用调试工具来识别和排查 Linux 用户空间中的问题。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/using_open_source_debug_tools.html#userspace-logs

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 配置调试符号

通过启用调试符号并使用正确的软件包解析 coredump 来分析系统崩溃。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/using_open_source_debug_tools.html#debug-symbols

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 重启系统

触发受控或强制的系统重启，以应用配置更改、从严重故障中恢复或以最小的干扰启动诊断工作流。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/using_open_source_debug_tools.html#reboot-device-from-userspace

## 调试 Linux 内核空间问题

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 启用动态调试

激活 debugfs 文件系统以实时动态调试内核组件。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/debugging_linux_kernel.html#enable-dynamic-debug

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 启用内核调试选项

使用内核配置设置来调试内存泄漏，锁争用以及与互斥锁相关的问题。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/debugging_linux_kernel.html#fmk1520725112713

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 配置内核进行调试

探索支持调试并帮助检测内存相关问题的常见内核设置。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/debugging_linux_kernel.html#mox1520725120450

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 评估内存使用情况

了解如何管理和利用虚拟内存，以优化系统性能和稳定性。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/debugging_linux_kernel.html#qex1520725113914

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 跟踪内核函数

在 runtime 跟踪内核函数，以分析和调试复杂的系统行为。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/debugging_linux_kernel.html#tag1520725122494

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 收集并解析 RAM dump

使用平台工具采集和解码崩溃时内存，以追踪根本原因并进行故障后分析。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/debugging_linux_kernel.html#collect-and-parse-ram-dumps

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 使用 RAMParser 解析 RAM dump

使用开源 Linux RAMParser 分析 Qualcomm RAM dump，以提取进程堆栈、IRQ 和工作队列，从而进行深入的崩溃诊断。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/debugging_linux_kernel.html#parse-ram-dumps-using-linux-ramdump-parser-rdp

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 使用 QCAP 解析 RAM dump

分析子系统日志并使用 QCAP 识别初始故障点。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/debugging_linux_kernel.html#parse-ram-dumps-using-qcap

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 使用 Crash utility 工具进行调试

通过基于 GDB 的 CLI 分析 RAM dump，以检查内核状态并调试 Linux 系统崩溃后的问题。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/debugging_linux_kernel.html#crash-utility

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 采集子系统 dump

启用并采集子系统的 coredump，以支持有针对性的调试和根本原因分析。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/debugging_linux_kernel.html#subsystem-ram-dumps

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 使用 OpenOCD 进行调试

使用 OpenOCD 片上接口对嵌入式目标执行实时调试、刷写和边界扫描测试。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/debugging_linux_kernel.html#debug-using-openocd

## 调试常见系统问题

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 调试看门狗超时问题

调试与看门狗相关的故障，帮助您的系统从意外的硬件或软件崩溃中恢复。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/general_system_debugging.html#watchdog-timeout

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 总线 hang 和超时问题

调试总线 hang 和超时问题，以防止组件发生可能触发严重系统错误的故障。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/general_system_debugging.html#erroneous-transaction-on-bus-error-and-timeout

<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewbox="0 0 16 16" fill="none" aria-label="icon3">
  <path d="M8 2V14M3.33333 2H12.6667C13.403 2 14 2.59695 14 3.33333V12.6667C14 13.403 13.403 14 12.6667 14H3.33333C2.59695 14 2 13.403 2 12.6667V3.33333C2 2.59695 2.59695 2 3.33333 2Z" stroke="#2A2AEA" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"></path>
</svg> 确定硬件复位的原因

使用有针对性的调试方法来确定意外硬件复位和系统重启的根本原因。

https://docs.qualcomm.com/doc/80-70020-12SC/topic/general_system_debugging.html#reset-hardware

Last Published: Jul 24, 2025

[Next Topic
调试概述](https://docs.qualcomm.com/bundle/publicresource/80-70020-12SC/topics/Debug-overview.md)