From 5962b1dc5653ac95a40a7d1b70bbd73e8e1a3c26 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Tue, 24 Nov 2020 16:38:57 +0100 Subject: [PATCH] panic: print register dump on abort for RISC-V Register values are necessary to perform host-side backtracing on RISC-V. Print them in case of an abort as well. --- components/esp_system/port/panic_handler.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/components/esp_system/port/panic_handler.c b/components/esp_system/port/panic_handler.c index bbf2e9adfc..24f34e5ce0 100644 --- a/components/esp_system/port/panic_handler.c +++ b/components/esp_system/port/panic_handler.c @@ -64,7 +64,15 @@ void *g_exc_frames[SOC_CPU_CORES_NUM] = {NULL}; */ static void print_state_for_core(const void *f, int core) { + /* On Xtensa (with Window ABI), register dump is not required for backtracing. + * Don't print it on abort to reduce clutter. + * On other architectures, register values need to be known for backtracing. + */ +#if defined(__XTENSA__) && defined(XCHAL_HAVE_WINDOWED) if (!g_panic_abort) { +#else + if (true) { +#endif panic_print_registers(f, core); panic_print_str("\r\n"); }