tools/idf_monitor: automatically decode UART core dumps

This adds detection of UART core dumps to IDF monitor. By default,
core dumps are not printed to the console, but are processed by
espcoredump.py using 'info_corefile' command. The result is printed
to stdout.

This feature can be disabled in menuconfig.

In the future this can be extended to allow running espcoredump.py
with 'dbg_corefile' argument, which is similar to the current GDB Stub
behavior.

Related to IDF-52.
This commit is contained in:
Ivan Grokhotkov
2020-02-06 19:29:50 +01:00
parent 605da33c3d
commit 25041ba583
7 changed files with 679 additions and 14 deletions

View File

@@ -6,7 +6,7 @@ import click
from idf_py_actions.errors import FatalError
from idf_py_actions.global_options import global_options
from idf_py_actions.tools import ensure_build_directory, run_tool, run_target
from idf_py_actions.tools import ensure_build_directory, run_tool, run_target, get_sdkconfig_value
PYTHON = sys.executable
@@ -95,6 +95,10 @@ def action_extensions(base_actions, project_path):
monitor_args += ["-b", monitor_baud]
monitor_args += ["--toolchain-prefix", project_desc["monitor_toolprefix"]]
coredump_decode = get_sdkconfig_value(project_desc["config_file"], "CONFIG_ESP32_CORE_DUMP_DECODE")
if coredump_decode is not None:
monitor_args += ["--decode-coredumps", coredump_decode]
if print_filter is not None:
monitor_args += ["--print_filter", print_filter]
monitor_args += [elf_file]