mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
panic handler: Print backtraces with calling address not return address
This seems to clean up some of the more wrong addr2line output results (not sure why, something to do with optimisations I think - perhaps the return address may also be a jump target from some earlier line of the code.)
This commit is contained in:
parent
47e789f538
commit
5d7bffea2b
@ -375,7 +375,7 @@ static void doBacktrace(XtExcFrame *frame)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
sp = *((uint32_t *) (sp - 0x10 + 4));
|
sp = *((uint32_t *) (sp - 0x10 + 4));
|
||||||
putEntry(pc, sp);
|
putEntry(pc - 3, sp); // stack frame addresses are return addresses, so subtract 3 to get the CALL address
|
||||||
pc = *((uint32_t *) (psp - 0x10));
|
pc = *((uint32_t *) (psp - 0x10));
|
||||||
if (pc < 0x40000000) {
|
if (pc < 0x40000000) {
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user