From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1844) id C12F83858D32; Wed, 15 Jun 2022 14:09:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C12F83858D32 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Yvan Roux To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb/arm: Fetch initial sp value prior to compare X-Act-Checkin: binutils-gdb X-Git-Author: Yvan Roux X-Git-Refname: refs/heads/master X-Git-Oldrev: 75033d08412577fb8ffcf76971e8d0393d14a8aa X-Git-Newrev: fe642a5b1411502000af9d169122522065dff9ca Message-Id: <20220615140934.C12F83858D32@sourceware.org> Date: Wed, 15 Jun 2022 14:09:34 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Jun 2022 14:09:34 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Dfe642a5b1411= 502000af9d169122522065dff9ca commit fe642a5b1411502000af9d169122522065dff9ca Author: Yvan Roux Date: Wed Jun 15 16:00:34 2022 +0200 gdb/arm: Fetch initial sp value prior to compare =20 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. =20 Signed-off-by: Torbj=C3=B6rn SVENSSON Signed-off-by: Yvan Roux Diff: --- 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, struc= t frame_info *frame) arm_gdbarch_tdep *tdep =3D (arm_gdbarch_tdep *) gdbarch_tdep (gdbarch); =20 arm_cache_init (cache, gdbarch); + cache->sp =3D get_frame_register_unsigned (frame, ARM_SP_REGNUM); =20 if (tdep->have_sec_ext) {