]> www.infradead.org Git - users/borneoa/openocd-next.git/commit
src/rtos/rtos_nuttx_stackings.c: Fix stack alignment for cortex-m targets
authordaniellizewski <daniellizewski@geotab.com>
Thu, 21 Mar 2024 13:58:34 +0000 (09:58 -0400)
committerAntonio Borneo <borneo.antonio@gmail.com>
Sat, 21 Sep 2024 09:02:59 +0000 (09:02 +0000)
commit5159c599157cc878521ae64e836675f7939c6a09
treef311c58783dcca50e5a8f1aa1f9f191551af72b2
parentb14f63e0045557118a5296e6049a3642011bf431
src/rtos/rtos_nuttx_stackings.c: Fix stack alignment for cortex-m targets

Backtraces performed by GDB on any thread other than the current
thread would fail if hardware 8 byte ISR stack alignment
was enabled on cortex_m targets. Stack reads now adjust
the stored SP to account for a potential offset introduced by hardware.
Fixed incorrect register offsets for cortex_m Nuttx frames by reading
the TCB info symbols to determine correct offsets.
Fixed offsets can no longer be used since the offsets have changed
multiple times for different Nuttx versions.
Tested on nuttx-12.1.0.
Tested using custom stm32h7 board and custom s32k148 board variants.
Built with CONFIG_ARCH_FPU enabled and disabled to
test FPU and non FPU frame logic.

Change-Id: Ifcbeefb0ddcfbcb528daa9d1d95732ca9584c9ef
Signed-off-by: daniellizewski <daniellizewski@geotab.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/8180
Reviewed-by: Antonio Borneo <borneo.antonio@gmail.com>
Tested-by: jenkins
src/rtos/nuttx.c
src/rtos/rtos_nuttx_stackings.c
src/rtos/rtos_nuttx_stackings.h