From: Tom Tromey Date: Sun, 3 Nov 2024 22:08:33 +0000 (-0700) Subject: Remove skip_permanent_breakpoint gdbarch hook X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a6e3679f681f9af548ca0ce33fd4da47dcf1afa5;p=thirdparty%2Fbinutils-gdb.git Remove skip_permanent_breakpoint gdbarch hook The skip_permanent_breakpoint gdbarch hook has been obsolete since: commit 61a12cfa7b25746914493cc0d94e5053a8492aa5 Author: Jan Kratochvil Date: Fri Mar 13 20:24:22 2015 +0100 Remove HPUX This patch removes it. --- diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index d9d1e494724..c3ed8f07dc1 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -950,18 +950,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 61e83f0fd11..8930183e136 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -335,13 +335,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 da99ec27e19..f8fa7bcb142 100644 --- a/gdb/breakpoint.c +++ b/gdb/breakpoint.c @@ -4443,8 +4443,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 6b5dbcfe8a3..3e84f1c99ab 100644 --- a/gdb/breakpoint.h +++ b/gdb/breakpoint.h @@ -406,8 +406,7 @@ public: /* 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 969ace4de6a..16292f54017 100644 --- a/gdb/gdbarch-gen.c +++ b/gdb/gdbarch-gen.c @@ -186,7 +186,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. */ @@ -1086,9 +1084,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)); @@ -4026,23 +4021,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 04d5d187edd..2cfb992499f 100644 --- a/gdb/gdbarch-gen.h +++ b/gdb/gdbarch-gen.h @@ -1068,12 +1068,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 a57ec01e244..d3dc0d58707 100644 --- a/gdb/gdbarch_components.py +++ b/gdb/gdbarch_components.py @@ -1803,17 +1803,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 6bcd8ec5cc0..2abf35deeaf 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2768,10 +2768,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) {