summaryrefslogtreecommitdiff
path: root/gdb/arch
diff options
context:
space:
mode:
authorTorbjörn SVENSSON <torbjorn.svensson@foss.st.com>2022-10-06 16:01:10 +0200
committerYvan Roux <yvan.roux@foss.st.com>2022-10-06 16:01:10 +0200
commit60c90d8c6d4b8345b41ab6a0b4d5169d5f78edb3 (patch)
tree27be0a0f682216227f1f469874293a1e6d6cc0da /gdb/arch
parentca10a126c67f03e4e56dbbb6966c1682014912d8 (diff)
downloadbinutils-gdb-60c90d8c6d4b8345b41ab6a0b4d5169d5f78edb3.tar.gz
gdb/arm: Handle lazy FPU state preservation
Read LSPEN, ASPEN and LSPACT bits from FPCCR and use them together with FPCAR to identify if lazy FPU state preservation is active for the current frame. See "Lazy context save of FP state", in B1.5.7, also ARM AN298, supported by Cortex-M4F architecture for details on lazy FPU register stacking. The same conditions are valid for other Cortex-M cores with FPU. This patch has been verified on a STM32F4-Discovery board by: a) writing a non-zero value (lets use 0x1122334455667788 as an example) to all the D-registers in the main function b) configured the SysTick to fire c) in the SysTick_Handler, write some other value (lets use 0x0022446688aaccee as an example) to one of the D-registers (D0 as an example) and then do "SVC #0" d) in the SVC_Handler, write some other value (lets use 0x0099aabbccddeeff) to one of the D-registers (D0 as an example) In GDB, suspend the execution in the SVC_Handler function and compare the value of the D-registers for the SVC_handler frame and the SysTick_Handler frame. With the patch, the value of the modified D-register (D0) should be the new value (0x009..eff) on the SVC_Handler frame, and the intermediate value (0x002..cee) for the SysTick_Handler frame. Now compare the D-register value for the SysTick_Handler frame and the main frame. The main frame should have the initial value (0x112..788). Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com> Signed-off-by: Yvan ROUX <yvan.roux@foss.st.com>
Diffstat (limited to 'gdb/arch')
-rw-r--r--gdb/arch/arm.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/gdb/arch/arm.h b/gdb/arch/arm.h
index 36757493406..d384b952144 100644
--- a/gdb/arch/arm.h
+++ b/gdb/arch/arm.h
@@ -115,7 +115,12 @@ enum system_register_address : CORE_ADDR
/* M-profile Floating-Point Context Control Register address, defined in
ARMv7-M (Section B3.2.2) and ARMv8-M (Section D1.2.99) reference
manuals. */
- FPCCR = 0xe000ef34
+ FPCCR = 0xe000ef34,
+
+ /* M-profile Floating-Point Context Address Register address, defined in
+ ARMv7-M (Section B3.2.2) and ARMv8-M (Section D1.2.98) reference
+ manuals. */
+ FPCAR = 0xe000ef38
};
/* Instruction condition field values. */