[PATCH 0/5] Genericize gdbarch_handle_segmentation_fault

John Baldwin jhb@FreeBSD.org
Fri Jul 17 22:03:05 GMT 2020


The gdbarch_handle_segmentation_fault hook can be used to report
architecture-specific information about SIGSEGV signals.  However,
architectures may want to provide information about other signals.  In
addition, on a project I'm working on developers requested signal
specific information when opening a core file.

This series adds a new gdbarch_report_signal_info hook that is invoked
when GDB wants to report information for any received signal as well
as when opening a core file for a process terminated by a signal.  The
name "report" seems more accurate to me than "handle" as the existing
"handle" hooks are not able to adjust program state to permit
continuing after a SIGSEGV, they simply report additional details
about the signal.

I did migrate the existing handle_segmentation_fault hooks, but I have
not added any new hooks that handle signals other than SIGPROT.  I do
have them in a downstream branch for a research architecture (CHERI)
that is not suitable for upstreaming.  It reports additional
information for both SIGSEGV signals and a new SIGPROT signal used to
report MPX-like failures (e.g. buffer overflows).

John Baldwin (5):
  Add a new gdbarch hook to report additional signal information.
  Report architecture-specific signal information for core files.
  Migrate the x86 MPX handle_segmentation_fault hook to
    report_signal_info.
  Migrate the sparc64 ADI handle_segmentation_fault hook to
    report_signal_info.
  Retire the now-unused gdbarch handle_segmentation_fault hook.

 gdb/ChangeLog            | 42 ++++++++++++++++++++++++++++++++++++++++
 gdb/amd64-linux-tdep.c   |  3 +--
 gdb/corelow.c            |  5 ++++-
 gdb/gdbarch.c            | 34 ++++++++++++++++----------------
 gdb/gdbarch.h            | 13 ++++++-------
 gdb/gdbarch.sh           |  7 +++----
 gdb/i386-linux-tdep.c    | 11 +++++------
 gdb/i386-linux-tdep.h    |  5 +++--
 gdb/infrun.c             | 20 ++++---------------
 gdb/sparc64-linux-tdep.c | 12 ++++++------
 10 files changed, 91 insertions(+), 61 deletions(-)

-- 
2.25.1



More information about the Gdb-patches mailing list