zephyr/arch/arm
Mark Holden ec7943bb18 coredump: ARM: Ensure sp in dump is set as gdb expects
Gdb is typically able to reconstruct the first two frames of the
failing stack using the "pc" and "lr" registers. After that, (if
the frame pointer is omitted) it appears to need the stack pointer
(sp register) to point to the top of the stack before a fatal
error occurred.

The ARM Cortex-M processors push registers r0-r3, r12, LR,
{possibly FPU registers}, PC, SPSR onto the stack before entering the
exception handler. We adjust the stack pointer back to the point
before these registers were pushed for preservation in the dump.

During k_oops/k_panic, the sp wasn't stored in the core dump at all.
Apply similar logic to store it when failures occur in that path.

Signed-off-by: Mark Holden <mholden@meta.com>
2024-10-09 09:41:00 +02:00
..
core coredump: ARM: Ensure sp in dump is set as gdb expects 2024-10-09 09:41:00 +02:00
include coredump: ARM: Ensure sp in dump is set as gdb expects 2024-10-09 09:41:00 +02:00
CMakeLists.txt arch: arm: cmake: Correct endian in output format 2024-07-04 18:01:51 -04:00
Kconfig