From: "Torbjörn SVENSSON" <torbjorn.svensson@foss.st.com>
To: <gdb-patches@sourceware.org>
Cc: <luis.machado@arm.com>, <vanekt@volny.cz>
Subject: [PATCH 0/3] gdb/arm: Fixes for Cortex-M stack unwinding
Date: Fri, 4 Nov 2022 15:44:35 +0100 [thread overview]
Message-ID: <20221104144438.2786801-1-torbjorn.svensson@foss.st.com> (raw)
Hi,
This patchset attempts to attack the issues reported in pr/29716 and
pr/29738.
Based on my testing on a STM32L552 with TrustZone, it appears to work as
expected, but I'd love to have another set of eyes on this!
Most of the items reported can be seen using the GTZC example from ST:
https://github.com/STMicroelectronics/STM32CubeL5/tree/master/Projects/NUCLEO-L552ZE-Q/Examples/GTZC/GTZC_TZSC_MPCBB_TrustZone
I've manually verfied the register content by setting break points in
* main
* Error_Handler
* SecureFault_Handler
For the dwarf2 problem in pr/29738, I added 7-chained functions like
below and placed a breakpoint at myfunc7:
void myfunc7()
{
HAL_Delay(1);
}
...
void myfunc1()
{
HAL_Delay(1);
myfunc2();
}
For each breakpoint, I then used the below macros to print the
registers. For each of the printed frames, I then manually checked if
the values maked sense.
define show_reg
shell printf "%-8s " '$arg0'
p/x $arg0
end
define show_stacks
shell echo
shell echo -e "\x1b[35mContent at $arg0\x1b[0m"
bt
set $i = 0
while $i <= $arg1
f $i
show_reg $lr
show_reg $pc
show_reg $sp
show_reg $msp
show_reg $msp_s
show_reg $msp_ns
show_reg $psp
show_reg $psp_s
show_reg $psp_ns
shell echo
set $i = $i + 1
end
shell echo
shell echo
end
The show_stacks macro takes 2 arguments, a description and the number of
frames to print registers for.
To show the registers for all the frames when at the Error_Handler
breakpoint, I used:
show_stacks "Error_Handler" 7
With this series applied, I've not been able to reproduce the stack
trace shown in comment 0 in pr/29716. I'm not sure if the series fixes
the issue, or if it still there but I'm doing something wrong.
Kind regards,
Torbjörn
next reply other threads:[~2022-11-04 14:45 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-04 14:44 Torbjörn SVENSSON [this message]
2022-11-04 14:44 ` [PATCH 1/3] gdb/arm: Update active msp/psp when switching stack Torbjörn SVENSSON
2022-11-04 14:44 ` [PATCH 2/3] gdb/arm: Ensure that stack pointers are in sync Torbjörn SVENSSON
2022-11-04 17:31 ` Tomas Vanek
2022-11-07 17:27 ` Torbjorn SVENSSON
2022-11-04 14:44 ` [PATCH 3/3] gdb/arm: PR 29738 Cache value for stack pointers for dwarf2 frames Torbjörn SVENSSON
2022-11-11 9:15 ` Luis Machado
2022-11-11 10:27 ` Tomas Vanek
2022-11-12 19:54 ` Torbjorn SVENSSON
2022-11-14 10:46 ` 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=20221104144438.2786801-1-torbjorn.svensson@foss.st.com \
--to=torbjorn.svensson@foss.st.com \
--cc=gdb-patches@sourceware.org \
--cc=luis.machado@arm.com \
--cc=vanekt@volny.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).