public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 5/5] Retire the now-unused gdbarch handle_segmentation_fault hook.
Date: Fri, 17 Jul 2020 15:03:10 -0700	[thread overview]
Message-ID: <20200717220310.82230-6-jhb@FreeBSD.org> (raw)
In-Reply-To: <20200717220310.82230-1-jhb@FreeBSD.org>

	* gdbarch.c: Regenerate.
	* gdbarch.h: Regenerate.
	* gdbarch.sh (handle_segmentation_fault): Remove method.
	* infrun.c (handle_segmentation_fault): Remove.
	(print_signal_received_reason): Remove call to
	handle_segmentation_fault.
---
 gdb/ChangeLog  |  9 +++++++++
 gdb/gdbarch.c  | 32 --------------------------------
 gdb/gdbarch.h  | 11 -----------
 gdb/gdbarch.sh |  6 ------
 gdb/infrun.c   | 17 -----------------
 5 files changed, 9 insertions(+), 66 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ca7a27180e..c174934211 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2020-07-17  John Baldwin  <jhb@FreeBSD.org>
+
+	* gdbarch.c: Regenerate.
+	* gdbarch.h: Regenerate.
+	* gdbarch.sh (handle_segmentation_fault): Remove method.
+	* infrun.c (handle_segmentation_fault): Remove.
+	(print_signal_received_reason): Remove call to
+	handle_segmentation_fault.
+
 2020-07-17  John Baldwin  <jhb@FreeBSD.org>
 
 	* sparc64-linux-tdep.c (sparc64_linux_handle_segmentation_fault):
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index d393e7a734..fd5b0301ab 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -191,7 +191,6 @@ struct gdbarch
   int num_pseudo_regs;
   gdbarch_ax_pseudo_register_collect_ftype *ax_pseudo_register_collect;
   gdbarch_ax_pseudo_register_push_stack_ftype *ax_pseudo_register_push_stack;
-  gdbarch_handle_segmentation_fault_ftype *handle_segmentation_fault;
   gdbarch_report_signal_info_ftype *report_signal_info;
   int sp_regnum;
   int pc_regnum;
@@ -556,7 +555,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
   /* Skip verify of num_pseudo_regs, invalid_p == 0 */
   /* Skip verify of ax_pseudo_register_collect, has predicate.  */
   /* Skip verify of ax_pseudo_register_push_stack, has predicate.  */
-  /* Skip verify of handle_segmentation_fault, has predicate.  */
   /* Skip verify of report_signal_info, has predicate.  */
   /* Skip verify of sp_regnum, invalid_p == 0 */
   /* Skip verify of pc_regnum, invalid_p == 0 */
@@ -1088,12 +1086,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
   fprintf_unfiltered (file,
                       "gdbarch_dump: half_format = %s\n",
                       pformat (gdbarch->half_format));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: gdbarch_handle_segmentation_fault_p() = %d\n",
-                      gdbarch_handle_segmentation_fault_p (gdbarch));
-  fprintf_unfiltered (file,
-                      "gdbarch_dump: handle_segmentation_fault = <%s>\n",
-                      host_address_to_string (gdbarch->handle_segmentation_fault));
   fprintf_unfiltered (file,
                       "gdbarch_dump: has_dos_based_file_system = %s\n",
                       plongest (gdbarch->has_dos_based_file_system));
@@ -2097,30 +2089,6 @@ set_gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch,
   gdbarch->ax_pseudo_register_push_stack = ax_pseudo_register_push_stack;
 }
 
-int
-gdbarch_handle_segmentation_fault_p (struct gdbarch *gdbarch)
-{
-  gdb_assert (gdbarch != NULL);
-  return gdbarch->handle_segmentation_fault != NULL;
-}
-
-void
-gdbarch_handle_segmentation_fault (struct gdbarch *gdbarch, struct ui_out *uiout)
-{
-  gdb_assert (gdbarch != NULL);
-  gdb_assert (gdbarch->handle_segmentation_fault != NULL);
-  if (gdbarch_debug >= 2)
-    fprintf_unfiltered (gdb_stdlog, "gdbarch_handle_segmentation_fault called\n");
-  gdbarch->handle_segmentation_fault (gdbarch, uiout);
-}
-
-void
-set_gdbarch_handle_segmentation_fault (struct gdbarch *gdbarch,
-                                       gdbarch_handle_segmentation_fault_ftype handle_segmentation_fault)
-{
-  gdbarch->handle_segmentation_fault = handle_segmentation_fault;
-}
-
 int
 gdbarch_report_signal_info_p (struct gdbarch *gdbarch)
 {
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 9414407b04..6c125d10ae 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -321,17 +321,6 @@ typedef int (gdbarch_ax_pseudo_register_push_stack_ftype) (struct gdbarch *gdbar
 extern int gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch, struct agent_expr *ax, int reg);
 extern void set_gdbarch_ax_pseudo_register_push_stack (struct gdbarch *gdbarch, gdbarch_ax_pseudo_register_push_stack_ftype *ax_pseudo_register_push_stack);
 
-/* 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.
-   UIOUT is the output stream where the handler will place information. */
-
-extern int gdbarch_handle_segmentation_fault_p (struct gdbarch *gdbarch);
-
-typedef void (gdbarch_handle_segmentation_fault_ftype) (struct gdbarch *gdbarch, struct ui_out *uiout);
-extern void gdbarch_handle_segmentation_fault (struct gdbarch *gdbarch, struct ui_out *uiout);
-extern void set_gdbarch_handle_segmentation_fault (struct gdbarch *gdbarch, gdbarch_handle_segmentation_fault_ftype *handle_segmentation_fault);
-
 /* Some architectures can display additional information for specific
    signals.
    UIOUT is the output stream where the handler will place information. */
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index 1601879532..5adfd29ad4 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -414,12 +414,6 @@ M;int;ax_pseudo_register_collect;struct agent_expr *ax, int reg;ax, reg
 # Return -1 if something goes wrong, 0 otherwise.
 M;int;ax_pseudo_register_push_stack;struct agent_expr *ax, int reg;ax, reg
 
-# 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.
-# UIOUT is the output stream where the handler will place information.
-M;void;handle_segmentation_fault;struct ui_out *uiout;uiout
-
 # Some architectures can display additional information for specific
 # signals.
 # UIOUT is the output stream where the handler will place information.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index e58b623954..ca850f81c4 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -8243,20 +8243,6 @@ 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 = regcache->arch ();
-
-  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)
 {
@@ -8304,9 +8290,6 @@ print_signal_received_reason (struct ui_out *uiout, enum gdb_signal siggnal)
       if (gdbarch_report_signal_info_p (gdbarch))
 	gdbarch_report_signal_info (gdbarch, uiout, siggnal);
 
-      if (siggnal == GDB_SIGNAL_SEGV)
-	handle_segmentation_fault (uiout);
-
       annotate_signal_string_end ();
     }
   uiout->text (".\n");
-- 
2.25.1


  parent reply	other threads:[~2020-07-17 22:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-17 22:03 [PATCH 0/5] Genericize gdbarch_handle_segmentation_fault John Baldwin
2020-07-17 22:03 ` [PATCH 1/5] Add a new gdbarch hook to report additional signal information John Baldwin
2020-07-17 22:03 ` [PATCH 2/5] Report architecture-specific signal information for core files John Baldwin
2020-07-17 22:03 ` [PATCH 3/5] Migrate the x86 MPX handle_segmentation_fault hook to report_signal_info John Baldwin
2020-07-17 22:03 ` [PATCH 4/5] Migrate the sparc64 ADI " John Baldwin
2020-07-17 22:03 ` John Baldwin [this message]
2020-07-21 18:40 ` [PATCH 0/5] Genericize gdbarch_handle_segmentation_fault Tom Tromey

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=20200717220310.82230-6-jhb@FreeBSD.org \
    --to=jhb@freebsd.org \
    --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).