@@ -62,6 +62,10 @@ static int s_user_reset_reason = REASON_DEFAULT_RST;
62
62
// From UMM, the last caller of a malloc/realloc/calloc which failed:
63
63
extern void *umm_last_fail_alloc_addr;
64
64
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
65
69
66
70
static void raise_exception () __attribute__((noreturn));
67
71
@@ -181,7 +185,13 @@ void __wrap_system_restart_local() {
181
185
182
186
// Use cap-X formatting to ensure the standard EspExceptionDecoder doesn't match the address
183
187
if (umm_last_fail_alloc_addr) {
184
- ets_printf_P (PSTR (" \n last 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 (" \n last 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 (" \n last failed alloc call: %08X(%d)\n " ), (uint32_t )umm_last_fail_alloc_addr, umm_last_fail_alloc_size);
194
+ #endif
185
195
}
186
196
187
197
custom_crash_callback ( &rst_info, sp_dump + offset, stack_end );
0 commit comments