aboutsummaryrefslogtreecommitdiff
path: root/gdb/infrun.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/infrun.c')
-rw-r--r--gdb/infrun.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 15210c9..3e8c9e0 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -7904,6 +7904,20 @@ print_exited_reason (struct ui_out *uiout, int exitstatus)
}
}
+/* Some targets/architectures can do extra processing/display of
+ segmentation faults. E.g., Intel MPX boundary faults.
+ Call the architecture dependent function to handle the fault. */
+
+static void
+handle_segmentation_fault (struct ui_out *uiout)
+{
+ struct regcache *regcache = get_current_regcache ();
+ struct gdbarch *gdbarch = get_regcache_arch (regcache);
+
+ if (gdbarch_handle_segmentation_fault_p (gdbarch))
+ gdbarch_handle_segmentation_fault (gdbarch, uiout);
+}
+
void
print_signal_received_reason (struct ui_out *uiout, enum gdb_signal siggnal)
{
@@ -7947,6 +7961,10 @@ print_signal_received_reason (struct ui_out *uiout, enum gdb_signal siggnal)
annotate_signal_string ();
ui_out_field_string (uiout, "signal-meaning",
gdb_signal_to_string (siggnal));
+
+ if (siggnal == GDB_SIGNAL_SEGV)
+ handle_segmentation_fault (uiout);
+
annotate_signal_string_end ();
}
ui_out_text (uiout, ".\n");