From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>, Jan Kratochvil <jan.kratochvil@redhat.com>
Subject: [PATCH 4/6] Remove skip_permanent_breakpoint gdbarch hook
Date: Mon, 04 Nov 2024 14:14:14 -0700 [thread overview]
Message-ID: <20241104-check-unused-gdbarch-v1-4-7082f2121077@tromey.com> (raw)
In-Reply-To: <20241104-check-unused-gdbarch-v1-0-7082f2121077@tromey.com>
The skip_permanent_breakpoint gdbarch hook has been obsolete since:
commit 61a12cfa7b25746914493cc0d94e5053a8492aa5
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Fri Mar 13 20:24:22 2015 +0100
Remove HPUX
This patch removes it.
---
gdb/arch-utils.c | 12 ------------
gdb/arch-utils.h | 7 -------
gdb/breakpoint.c | 3 +--
gdb/breakpoint.h | 3 +--
gdb/gdbarch-gen.c | 22 ----------------------
gdb/gdbarch-gen.h | 6 ------
gdb/gdbarch_components.py | 11 -----------
gdb/infrun.c | 7 ++++---
8 files changed, 6 insertions(+), 65 deletions(-)
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 6ffa4109765579bc6654df8ae245a26cdcad838f..6ca9ec34ad8a6f1fc77e576a475b3bd3182fa265 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -956,18 +956,6 @@ default_program_breakpoint_here_p (struct gdbarch *gdbarch,
return false;
}
-void
-default_skip_permanent_breakpoint (struct regcache *regcache)
-{
- struct gdbarch *gdbarch = regcache->arch ();
- CORE_ADDR current_pc = regcache_read_pc (regcache);
- int bp_len;
-
- gdbarch_breakpoint_from_pc (gdbarch, ¤t_pc, &bp_len);
- current_pc += bp_len;
- regcache_write_pc (regcache, current_pc);
-}
-
CORE_ADDR
default_infcall_mmap (CORE_ADDR size, unsigned prot)
{
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
index 40c62f30a65fbf86a1644ae24ef3f6ec329fd87f..39094a0bf3e2e121c7df67a64d530ca6c471f661 100644
--- a/gdb/arch-utils.h
+++ b/gdb/arch-utils.h
@@ -254,13 +254,6 @@ extern bool default_program_breakpoint_here_p (struct gdbarch *gdbarch,
extern int default_vsyscall_range (struct gdbarch *gdbarch, struct mem_range *range);
-/* Default way to advance the PC to the next instruction in order to
- skip a permanent breakpoint. Increments the PC by the size of a
- software breakpoint instruction, as determined with
- gdbarch_breakpoint_from_pc. This matches how the breakpoints
- module determines whether a breakpoint is permanent. */
-extern void default_skip_permanent_breakpoint (struct regcache *regcache);
-
/* Symbols for gdbarch_infcall_mmap; their Linux PROT_* system
definitions would be dependent on compilation host. */
#define GDB_MMAP_PROT_READ 0x1 /* Page can be read. */
diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c
index b7e4f5d0a4549d4b1729a507419d611ddc7999fa..5b7633e313b1b0b8d91c550cfa86c4ec09d64704 100644
--- a/gdb/breakpoint.c
+++ b/gdb/breakpoint.c
@@ -4411,8 +4411,7 @@ breakpoint_init_inferior (inferior *inf, inf_context context)
- When continuing from a location with an ordinary breakpoint, we
actually single step once before calling insert_breakpoints.
- When continuing from a location with a permanent breakpoint, we
- need to use the `SKIP_PERMANENT_BREAKPOINT' macro, provided by
- the target, to advance the PC past the breakpoint. */
+ advance the PC past the breakpoint manually. */
enum breakpoint_here
breakpoint_here_p (const address_space *aspace, CORE_ADDR pc)
diff --git a/gdb/breakpoint.h b/gdb/breakpoint.h
index cef1d727ed256eed919914646e40a2fa06715ec8..5de2efb7398e255fcb7b0c016e87c32c4c9c942c 100644
--- a/gdb/breakpoint.h
+++ b/gdb/breakpoint.h
@@ -406,8 +406,7 @@ class bp_location : public refcounted_object, public intrusive_list_node<bp_loca
/* True if this is a permanent breakpoint. There is a breakpoint
instruction hard-wired into the target's code. Don't try to
write another breakpoint instruction on top of it, or restore its
- value. Step over it using the architecture's
- gdbarch_skip_permanent_breakpoint method. */
+ value. Step over it. */
bool permanent = false;
/* True if this is not the first breakpoint in the list
diff --git a/gdb/gdbarch-gen.c b/gdb/gdbarch-gen.c
index 3d3261f636aa8da6cdd3412d76a469eb6059aafd..534ed35f3bba3b6ebe1a034198f5f7e16e756e72 100644
--- a/gdb/gdbarch-gen.c
+++ b/gdb/gdbarch-gen.c
@@ -187,7 +187,6 @@ struct gdbarch
const char * gcore_bfd_target = 0;
int vtable_function_descriptors = 0;
int vbit_in_delta = 0;
- gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint = default_skip_permanent_breakpoint;
ULONGEST max_insn_length = 0;
gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn = nullptr;
gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep = default_displaced_step_hw_singlestep;
@@ -450,7 +449,6 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of gcore_bfd_target, has predicate. */
/* Skip verify of vtable_function_descriptors, invalid_p == 0. */
/* Skip verify of vbit_in_delta, invalid_p == 0. */
- /* Skip verify of skip_permanent_breakpoint, invalid_p == 0. */
/* Skip verify of max_insn_length, has predicate. */
/* Skip verify of displaced_step_copy_insn, invalid_p == 0. */
/* Skip verify of displaced_step_hw_singlestep, invalid_p == 0. */
@@ -1087,9 +1085,6 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
gdb_printf (file,
"gdbarch_dump: vbit_in_delta = %s\n",
plongest (gdbarch->vbit_in_delta));
- gdb_printf (file,
- "gdbarch_dump: skip_permanent_breakpoint = <%s>\n",
- host_address_to_string (gdbarch->skip_permanent_breakpoint));
gdb_printf (file,
"gdbarch_dump: gdbarch_max_insn_length_p() = %d\n",
gdbarch_max_insn_length_p (gdbarch));
@@ -4035,23 +4030,6 @@ set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch,
gdbarch->vbit_in_delta = vbit_in_delta;
}
-void
-gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->skip_permanent_breakpoint != NULL);
- if (gdbarch_debug >= 2)
- gdb_printf (gdb_stdlog, "gdbarch_skip_permanent_breakpoint called\n");
- gdbarch->skip_permanent_breakpoint (regcache);
-}
-
-void
-set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch,
- gdbarch_skip_permanent_breakpoint_ftype skip_permanent_breakpoint)
-{
- gdbarch->skip_permanent_breakpoint = skip_permanent_breakpoint;
-}
-
bool
gdbarch_max_insn_length_p (struct gdbarch *gdbarch)
{
diff --git a/gdb/gdbarch-gen.h b/gdb/gdbarch-gen.h
index 0a5a168f21070b5f3baefee217eb6838791a71bb..6b5ebcc28516f942ffa33c288e5d6c1aab7d9aac 100644
--- a/gdb/gdbarch-gen.h
+++ b/gdb/gdbarch-gen.h
@@ -1054,12 +1054,6 @@ extern void set_gdbarch_vtable_function_descriptors (struct gdbarch *gdbarch, in
extern int gdbarch_vbit_in_delta (struct gdbarch *gdbarch);
extern void set_gdbarch_vbit_in_delta (struct gdbarch *gdbarch, int vbit_in_delta);
-/* Advance PC to next instruction in order to skip a permanent breakpoint. */
-
-typedef void (gdbarch_skip_permanent_breakpoint_ftype) (struct regcache *regcache);
-extern void gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, struct regcache *regcache);
-extern void set_gdbarch_skip_permanent_breakpoint (struct gdbarch *gdbarch, gdbarch_skip_permanent_breakpoint_ftype *skip_permanent_breakpoint);
-
/* The maximum length of an instruction on this architecture in bytes. */
extern bool gdbarch_max_insn_length_p (struct gdbarch *gdbarch);
diff --git a/gdb/gdbarch_components.py b/gdb/gdbarch_components.py
index 262d448b6c7130728f21afd4b55c9412553a32fb..f79d61559b8e4c50a66258284376f454072f4112 100644
--- a/gdb/gdbarch_components.py
+++ b/gdb/gdbarch_components.py
@@ -1779,17 +1779,6 @@ significant bit of the pfn for pointers to virtual member functions.
invalid=False,
)
-Function(
- comment="""
-Advance PC to next instruction in order to skip a permanent breakpoint.
-""",
- type="void",
- name="skip_permanent_breakpoint",
- params=[("struct regcache *", "regcache")],
- predefault="default_skip_permanent_breakpoint",
- invalid=False,
-)
-
Value(
comment="""
The maximum length of an instruction on this architecture in bytes.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 4ca15450afe0344f9acf97ca73dcf837879650e3..7ac57c4273b4b745ab625a8b6021e775c90ec83e 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -2770,10 +2770,11 @@ resume_1 (enum gdb_signal sig)
/* There's no signal to pass, we can go ahead and skip the
permanent breakpoint manually. */
infrun_debug_printf ("skipping permanent breakpoint");
- gdbarch_skip_permanent_breakpoint (gdbarch, regcache);
- /* Update pc to reflect the new address from which we will
- execute instructions. */
pc = regcache_read_pc (regcache);
+ int bp_len;
+ gdbarch_breakpoint_from_pc (gdbarch, &pc, &bp_len);
+ pc += bp_len;
+ regcache_write_pc (regcache, pc);
if (step)
{
--
2.46.1
next prev parent reply other threads:[~2024-11-04 21:15 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-04 21:14 [PATCH 0/6] Add gdbarch-checking script Tom Tromey
2024-11-04 21:14 ` [PATCH 1/6] Add check-gdbarch.py Tom Tromey
2024-12-05 22:47 ` Keith Seitz
2024-11-04 21:14 ` [PATCH 2/6] Use 'invalid' rather than 'predicate' in some gdbarch functions Tom Tromey
2024-11-04 21:14 ` [PATCH 3/6] Remove solib_symbols_extension gdbarch hook Tom Tromey
2024-11-04 21:14 ` Tom Tromey [this message]
2024-11-04 21:14 ` [PATCH 5/6] Remove the print_vector_info " Tom Tromey
2024-12-05 22:49 ` Keith Seitz
2024-11-04 21:14 ` [PATCH 6/6] Remove the auto_charset " Tom Tromey
2024-12-05 22:50 ` [PATCH 0/6] Add gdbarch-checking script Keith Seitz
2024-12-06 2:58 ` Sergio Durigan Junior
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=20241104-check-unused-gdbarch-v1-4-7082f2121077@tromey.com \
--to=tom@tromey.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/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