aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2020-07-21 17:28:16 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2020-07-21 17:28:16 -0700
commit272bb05cc59ccfbb15f9e496d4d2ec243e08473c (patch)
tree9ee0e68b116b3ddc274dc9c2f01ab593d4df703b /gdb/infrun.c
parent98f5f7740a4bb7c09e4e3f934f8fd8be47bfbbc8 (diff)
downloadgdb-272bb05cc59ccfbb15f9e496d4d2ec243e08473c.zip
gdb-272bb05cc59ccfbb15f9e496d4d2ec243e08473c.tar.gz
gdb-272bb05cc59ccfbb15f9e496d4d2ec243e08473c.tar.bz2
Add a new gdbarch hook to report additional signal information.
This is a more general version of the existing handle_segmentation_fault hook that is able to report information for an arbitrary signal, not just SIGSEGV. gdb/ChangeLog: * gdbarch.c: Regenerate. * gdbarch.h: Regenerate. * gdbarch.sh (report_signal_info): New method. * infrun.c (print_signal_received_reason): Invoke gdbarch report_signal_info hook if present.
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 3126610..e58b623 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -8299,6 +8299,11 @@ print_signal_received_reason (struct ui_out *uiout, enum gdb_signal siggnal)
annotate_signal_string ();
uiout->field_string ("signal-meaning", gdb_signal_to_string (siggnal));
+ struct regcache *regcache = get_current_regcache ();
+ struct gdbarch *gdbarch = regcache->arch ();
+ if (gdbarch_report_signal_info_p (gdbarch))
+ gdbarch_report_signal_info (gdbarch, uiout, siggnal);
+
if (siggnal == GDB_SIGNAL_SEGV)
handle_segmentation_fault (uiout);