Message ID | 1666427154-22766-1-git-send-email-vanekt@fbl.cz |
---|---|
State | Committed |
Commit | b2e9e754e122d97511bbd6b990e38a23dafb6176 |
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5BB703858C20 for <patchwork@sourceware.org>; Sat, 22 Oct 2022 08:26:27 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp00.avonet.cz (smtp00.avonet.cz [217.112.162.55]) by sourceware.org (Postfix) with ESMTP id 71D833858D1E for <gdb-patches@sourceware.org>; Sat, 22 Oct 2022 08:26:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 71D833858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=fbl.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=fbl.cz Received: from ktus.lan (217-115-245-101.cust.avonet.cz [217.115.245.101]) by smtp00.avonet.cz (Postfix) with ESMTP id 4MvZDB6l6Kz1xq1; Sat, 22 Oct 2022 10:26:02 +0200 (CEST) From: Tomas Vanek <vanekt@fbl.cz> To: gdb-patches@sourceware.org Subject: [PATCH] gdb/arm: fix IPSR field test in arm_m_exception_cache () Date: Sat, 22 Oct 2022 10:25:54 +0200 Message-Id: <1666427154-22766-1-git-send-email-vanekt@fbl.cz> X-Mailer: git-send-email 1.9.1 X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_FAIL, SPF_HELO_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
gdb/arm: fix IPSR field test in arm_m_exception_cache ()
|
|
Commit Message
Tomas Vanek
Oct. 22, 2022, 8:25 a.m. UTC
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(-)
Comments
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.
Hi Luis, On 25/10/2022 15:22, Luis Machado 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? > Yes, please push all my patches as they are ready. Thanks Tomas
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.
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