docs(coredump): Add minor documentation improvements for coredump

This commit is contained in:
Roland Dobai 2025-01-20 14:01:18 +01:00
parent d30e4d9960
commit c640466e32
3 changed files with 16 additions and 27 deletions

View File

@ -138,8 +138,6 @@ Automatic Decoding
If :ref:`CONFIG_ESP_COREDUMP_DECODE` is set to automatically decode the UART core dump, ESP-IDF monitor will automatically decode the data, translate any function addresses to source code lines, and display it in the monitor. The output to ESP-IDF monitor would resemble the following output:
The :ref:`CONFIG_ESP_COREDUMP_UART_DELAY` allows for an optional delay to be added before the core dump file is output to UART.
.. code-block:: none
===============================================================
@ -188,6 +186,7 @@ The :ref:`CONFIG_ESP_COREDUMP_UART_DELAY` allows for an optional delay to be add
===================== ESP32 CORE DUMP END =====================
===============================================================
The :ref:`CONFIG_ESP_COREDUMP_UART_DELAY` allows for an optional delay to be added before the core dump file is output to UART.
Manual Decoding
^^^^^^^^^^^^^^^
@ -218,10 +217,12 @@ or
Core Dump Commands
------------------
ESP-IDF provides special commands to help to retrieve and analyze core dumps:
ESP-IDF provides special commands to retrieve and analyze core dumps:
* ``idf.py coredump-info`` - prints crashed task's registers, call stack, list of available tasks in the system, memory regions, and contents of memory stored in core dump (TCBs and stacks).
* ``idf.py coredump-debug`` - creates core dump ELF file and runs GDB debug session with this file. You can examine memory, variables, and task states manually. Note that since not all memory is saved in the core dump, only the values of variables allocated on the stack are meaningful.
* ``idf.py coredump-info`` - reads coredump from flash and prints crashed task's registers, call stack, list of available tasks in the system, memory regions, and contents of memory stored in core dump (TCBs and stacks).
* ``idf.py coredump-debug`` - reads coredump from flash, saves it as ELF file and runs a GDB debug session with this file. You can examine memory, variables, and task states manually. Note that since not all memory is saved in the core dump, only the values of variables allocated on the stack are meaningful.
``idf.py coredump-info --help`` and ``idf.py coredump-debug --help`` commands can be used to get more details on usage. For example, they can save the coredump into a file and avoid the need to read it from flash every time these commands are run.
For advanced users who want to pass additional arguments or use custom ELF files, it is possible to use the `esp-coredump <https://github.com/espressif/esp-coredump>`_ tool directly. For more information, use in ESP-IDF environment:
@ -288,13 +289,6 @@ Example
(gdb) p global_var
$1 = 25 '\031'
Running ``idf.py coredump-info`` and ``idf.py coredump-debug``
--------------------------------------------------------------
``idf.py coredump-info --help`` and ``idf.py coredump-debug --help`` commands can be used to get more details on usage.
Related Documents
^^^^^^^^^^^^^^^^^

View File

@ -138,8 +138,6 @@ ELF 格式具备扩展特性,支持在发生崩溃时保存更多关于错误
如果设置 :ref:`CONFIG_ESP_COREDUMP_DECODE`,使其自动解码 UART 核心转储文件ESP-IDF 监视器会自动解码数据将所有函数地址转换为源代码行并在监视器中显示相应信息。ESP-IDF 监视器会输出类似以下内容:
此外,选项 :ref:`CONFIG_ESP_COREDUMP_UART_DELAY` 支持在将核心转储文件输出到 UART 前添加延迟。
.. code-block:: none
===============================================================
@ -188,6 +186,7 @@ ELF 格式具备扩展特性,支持在发生崩溃时保存更多关于错误
===================== ESP32 CORE DUMP END =====================
===============================================================
此外,选项 :ref:`CONFIG_ESP_COREDUMP_UART_DELAY` 支持在将核心转储文件输出到 UART 前添加延迟。
手动解码
^^^^^^^^^^^^^^^
@ -218,10 +217,12 @@ ELF 格式具备扩展特性,支持在发生崩溃时保存更多关于错误
核心转储命令
------------------
ESP-IDF 提供了一些特殊命令,有助于检索和分析核心转储:
ESP-IDF 提供了一些特殊命令,于检索和分析核心转储:
* ``idf.py coredump-info`` - 打印崩溃任务的寄存器、调用栈、系统可用任务列表、内存区域以及核心转储中存储的内存内容(包括 TCB 和栈)。
* ``idf.py coredump-debug`` - 创建核心转储 ELF 文件,并使用该文件运行 GDB 调试会话。你可以手动检查内存、变量和任务状态。请注意,由于并未将所有内存保存在核心转储中,因此只有在栈上分配的变量的值才有意义。
* ``idf.py coredump-info`` - 从 flash 中读取核心转储,打印崩溃任务的寄存器、调用栈、系统可用任务列表、内存区域以及核心转储中存储的内存内容(包括 TCB 和栈)。
* ``idf.py coredump-debug`` - 从 flash 中读取核心转储,将其保存为 ELF 文件,并使用该文件运行 GDB 调试会话。你可以手动检查内存、变量和任务状态。请注意,由于并未将所有内存保存在核心转储中,因此只有在栈上分配的变量的值才有意义。
运行 ``idf.py coredump-info --help````idf.py coredump-debug --help`` 命令可以查看更详细的使用说明。例如,它们可以将核心转储保存到文件中,避免每次执行命令时都需要从 flash 中读取。
高阶用户如果需要传递额外参数或使用自定义 ELF 文件,可直接使用 `esp-coredump <https://github.com/espressif/esp-coredump>`_ 工具。如果在 ESP-IDF 环境中使用该工具,可运行如下命令查询更多信息:
@ -288,13 +289,6 @@ ESP-IDF 提供了一些特殊命令,有助于检索和分析核心转储:
(gdb) p global_var
$1 = 25 '\031'
运行 ``idf.py coredump-info````idf.py coredump-debug``
--------------------------------------------------------------
要获取更多有关使用方法的详情,请运行 ``idf.py coredump-info --help````idf.py coredump-debug --help`` 命令。
相关文档
^^^^^^^^^^^^^^^^^

View File

@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: 2022-2024 Espressif Systems (Shanghai) CO LTD
# SPDX-FileCopyrightText: 2022-2025 Espressif Systems (Shanghai) CO LTD
# SPDX-License-Identifier: Apache-2.0
import json
import os
@ -464,8 +464,9 @@ def action_extensions(base_actions: Dict, project_path: str) -> Dict:
{
'names': ['--chip-rev'],
'help': 'Specify the chip revision (e.g., 0.1). If provided, the corresponding ROM ELF file will be used '
'for decoding the core dump, improving stack traces. This is only needed for core dumps from IDF '
'<v5.1. Newer versions already contain chip revision information.',
'for decoding the core dump, improving stack traces. This is only needed for core dumps from '
'ESP-IDF older than v5.2. Newer versions already contain chip revision information.',
'hidden': True,
},
{
'names': ['--save-core', '-s'],