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
This commit is contained in:
Simon Marchi 2020-10-29 18:02:13 -04:00
parent 8407f91bd3
commit 40a5376690
11 changed files with 32 additions and 23 deletions

View file

@ -1,3 +1,23 @@
2020-10-29 Simon Marchi <simon.marchi@polymtl.ca>
* 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 <tom@tromey.com>
* progspace.c (program_space::~program_space): Don't call

View file

@ -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;
}

View file

@ -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 */

View file

@ -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);
}

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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);
}
}

View file

@ -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;
}

View file

@ -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;
}