aboutsummaryrefslogtreecommitdiff
path: root/gdb/features
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@arm.com>2022-04-01 10:22:16 +0100
committerChristophe Lyon <christophe.lyon@arm.com>2022-04-27 15:18:18 +0100
commitae7e2f45aa4798be449f282bbf75ad41e73f055e (patch)
tree9f22bd3ae6c6e9dd732f1bb7a10d22e6693d1cc9 /gdb/features
parent0824193fd31467b6ff39132d0d72aaa9c01cc9aa (diff)
downloadgdb-ae7e2f45aa4798be449f282bbf75ad41e73f055e.zip
gdb-ae7e2f45aa4798be449f282bbf75ad41e73f055e.tar.gz
gdb-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')
-rw-r--r--gdb/features/arm/arm-secext.c17
-rw-r--r--gdb/features/arm/arm-secext.xml15
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>