From: Christophe Lyon <christophe.lyon@arm.com>
To: Yvan Roux <yvan.roux@foss.st.com>, gdb-patches@sourceware.org
Cc: Torbjorn Svensson <torbjorn.svensson@st.com>
Subject: Re: [PATCH 2/3] gdb/arm: Fetch initial sp value prior to compare
Date: Mon, 16 May 2022 16:56:04 +0200 [thread overview]
Message-ID: <bc1bbeae-f4a1-bc36-39d1-c3ba22bd894f@arm.com> (raw)
In-Reply-To: <20220516135935.GC27993@gnbcxd0114.gnb.st.com>
Hi,
On 5/16/22 15:59, Yvan Roux via Gdb-patches wrote:
> For Arm Cortex-M33 with security extensions, there are 4 different
> stacks 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 initla sp register needs to be fetched to
Typo: "initial"
> perform this comparison.
>
> Signed-off-by: Torbj�rn SVENSSON <torbjorn.svensson@st.com>
> Signed-off-by: Yvan Roux <yvan.roux@foss.st.com>
> ---
> gdb/arm-tdep.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
> index c37254c2ce1..4aa277f5bc8 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);
With such simple fixes, I always wonder "how did that somehow worked so
far?". Can you describe the broken scenario fixed by this patch?
Thanks,
Christophe
>
> if (tdep->have_sec_ext)
> {
next prev parent reply other threads:[~2022-05-16 14:56 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-16 13:54 [PATCH 0/3] gdb/arm: Cortex-M33 trustzone stack unwinding fixes Yvan Roux
2022-05-16 13:58 ` [PATCH 1/3] gdb/arm: Set the correct address to the FPU register on Yvan Roux
2022-05-16 14:46 ` Christophe Lyon
2022-05-17 9:49 ` Torbjorn SVENSSON
2022-05-17 15:44 ` Luis Machado
2022-05-18 19:24 ` Torbjorn SVENSSON
2022-05-19 8:17 ` Luis Machado
2022-05-19 13:24 ` Torbjorn SVENSSON
2022-06-02 9:20 ` Yvan Roux
2022-05-16 13:59 ` [PATCH 2/3] gdb/arm: Fetch initial sp value prior to compare Yvan Roux
2022-05-16 14:56 ` Christophe Lyon [this message]
2022-05-17 9:54 ` Torbjorn SVENSSON
2022-05-16 14:00 ` [PATCH 3/3] gdb/arm: Track msp and psp Yvan Roux
2022-05-16 14:25 ` Lancelot SIX
2022-05-17 15:52 ` Luis Machado
2022-05-18 19:18 ` Torbjorn SVENSSON
2022-05-19 8:07 ` Luis Machado
2022-05-19 13:16 ` Torbjorn SVENSSON
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bc1bbeae-f4a1-bc36-39d1-c3ba22bd894f@arm.com \
--to=christophe.lyon@arm.com \
--cc=gdb-patches@sourceware.org \
--cc=torbjorn.svensson@st.com \
--cc=yvan.roux@foss.st.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).