diff options
author | Christophe Lyon <christophe.lyon@arm.com> | 2022-04-01 10:22:16 +0100 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@arm.com> | 2022-04-27 15:18:18 +0100 |
commit | ae7e2f45aa4798be449f282bbf75ad41e73f055e (patch) | |
tree | 9f22bd3ae6c6e9dd732f1bb7a10d22e6693d1cc9 /gdb/features/arm | |
parent | 0824193fd31467b6ff39132d0d72aaa9c01cc9aa (diff) | |
download | binutils-ae7e2f45aa4798be449f282bbf75ad41e73f055e.zip binutils-ae7e2f45aa4798be449f282bbf75ad41e73f055e.tar.gz binutils-ae7e2f45aa4798be449f282bbf75ad41e73f055e.tar.bz2 |
gdb/arm: Add support for multiple stack pointers on Cortex-M
Armv8-M architecture with Security extension features four stack pointers
to handle Secure and Non-secure modes.
This patch adds support to switch between them as needed during
unwinding, and replaces all updates of cache->prev_sp with calls to
arm_cache_set_prev_sp.
Signed-off-by: Torbjörn Svensson <torbjorn.svensson@st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@foss.st.com>
Signed-off-by: Christophe Lyon <christophe.lyon@arm.com>
Diffstat (limited to 'gdb/features/arm')
-rw-r--r-- | gdb/features/arm/arm-secext.c | 17 | ||||
-rw-r--r-- | gdb/features/arm/arm-secext.xml | 15 |
2 files changed, 32 insertions, 0 deletions
diff --git a/gdb/features/arm/arm-secext.c b/gdb/features/arm/arm-secext.c new file mode 100644 index 0000000..39ef4af --- /dev/null +++ b/gdb/features/arm/arm-secext.c @@ -0,0 +1,17 @@ +/* THIS FILE IS GENERATED. -*- buffer-read-only: t -*- vi:set ro: + Original: arm-secext.xml */ + +#include "gdbsupport/tdesc.h" + +static int +create_feature_arm_arm_m_system (struct target_desc *result, long regnum) +{ + struct tdesc_feature *feature; + + feature = tdesc_create_feature (result, "org.gnu.gdb.arm.secext"); + tdesc_create_reg (feature, "msp_ns", regnum++, 1, NULL, 32, "data_ptr"); + tdesc_create_reg (feature, "psp_ns", regnum++, 1, NULL, 32, "data_ptr"); + tdesc_create_reg (feature, "msp_s", regnum++, 1, NULL, 32, "data_ptr"); + tdesc_create_reg (feature, "psp_s", regnum++, 1, NULL, 32, "data_ptr"); + return regnum; +} diff --git a/gdb/features/arm/arm-secext.xml b/gdb/features/arm/arm-secext.xml new file mode 100644 index 0000000..52b2c20 --- /dev/null +++ b/gdb/features/arm/arm-secext.xml @@ -0,0 +1,15 @@ +<?xml version="1.0"?> +<!-- Copyright (C) 2022 Free Software Foundation, Inc. + + Copying and distribution of this file, with or without modification, + are permitted in any medium without royalty provided the copyright + notice and this notice are preserved. --> + +<!DOCTYPE feature SYSTEM "gdb-target.dtd"> +<feature name="org.gnu.gdb.arm.secext"> + <!-- We have 4 stack pointers with the security extension. --> + <reg name="msp_ns" bitsize="32" type="data_ptr"/> + <reg name="psp_ns" bitsize="32" type="data_ptr"/> + <reg name="msp_s" bitsize="32" type="data_ptr"/> + <reg name="psp_s" bitsize="32" type="data_ptr"/> +</feature> |