public inbox for
help / color / mirror / Atom feed
* [binutils-gdb] gdb/arm: Fetch initial sp value prior to compare
@ 2022-06-15 14:09 Yvan Roux
  0 siblings, 0 replies; only message in thread
From: Yvan Roux @ 2022-06-15 14:09 UTC (permalink / raw)
  To: gdb-cvs;h=fe642a5b1411502000af9d169122522065dff9ca

commit fe642a5b1411502000af9d169122522065dff9ca
Author: Yvan Roux <>
Date:   Wed Jun 15 16:00:34 2022 +0200

    gdb/arm: Fetch initial sp value prior to compare
    For Arm Cortex-M33 with security extensions, there are 4 different
    stack pointers (msp_s, msp_ns, psp_s, psp_ns).  In order to
    identify the active one, compare the values of the different
    stacks. The value of the initial sp register needs to be fetched to
    perform this comparison.
    Signed-off-by: Torbjörn SVENSSON <>
    Signed-off-by: Yvan Roux <>

 gdb/arm-tdep.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
index fe62617d4bf..7c36133a091 100644
--- a/gdb/arm-tdep.c
+++ b/gdb/arm-tdep.c
@@ -341,6 +341,7 @@ arm_cache_init (struct arm_prologue_cache *cache, struct frame_info *frame)
   arm_gdbarch_tdep *tdep = (arm_gdbarch_tdep *) gdbarch_tdep (gdbarch);
   arm_cache_init (cache, gdbarch);
+  cache->sp = get_frame_register_unsigned (frame, ARM_SP_REGNUM);
   if (tdep->have_sec_ext)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-06-15 14:09 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-15 14:09 [binutils-gdb] gdb/arm: Fetch initial sp value prior to compare Yvan Roux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).