From: Simon Marchi Date: Thu, 29 Oct 2020 22:02:13 +0000 (-0400) Subject: gdb: remove parameter of gdbarch_displaced_step_hw_singlestep X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=40a5376690d9124b13ae9e9217cb7c524864e208;p=binutils-gdb.git gdb: remove parameter of gdbarch_displaced_step_hw_singlestep I noticed that the closure parameter of gdbarch_displaced_step_hw_singlestep is never used by any implementation of the method, so this patch removes it. gdb/ChangeLog: * gdbarch.sh (displaced_step_hw_singlestep): Remove closure parameter. * aarch64-tdep.c (aarch64_displaced_step_hw_singlestep): Likewise. * aarch64-tdep.h (aarch64_displaced_step_hw_singlestep): Likewise. * arch-utils.c (default_displaced_step_hw_singlestep): Likewise. * arch-utils.h (default_displaced_step_hw_singlestep): Likewise. * rs6000-tdep.c (ppc_displaced_step_hw_singlestep): Likewise. * s390-tdep.c (s390_displaced_step_hw_singlestep): Likewise. * gdbarch.c: Re-generate. * gdbarch.h: Re-generate. * infrun.c (resume_1): Adjust. Change-Id: I7354f0b22afc2692ebff0cd700a462db8f389fc1 --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fe585c4f531..7dfea4e9058 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,23 @@ +2020-10-29 Simon Marchi + + * gdbarch.sh (displaced_step_hw_singlestep): Remove closure + parameter. + * aarch64-tdep.c (aarch64_displaced_step_hw_singlestep): + Likewise. + * aarch64-tdep.h (aarch64_displaced_step_hw_singlestep): + Likewise. + * arch-utils.c (default_displaced_step_hw_singlestep): + Likewise. + * arch-utils.h (default_displaced_step_hw_singlestep): + Likewise. + * rs6000-tdep.c (ppc_displaced_step_hw_singlestep): + Likewise. + * s390-tdep.c (s390_displaced_step_hw_singlestep): + Likewise. + * gdbarch.c: Re-generate. + * gdbarch.h: Re-generate. + * infrun.c (resume_1): Adjust. + 2020-10-29 Tom Tromey * progspace.c (program_space::~program_space): Don't call diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 73bfcf5448f..639fe590387 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -3270,8 +3270,7 @@ aarch64_displaced_step_fixup (struct gdbarch *gdbarch, /* Implement the "displaced_step_hw_singlestep" gdbarch method. */ bool -aarch64_displaced_step_hw_singlestep (struct gdbarch *gdbarch, - struct displaced_step_closure *closure) +aarch64_displaced_step_hw_singlestep (struct gdbarch *gdbarch) { return true; } diff --git a/gdb/aarch64-tdep.h b/gdb/aarch64-tdep.h index 2f15758dbd5..bd7a6c602e0 100644 --- a/gdb/aarch64-tdep.h +++ b/gdb/aarch64-tdep.h @@ -117,7 +117,6 @@ void aarch64_displaced_step_fixup (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs); -bool aarch64_displaced_step_hw_singlestep (struct gdbarch *gdbarch, - displaced_step_closure *closure); +bool aarch64_displaced_step_hw_singlestep (struct gdbarch *gdbarch); #endif /* aarch64-tdep.h */ diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c index 1f66e0384a0..8d5fa3fc976 100644 --- a/gdb/arch-utils.c +++ b/gdb/arch-utils.c @@ -39,8 +39,7 @@ #include "dis-asm.h" bool -default_displaced_step_hw_singlestep (struct gdbarch *gdbarch, - struct displaced_step_closure *closure) +default_displaced_step_hw_singlestep (struct gdbarch *gdbarch) { return !gdbarch_software_single_step_p (gdbarch); } diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h index 418b5c16988..7eea838ac3d 100644 --- a/gdb/arch-utils.h +++ b/gdb/arch-utils.h @@ -75,9 +75,7 @@ struct bp_manipulation_endian BREAK_INSN_LITTLE, BREAK_INSN_BIG> /* Default implementation of gdbarch_displaced_hw_singlestep. */ -extern bool - default_displaced_step_hw_singlestep (struct gdbarch *, - struct displaced_step_closure *); +extern bool default_displaced_step_hw_singlestep (struct gdbarch *); /* Possible value for gdbarch_displaced_step_location: Place displaced instructions at the program's entry point, diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c index 285d9f9b46d..45dae111f18 100644 --- a/gdb/gdbarch.c +++ b/gdb/gdbarch.c @@ -3987,13 +3987,13 @@ set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, } bool -gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure) +gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch) { gdb_assert (gdbarch != NULL); gdb_assert (gdbarch->displaced_step_hw_singlestep != NULL); if (gdbarch_debug >= 2) fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_hw_singlestep called\n"); - return gdbarch->displaced_step_hw_singlestep (gdbarch, closure); + return gdbarch->displaced_step_hw_singlestep (gdbarch); } void diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h index ae65f290fc8..8b1507b4ea8 100644 --- a/gdb/gdbarch.h +++ b/gdb/gdbarch.h @@ -1044,8 +1044,8 @@ extern void set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, gdbar The default implementation returns false on all targets that provide a gdbarch_software_single_step routine, and true otherwise. */ -typedef bool (gdbarch_displaced_step_hw_singlestep_ftype) (struct gdbarch *gdbarch, struct displaced_step_closure *closure); -extern bool gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure); +typedef bool (gdbarch_displaced_step_hw_singlestep_ftype) (struct gdbarch *gdbarch); +extern bool gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch); extern void set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep); /* Fix up the state resulting from successfully single-stepping a diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh index 5f1e2f9d958..bff29c536c9 100755 --- a/gdb/gdbarch.sh +++ b/gdb/gdbarch.sh @@ -794,7 +794,7 @@ M;displaced_step_closure_up;displaced_step_copy_insn;CORE_ADDR from, CORE_ADDR t # # The default implementation returns false on all targets that # provide a gdbarch_software_single_step routine, and true otherwise. -m;bool;displaced_step_hw_singlestep;struct displaced_step_closure *closure;closure;;default_displaced_step_hw_singlestep;;0 +m;bool;displaced_step_hw_singlestep;void;;;default_displaced_step_hw_singlestep;;0 # Fix up the state resulting from successfully single-stepping a # displaced instruction, to give the result we would have gotten from diff --git a/gdb/infrun.c b/gdb/infrun.c index 5a6ff165802..e8c8fc0a95b 100644 --- a/gdb/infrun.c +++ b/gdb/infrun.c @@ -2459,15 +2459,11 @@ resume_1 (enum gdb_signal sig) } else if (prepared > 0) { - struct displaced_step_inferior_state *displaced; - /* Update pc to reflect the new address from which we will execute instructions due to displaced stepping. */ pc = regcache_read_pc (get_thread_regcache (tp)); - displaced = get_displaced_stepping_state (tp->inf); - step = gdbarch_displaced_step_hw_singlestep - (gdbarch, displaced->step_closure.get ()); + step = gdbarch_displaced_step_hw_singlestep (gdbarch); } } diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c index d4d7781a790..264d4e03e7f 100644 --- a/gdb/rs6000-tdep.c +++ b/gdb/rs6000-tdep.c @@ -995,8 +995,7 @@ ppc_displaced_step_fixup (struct gdbarch *gdbarch, /* Always use hardware single-stepping to execute the displaced instruction. */ static bool -ppc_displaced_step_hw_singlestep (struct gdbarch *gdbarch, - struct displaced_step_closure *closure) +ppc_displaced_step_hw_singlestep (struct gdbarch *gdbarch) { return true; } diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c index 176f170cd81..d3b96ebb494 100644 --- a/gdb/s390-tdep.c +++ b/gdb/s390-tdep.c @@ -587,8 +587,7 @@ s390_displaced_step_fixup (struct gdbarch *gdbarch, /* Implement displaced_step_hw_singlestep gdbarch method. */ static bool -s390_displaced_step_hw_singlestep (struct gdbarch *gdbarch, - struct displaced_step_closure *closure) +s390_displaced_step_hw_singlestep (struct gdbarch *gdbarch) { return true; }