public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Guinevere Larsen <blarsen@redhat.com>
To: gdb-patches@sourceware.org
Cc: Guinevere Larsen <blarsen@redhat.com>
Subject: [PATCH 0/4] Modernize frame unwinders and add disable feature
Date: Wed,  6 Mar 2024 13:51:31 +0100	[thread overview]
Message-ID: <20240306125135.766567-1-blarsen@redhat.com> (raw)

This patch series started with me trying to make it easier to test GDB's
ability to unwind using CFI data, to improve a previous patch I sent to
the list. However, once I finished these changes, I realized there was
an unrelated bug I should fix before proposing the CFI test. Since these
changes are significant enough already, and I think would be interesting
on their own, I figured I shoudl submit this patch series as is right
now while I figure out the other bug.

The first patch is just a minor change, storing frame unwinders in a
vector instead of through an unwinder table accessible using the
registry system. This isn't required (like I originally thought it was),
but it does make the whole system more readable in my opinion.

Patch 3 has the real meat of the modernization, making GDB use
polymorphism to handle frame unwinders. This is slightly slower than
using function pointers, but much more readable in my opinion.

As for the unwinder classes, they were chosen somewhat arbitrarily,
mostly based on where I found an unwinder and its name. I almost expect
some unwinders to be mis-categorized, but that should be easy to fix.

The changes up to patch 3 have been tested with a try-branch, no
regressions as far as I could see.

Guinevere Larsen (4):
  gdb: make gdbarch store a vector of frame unwinders
  gdb: add "unwinder class" to frame unwinders
  gdb: Migrate frame unwinders to use C++ classes
  GDB: introduce ability to disable frame unwinders

 gdb/NEWS                                      |   7 +
 gdb/aarch64-tdep.c                            |  12 +-
 gdb/alpha-mdebug-tdep.c                       |   6 +-
 gdb/alpha-tdep.c                              |  12 +-
 gdb/amd64-obsd-tdep.c                         |   6 +-
 gdb/amd64-tdep.c                              |  24 +-
 gdb/amd64-windows-tdep.c                      |   6 +-
 gdb/amdgpu-tdep.c                             |   5 +-
 gdb/arc-tdep.c                                |  10 +-
 gdb/arch-utils.c                              |   8 +
 gdb/arm-tdep.c                                |  29 +-
 gdb/avr-tdep.c                                |   5 +-
 gdb/bfin-tdep.c                               |   6 +-
 gdb/bpf-tdep.c                                |   6 +-
 gdb/cris-tdep.c                               |  12 +-
 gdb/csky-tdep.c                               |  10 +-
 gdb/doc/gdb.texinfo                           |  24 ++
 gdb/dummy-frame.c                             |   8 +-
 gdb/dummy-frame.h                             |   2 +-
 gdb/dwarf2/frame-tailcall.c                   |   6 +-
 gdb/dwarf2/frame-tailcall.h                   |   2 +-
 gdb/dwarf2/frame.c                            |  16 +-
 gdb/frame-unwind.c                            | 359 ++++++++++++++----
 gdb/frame-unwind.h                            | 165 +++++++-
 gdb/frame.c                                   |  28 +-
 gdb/frv-linux-tdep.c                          |   6 +-
 gdb/frv-tdep.c                                |   5 +-
 gdb/ft32-tdep.c                               |   6 +-
 gdb/gdbarch.c                                 |   3 +
 gdb/gdbarch.h                                 |   5 +
 gdb/gdbarch.py                                |   3 +
 gdb/h8300-tdep.c                              |   5 +-
 gdb/hppa-linux-tdep.c                         |   5 +-
 gdb/hppa-tdep.c                               |  17 +-
 gdb/i386-obsd-tdep.c                          |   5 +-
 gdb/i386-tdep.c                               |  30 +-
 gdb/ia64-tdep.c                               |  24 +-
 gdb/inline-frame.c                            |   5 +-
 gdb/inline-frame.h                            |   2 +-
 gdb/iq2000-tdep.c                             |   5 +-
 gdb/jit.c                                     |   6 +-
 gdb/lm32-tdep.c                               |   5 +-
 gdb/loongarch-tdep.c                          |   7 +-
 gdb/m32c-tdep.c                               |   5 +-
 gdb/m32r-linux-tdep.c                         |   5 +-
 gdb/m32r-tdep.c                               |   5 +-
 gdb/m68hc11-tdep.c                            |   5 +-
 gdb/m68k-linux-tdep.c                         |   6 +-
 gdb/m68k-tdep.c                               |   6 +-
 gdb/mep-tdep.c                                |   5 +-
 gdb/microblaze-tdep.c                         |   6 +-
 gdb/mips-sde-tdep.c                           |   6 +-
 gdb/mips-tdep.c                               |  24 +-
 gdb/mn10300-tdep.c                            |   5 +-
 gdb/moxie-tdep.c                              |   5 +-
 gdb/msp430-tdep.c                             |   5 +-
 gdb/nds32-tdep.c                              |  14 +-
 gdb/nios2-tdep.c                              |  12 +-
 gdb/or1k-tdep.c                               |   7 +-
 gdb/ppc-fbsd-tdep.c                           |   5 +-
 gdb/ppc-obsd-tdep.c                           |   5 +-
 gdb/python/py-unwind.c                        |  50 ++-
 gdb/record-btrace.c                           |  12 +-
 gdb/record.h                                  |   4 +-
 gdb/riscv-tdep.c                              |   8 +-
 gdb/rl78-tdep.c                               |   6 +-
 gdb/rs6000-aix-tdep.c                         |   5 +-
 gdb/rs6000-tdep.c                             |  12 +-
 gdb/rx-tdep.c                                 |  10 +-
 gdb/s12z-tdep.c                               |   7 +-
 gdb/s390-linux-tdep.c                         |   5 +-
 gdb/s390-tdep.c                               |  10 +-
 gdb/sentinel-frame.c                          |   8 +-
 gdb/sentinel-frame.h                          |   2 +-
 gdb/sh-tdep.c                                 |  11 +-
 gdb/sparc-netbsd-tdep.c                       |   6 +-
 gdb/sparc-obsd-tdep.c                         |   6 +-
 gdb/sparc-sol2-tdep.c                         |   6 +-
 gdb/sparc-tdep.c                              |   6 +-
 gdb/sparc64-fbsd-tdep.c                       |   6 +-
 gdb/sparc64-netbsd-tdep.c                     |   6 +-
 gdb/sparc64-obsd-tdep.c                       |  12 +-
 gdb/sparc64-sol2-tdep.c                       |   6 +-
 gdb/sparc64-tdep.c                            |   6 +-
 gdb/testsuite/gdb.base/frame-unwind-disable.c |  21 +
 .../gdb.base/frame-unwind-disable.exp         | 114 ++++++
 gdb/tic6x-tdep.c                              |  12 +-
 gdb/tilegx-tdep.c                             |   5 +-
 gdb/tramp-frame.c                             |  50 ++-
 gdb/v850-tdep.c                               |   5 +-
 gdb/vax-tdep.c                                |   6 +-
 gdb/windows-tdep.c                            |  33 +-
 gdb/windows-tdep.h                            |  16 +-
 gdb/xstormy16-tdep.c                          |   5 +-
 gdb/xtensa-tdep.c                             |   7 +-
 gdb/z80-tdep.c                                |   7 +-
 96 files changed, 1098 insertions(+), 442 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/frame-unwind-disable.c
 create mode 100644 gdb/testsuite/gdb.base/frame-unwind-disable.exp

-- 
2.43.2


             reply	other threads:[~2024-03-06 12:51 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-06 12:51 Guinevere Larsen [this message]
2024-03-06 12:51 ` [PATCH 1/4] gdb: make gdbarch store a vector of frame unwinders Guinevere Larsen
2024-03-08 16:34   ` Tom Tromey
2024-03-11 10:51     ` Guinevere Larsen
2024-03-11 18:01       ` Tom Tromey
2024-03-06 12:51 ` [PATCH 2/4] gdb: add "unwinder class" to " Guinevere Larsen
2024-03-08 16:40   ` Tom Tromey
2024-03-06 12:51 ` [PATCH 3/4] gdb: Migrate frame unwinders to use C++ classes Guinevere Larsen
2024-03-07 11:01   ` Lancelot SIX
2024-03-07 11:04     ` Guinevere Larsen
2024-03-08 17:07   ` Tom Tromey
2024-03-12 16:24     ` Guinevere Larsen
2024-03-06 12:51 ` [PATCH 4/4] GDB: introduce ability to disable frame unwinders Guinevere Larsen
2024-03-06 13:47   ` Eli Zaretskii
2024-03-06 14:07     ` Guinevere Larsen
2024-03-06 14:16       ` Eli Zaretskii
2024-03-08 17:22   ` Tom Tromey
2024-03-11 14:09     ` Guinevere Larsen
2024-03-11 14:56 ` [PATCH 0/4] Modernize frame unwinders and add disable feature Luis Machado
2024-03-11 15:00   ` Guinevere Larsen
2024-03-11 15:10     ` Luis Machado
2024-03-13 12:08       ` Guinevere Larsen
2024-03-13 12:44         ` 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=20240306125135.766567-1-blarsen@redhat.com \
    --to=blarsen@redhat.com \
    --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).