public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v5 0/5] arm: Add support for multiple stacks on Cortex-M
@ 2022-04-25  9:59 Christophe Lyon
  2022-04-25  9:59 ` [PATCH v5 1/5] gdb/arm: Fix prologue analysis to support vpush Christophe Lyon
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Christophe Lyon @ 2022-04-25  9:59 UTC (permalink / raw)
  To: gdb-patches; +Cc: torbjorn.svensson, yvan.roux

This patch series introduces support for the multiple stack pointers
on v8-M architecture (MSP_S, MSP_NS, PSP_S, PSP_NS).

This enables to unwind through Secure vs Non-secure context switches.

Along the way, the first patch adds support to detect vpush
instructions in function prologues, which in particular is used in the
CMSE trampolines.

Changes v4 -> v5:
- rebased on top of recent trunk, which includes:
  * fprintf_filtered calls renamed into gdb_printf
  * cache is no longer a POD, so we cannot use memset anymore
  * merge conflicts with the recent PACBTI patches
 - renamed unwind-ns-to-s into unwind-secure-frames

- fixed a bug where we could call arm_cache_get_sp_register (cache,
  tdep, prev_regnum) with prev_regnum not being one of the stack
  pointers, leading to a GDB crash. (Found by running make check on a
  arm-linux host)

Christophe Lyon (5):
  gdb/arm: Fix prologue analysis to support vpush
  gdb/arm: Define MSP and PSP registers for M-Profile
  gdb/arm: Introduce arm_cache_init
  gdb/arm: Add support for multiple stack pointers on Cortex-M
  gdb/arm: Extend arm_m_addr_is_magic to support FNC_RETURN, add
    unwind-secure-frames command

 gdb/NEWS                          |   5 +
 gdb/arch/arm.c                    |   6 +
 gdb/arch/arm.h                    |   1 +
 gdb/arm-tdep.c                    | 685 +++++++++++++++++++++++++-----
 gdb/arm-tdep.h                    |  10 +
 gdb/doc/gdb.texinfo               |  10 +
 gdb/features/Makefile             |   1 +
 gdb/features/arm/arm-m-system.c   |  15 +
 gdb/features/arm/arm-m-system.xml |  12 +
 gdb/features/arm/arm-secext.c     |  17 +
 gdb/features/arm/arm-secext.xml   |  15 +
 11 files changed, 678 insertions(+), 99 deletions(-)
 create mode 100644 gdb/features/arm/arm-m-system.c
 create mode 100644 gdb/features/arm/arm-m-system.xml
 create mode 100644 gdb/features/arm/arm-secext.c
 create mode 100644 gdb/features/arm/arm-secext.xml

-- 
2.25.1


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-04-28  8:56 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-25  9:59 [PATCH v5 0/5] arm: Add support for multiple stacks on Cortex-M Christophe Lyon
2022-04-25  9:59 ` [PATCH v5 1/5] gdb/arm: Fix prologue analysis to support vpush Christophe Lyon
2022-04-25  9:59 ` [PATCH v5 2/5] gdb/arm: Define MSP and PSP registers for M-Profile Christophe Lyon
2022-04-25  9:59 ` [PATCH v5 3/5] gdb/arm: Introduce arm_cache_init Christophe Lyon
2022-04-25  9:59 ` [PATCH v5 4/5] gdb/arm: Add support for multiple stack pointers on Cortex-M Christophe Lyon
2022-04-25  9:59 ` [PATCH v5 5/5] gdb/arm: Extend arm_m_addr_is_magic to support FNC_RETURN, add unwind-secure-frames command Christophe Lyon
2022-04-25 11:31   ` Eli Zaretskii
2022-04-27 13:09   ` Luis Machado
2022-04-27 13:11     ` Christophe Lyon
2022-04-28  8:55       ` Christophe Lyon

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).