]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Fix exception stack unwinding for ARM Cortex-M
authorFredrik Hederstierna <fredrik.hederstierna@verisure.com>
Mon, 14 Sep 2020 13:56:34 +0000 (14:56 +0100)
committerAlan Hayward <alan.hayward@arm.com>
Tue, 15 Sep 2020 13:57:49 +0000 (14:57 +0100)
commitba8b04a8d8bcbd0c4c9f26463517e2f0df625438
tree579521af1483f15987ad14abc78e9038208e3ed3
parent9c4a30eb4544c476f185a620a3bb1876f209e3dd
Fix exception stack unwinding for ARM Cortex-M

For Cortex-M targets using floating-point, eg the Cortex-M4F, its not possible
to get any call-stack backtrace if setting a breakpoint in ISR.

The exception stack unwinder for Cortex-M does not consider if floating-point
registers was stacked or not, further the Cortex-M has two stack pointers: MSP
(Main Stack Pointer) and PSP (Process Stack Pointer).
This is not handled when GDB tries to backtrace in the exception stack
unwinder.

This patch fixes this, and gives a correct call-stack backtrace from
breakpoints set in a handler or ISR.

gdb/ChangeLog:

        * arm-tdep.c (arm_m_exception_cache): Try use correct stack
        pointer and stack frame offset when unwinding.
gdb/ChangeLog
gdb/arm-tdep.c