public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <luis.machado@arm.com>
To: Yvan Roux <yvan.roux@foss.st.com>, gdb-patches@sourceware.org
Cc: Torbjorn SVENSSON <torbjorn.svensson@foss.st.com>
Subject: Re: [PATCH V2 1/2] gdb/arm: Rename arm_cache_is_sp_register to
Date: Sat, 16 Jul 2022 03:03:08 +0100	[thread overview]
Message-ID: <64ba85e5-8a90-8874-5443-5dd32c18515e@arm.com> (raw)
In-Reply-To: <20220707091959.GC5239@gnbcxd0114.gnb.st.com>

Hi,

On 7/7/22 10:19, Yvan Roux wrote:
> All usage of this helper are really made to check if the register is
> one of the alternative SP (MSP/MSP_S/MSP_NS/PSP/PSP_S/PSP_NS) with
> ARM_SP_REGNUM case being handled separately.
> 
> Signed-off-by: Torbjörn SVENSSON <torbjorn.svensson@foss.st.com>
> Signed-off-by: Yvan Roux <yvan.roux@foss.st.com>
> ---
>   gdb/arm-tdep.c | 15 ++++++---------
>   1 file changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
> index 3a1b52c2380..89c2779bbb5 100644
> --- a/gdb/arm-tdep.c
> +++ b/gdb/arm-tdep.c
> @@ -479,14 +479,12 @@ arm_cache_set_active_sp_value (struct arm_prologue_cache *cache,
>     gdb_assert_not_reached ("Invalid SP selection");
>   }
>   
> -/* Return true if REGNUM is one of the stack pointers.  */
> +/* Return true if REGNUM is one of the alternative stack pointers.  */
>   
>   static bool
> -arm_cache_is_sp_register (struct arm_prologue_cache *cache,
> -			  arm_gdbarch_tdep *tdep, int regnum)
> +arm_is_alternative_sp_register (arm_gdbarch_tdep *tdep, int regnum)
>   {
> -  if ((regnum == ARM_SP_REGNUM)
> -      || (regnum == tdep->m_profile_msp_regnum)
> +  if ((regnum == tdep->m_profile_msp_regnum)
>         || (regnum == tdep->m_profile_msp_s_regnum)
>         || (regnum == tdep->m_profile_msp_ns_regnum)
>         || (regnum == tdep->m_profile_psp_regnum)
> @@ -503,8 +501,7 @@ static void
>   arm_cache_switch_prev_sp (struct arm_prologue_cache *cache,
>   			  arm_gdbarch_tdep *tdep, int sp_regnum)
>   {
> -  gdb_assert (sp_regnum != ARM_SP_REGNUM);
> -  gdb_assert (arm_cache_is_sp_register (cache, tdep, sp_regnum));
> +  gdb_assert (arm_is_alternative_sp_register (tdep, sp_regnum));
>   
>     if (tdep->have_sec_ext)
>       gdb_assert (sp_regnum != tdep->m_profile_msp_regnum
> @@ -2347,7 +2344,7 @@ arm_prologue_prev_register (struct frame_info *this_frame,
>   
>     /* The value might be one of the alternative SP, if so, use the
>        value already constructed.  */
> -  if (arm_cache_is_sp_register (cache, tdep, prev_regnum))
> +  if (arm_is_alternative_sp_register (tdep, prev_regnum))
>       {
>         sp_value = arm_cache_get_sp_register (cache, tdep, prev_regnum);
>         return frame_unwind_got_constant (this_frame, prev_regnum, sp_value);
> @@ -3694,7 +3691,7 @@ arm_m_exception_prev_register (struct frame_info *this_frame,
>   
>     /* The value might be one of the alternative SP, if so, use the
>        value already constructed.  */
> -  if (arm_cache_is_sp_register (cache, tdep, prev_regnum))
> +  if (arm_is_alternative_sp_register (tdep, prev_regnum))
>       {
>         sp_value = arm_cache_get_sp_register (cache, tdep, prev_regnum);
>         return frame_unwind_got_constant (this_frame, prev_regnum, sp_value);

Thanks. This LGTM.

  reply	other threads:[~2022-07-16  2:03 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07  9:17 [PATCH V2 0/2] gdb/arm: Sync sp with other *sp registers Yvan Roux
2022-07-07  9:19 ` [PATCH V2 1/2] gdb/arm: Rename arm_cache_is_sp_register to Yvan Roux
2022-07-16  2:03   ` Luis Machado [this message]
2022-07-21 13:01     ` Luis Machado
2022-07-07  9:21 ` [PATCH V2 2/2] gdb/arm: Sync sp with other *sp registers Yvan Roux
2022-07-16  2:03   ` Luis Machado
2022-07-21  8:33     ` Torbjorn SVENSSON
2022-07-21  8:48       ` Luis Machado
2022-07-22 20:59         ` [PATCH V3 0/2] " Torbjörn SVENSSON
2022-07-22 20:59         ` [PATCH v3 1/2] gdb/arm: Use if-else if instead of switch Torbjörn SVENSSON
2022-07-25  9:48           ` Luis Machado
2022-07-22 20:59         ` [PATCH v3 2/2] gdb/arm: Sync sp with other *sp registers Torbjörn SVENSSON
2022-07-25  9:52           ` Luis Machado

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=64ba85e5-8a90-8874-5443-5dd32c18515e@arm.com \
    --to=luis.machado@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=torbjorn.svensson@foss.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).