public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Luis Machado <luis.machado@arm.com>
To: Tomas Vanek <vanekt@fbl.cz>, gdb-patches@sourceware.org
Subject: Re: [PATCH] gdb/arm: fix IPSR field test in arm_m_exception_cache ()
Date: Wed, 26 Oct 2022 13:04:49 +0100	[thread overview]
Message-ID: <f0ea6623-e162-0111-8c56-4ac745606a19@arm.com> (raw)
In-Reply-To: <f9f90c24-8683-9997-e22c-6bf1f5b096fe@arm.com>

On 10/25/22 14:22, Luis Machado via Gdb-patches wrote:
> Hi Tomas,
> 
> On 10/22/22 09:25, Tomas Vanek wrote:
>> Arm v8-M Architecture Reference Manual,
>> D1.2.141 IPSR, Interrupt Program Status Register reads
>> "Exception, bits [8:0]"
>>
>> 9 bits, not 8! It is uncommon but true!
>>
>> Signed-off-by: Tomas Vanek <vanekt@fbl.cz>
>> ---
>>   gdb/arm-tdep.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c
>> index b397ca3..923447a 100644
>> --- a/gdb/arm-tdep.c
>> +++ b/gdb/arm-tdep.c
>> @@ -3441,7 +3441,7 @@ struct frame_unwind arm_stub_unwind = {
>>       }
>>         ULONGEST xpsr = get_frame_register_unsigned (this_frame, ARM_PS_REGNUM);
>> -      if ((xpsr & 0xff) != 0)
>> +      if ((xpsr & 0x1ff) != 0)
>>       /* Handler mode: This is the mode that exceptions are handled in.  */
>>       arm_cache_switch_prev_sp (cache, tdep, tdep->m_profile_msp_s_regnum);
>>         else
> 
> Good catch. This LGTM.
> 
> I suppose you need us to push this patch on your behalf?
> 
> One thing that would be nice to do is to have a flags/fields type for XPSR, which
> would then display things in a nicer way to the user. Something like CPSR for a-profile.

Pushed.

      parent reply	other threads:[~2022-10-26 12:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-22  8:25 Tomas Vanek
2022-10-25 13:22 ` Luis Machado
2022-10-25 15:35   ` Tomas Vanek
2022-10-26 12:04   ` Luis Machado [this message]

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=f0ea6623-e162-0111-8c56-4ac745606a19@arm.com \
    --to=luis.machado@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=vanekt@fbl.cz \
    /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).