From f23e765ab197ac0c003eea88a9168ae8e642511f Mon Sep 17 00:00:00 2001 From: david gauchard Date: Tue, 25 Aug 2020 11:00:48 +0200 Subject: [PATCH] fix displaying caller address --- cores/esp8266/core_esp8266_postmortem.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/cores/esp8266/core_esp8266_postmortem.cpp b/cores/esp8266/core_esp8266_postmortem.cpp index 8e10a0edd..3e75342d0 100644 --- a/cores/esp8266/core_esp8266_postmortem.cpp +++ b/cores/esp8266/core_esp8266_postmortem.cpp @@ -220,9 +220,11 @@ void __wrap_system_restart_local() { cut_here(); - // now outside from the "cut-here" zone, print correctly the malloc address, - // idf-monitor.py will be able to decode this one and show exact location in sources - ets_printf_P(PSTR("\nlast failed alloc call: 0x%08x\n"), (uint32_t)umm_last_fail_alloc_addr); + if (s_unhandled_exception && umm_last_fail_alloc_addr) { + // now outside from the "cut-here" zone, print correctly the `new` caller address, + // idf-monitor.py will be able to decode this one and show exact location in sources + ets_printf_P(PSTR("\nlast failed alloc caller: 0x%08x\n"), (uint32_t)umm_last_fail_alloc_addr); + } custom_crash_callback( &rst_info, sp_dump + offset, stack_end );