Skip to content

Commit a81c1e9

Browse files
authored
Merge branch 'master' into master
2 parents 8cc6ec1 + dd73a18 commit a81c1e9

19 files changed

+2442
-1907
lines changed

cores/esp8266/core_esp8266_postmortem.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ static int s_user_reset_reason = REASON_DEFAULT_RST;
6262
// From UMM, the last caller of a malloc/realloc/calloc which failed:
6363
extern void *umm_last_fail_alloc_addr;
6464
extern int umm_last_fail_alloc_size;
65+
#if defined(DEBUG_ESP_OOM)
66+
extern const char *umm_last_fail_alloc_file;
67+
extern int umm_last_fail_alloc_line;
68+
#endif
6569

6670
static void raise_exception() __attribute__((noreturn));
6771

@@ -181,7 +185,13 @@ void __wrap_system_restart_local() {
181185

182186
// Use cap-X formatting to ensure the standard EspExceptionDecoder doesn't match the address
183187
if (umm_last_fail_alloc_addr) {
184-
ets_printf_P(PSTR("\nlast failed alloc call: %08X(%d)\n"), (uint32_t)umm_last_fail_alloc_addr, umm_last_fail_alloc_size);
188+
#if defined(DEBUG_ESP_OOM)
189+
ets_printf_P(PSTR("\nlast failed alloc call: %08X(%d)@%S:%d\n"),
190+
(uint32_t)umm_last_fail_alloc_addr, umm_last_fail_alloc_size,
191+
umm_last_fail_alloc_file, umm_last_fail_alloc_line);
192+
#else
193+
ets_printf_P(PSTR("\nlast failed alloc call: %08X(%d)\n"), (uint32_t)umm_last_fail_alloc_addr, umm_last_fail_alloc_size);
194+
#endif
185195
}
186196

187197
custom_crash_callback( &rst_info, sp_dump + offset, stack_end );

0 commit comments

Comments
 (0)