Skip to content

Commit f23e765

Browse files
committed
fix displaying caller address
1 parent c111713 commit f23e765

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

cores/esp8266/core_esp8266_postmortem.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,11 @@ void __wrap_system_restart_local() {
220220

221221
cut_here();
222222

223-
// now outside from the "cut-here" zone, print correctly the malloc address,
224-
// idf-monitor.py will be able to decode this one and show exact location in sources
225-
ets_printf_P(PSTR("\nlast failed alloc call: 0x%08x\n"), (uint32_t)umm_last_fail_alloc_addr);
223+
if (s_unhandled_exception && umm_last_fail_alloc_addr) {
224+
// now outside from the "cut-here" zone, print correctly the `new` caller address,
225+
// idf-monitor.py will be able to decode this one and show exact location in sources
226+
ets_printf_P(PSTR("\nlast failed alloc caller: 0x%08x\n"), (uint32_t)umm_last_fail_alloc_addr);
227+
}
226228

227229
custom_crash_callback( &rst_info, sp_dump + offset, stack_end );
228230

0 commit comments

Comments
 (0)