public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tomas Vanek <vanekt@fbl.cz>
To: gdb-patches@sourceware.org
Subject: [PATCH] gdb/arm: Terminate frame unwinding in M-profile lockup state
Date: Sun, 16 Oct 2022 15:59:04 +0200	[thread overview]
Message-ID: <e6379ac4-a41b-0be2-6e13-f64a6d22ee7f@fbl.cz> (raw)

Torbjorn,

thanks for the fast reply.

On 2022-10-16 10:13, Torbjorn SVENSSON wrote:

> >/  #0  0xeffffffe in ?? () />/  #1  0x0c000a9c in HardFault_Handler () />/      at />/C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/stm32l5xx_it.c:99 
> />/  #2  0x2002ffd8 in ?? () />/  Backtrace stopped: previous frame identical to this frame (corrupt />/stack?) />/  (gdb) />/---------------- />/The frame #1 is at correct PC taken from LR, #2 is a total nonsense. /
> I think your assumption here is wrong as 0xeffffffe is a valid value for
> Cortex-M33 with TrustZone (FNC_RETURN with S=0). See more on the comment
> below.
'B3.17 Function returns from Non-secure state' states:
The FNC_RETURN value is:
... the original is a binary value in a table, hard to convert to plain 
text ...
so if I convert correctly
0xfefffffe or 0xfeffffff depending on S bit.

Starts with 0xfe not 0xef as the lockup magic!

> Reading B3.33 (revision B.m) in the ARMv8-M documentation about lockup
> state, it's written that DHCSR.S_LOCKUP=1 AND PC=0xeffffffe. My
> interpretations that the PC value alone is not enough.

Hmm, how would we read DHCSR then?
IMO the PC value is enough.

Tomas


WARNING: multiple messages have this Message-ID
From: Tomas Vanek <vanekt@fbl.cz>
To: gdb-patches@sourceware.org
Subject: [PATCH] gdb/arm: Terminate frame unwinding in M-profile lockup state
Date: Sun, 16 Oct 2022 15:59:04 +0200	[thread overview]
Message-ID: <e6379ac4-a41b-0be2-6e13-f64a6d22ee7f@fbl.cz> (raw)
Message-ID: <20221016135904.AUGl2IciwNZveigSyB3IxfZjCCA1Z_EwwQQhCWFA3Os@z> (raw)

[-- Attachment #1: Type: text/plain, Size: 1194 bytes --]

Torbjorn,

thanks for the fast reply.

On 2022-10-16 10:13, Torbjorn SVENSSON wrote:

> >/  #0  0xeffffffe in ?? () />/  #1  0x0c000a9c in HardFault_Handler () />/      at />/C:/dvl/stm32l5trustzone/GPIO_IOToggle_TrustZone/Secure/Src/stm32l5xx_it.c:99 
> />/  #2  0x2002ffd8 in ?? () />/  Backtrace stopped: previous frame identical to this frame (corrupt />/stack?) />/  (gdb) />/---------------- />/The frame #1 is at correct PC taken from LR, #2 is a total nonsense. /
> I think your assumption here is wrong as 0xeffffffe is a valid value for
> Cortex-M33 with TrustZone (FNC_RETURN with S=0). See more on the comment
> below.
'B3.17 Function returns from Non-secure state' states:
The FNC_RETURN value is:
... the original is a binary value in a table, hard to convert to plain 
text ...
so if I convert correctly
0xfefffffe or 0xfeffffff depending on S bit.

Starts with 0xfe not 0xef as the lockup magic!

> Reading B3.33 (revision B.m) in the ARMv8-M documentation about lockup
> state, it's written that DHCSR.S_LOCKUP=1 AND PC=0xeffffffe. My
> interpretations that the PC value alone is not enough.

Hmm, how would we read DHCSR then?
IMO the PC value is enough.

Tomas


             reply	other threads:[~2022-10-16 13:59 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-16 13:59 Tomas Vanek [this message]
2022-10-16 13:59 ` Tomas Vanek
2022-10-16 14:37 ` Torbjorn SVENSSON
  -- strict thread matches above, loose matches on Subject: below --
2022-10-16  9:23 Tomas Vanek
2022-10-16 10:13 ` 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=e6379ac4-a41b-0be2-6e13-f64a6d22ee7f@fbl.cz \
    --to=vanekt@fbl.cz \
    --cc=gdb-patches@sourceware.org \
    /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).