gdb: make gdbarch_displaced_step_hw_singlestep return bool

Replace the int-used-as-a-bool with a bool.

gdb/ChangeLog:

	* gdbarch.sh (displaced_step_hw_singlestep): Return bool.
	* gdbarch.c: Re-generate.
	* gdbarch.h: Re-generate.
	* aarch64-tdep.c (aarch64_displaced_step_hw_singlestep): Return
	bool.
	* aarch64-tdep.h (aarch64_displaced_step_hw_singlestep):
	Likewise.
	* arch-utils.h (default_displaced_step_hw_singlestep): Likewise.
	* arch-utils.c (default_displaced_step_hw_singlestep): Likewise.
	* rs6000-tdep.c (ppc_displaced_step_hw_singlestep): Likewise.
	* s390-tdep.c (s390_displaced_step_hw_singlestep): Likewise.

Change-Id: I76a78366dc5c0afb03f8f4bddf9f4e8d68fe3114
This commit is contained in:
Simon Marchi 2020-10-20 17:39:47 -04:00
parent 3953519365
commit 07fbbd0138
10 changed files with 28 additions and 14 deletions

View File

@ -1,3 +1,17 @@
2020-10-20 Simon Marchi <simon.marchi@polymtl.ca>
* gdbarch.sh (displaced_step_hw_singlestep): Return bool.
* gdbarch.c: Re-generate.
* gdbarch.h: Re-generate.
* aarch64-tdep.c (aarch64_displaced_step_hw_singlestep): Return
bool.
* aarch64-tdep.h (aarch64_displaced_step_hw_singlestep):
Likewise.
* arch-utils.h (default_displaced_step_hw_singlestep): Likewise.
* arch-utils.c (default_displaced_step_hw_singlestep): Likewise.
* rs6000-tdep.c (ppc_displaced_step_hw_singlestep): Likewise.
* s390-tdep.c (s390_displaced_step_hw_singlestep): Likewise.
2020-10-20 Simon Marchi <simon.marchi@polymtl.ca> 2020-10-20 Simon Marchi <simon.marchi@polymtl.ca>
* gdbarch.sh: Make generated predicates return bool. * gdbarch.sh: Make generated predicates return bool.

View File

@ -3269,11 +3269,11 @@ aarch64_displaced_step_fixup (struct gdbarch *gdbarch,
/* Implement the "displaced_step_hw_singlestep" gdbarch method. */ /* Implement the "displaced_step_hw_singlestep" gdbarch method. */
int bool
aarch64_displaced_step_hw_singlestep (struct gdbarch *gdbarch, aarch64_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
struct displaced_step_closure *closure) struct displaced_step_closure *closure)
{ {
return 1; return true;
} }
/* Get the correct target description for the given VQ value. /* Get the correct target description for the given VQ value.

View File

@ -117,7 +117,7 @@ void aarch64_displaced_step_fixup (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to, CORE_ADDR from, CORE_ADDR to,
struct regcache *regs); struct regcache *regs);
int aarch64_displaced_step_hw_singlestep (struct gdbarch *gdbarch, bool aarch64_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
struct displaced_step_closure *closure); displaced_step_closure *closure);
#endif /* aarch64-tdep.h */ #endif /* aarch64-tdep.h */

View File

@ -38,7 +38,7 @@
#include "dis-asm.h" #include "dis-asm.h"
int bool
default_displaced_step_hw_singlestep (struct gdbarch *gdbarch, default_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
struct displaced_step_closure *closure) struct displaced_step_closure *closure)
{ {

View File

@ -75,7 +75,7 @@ struct bp_manipulation_endian
BREAK_INSN_LITTLE, BREAK_INSN_BIG> BREAK_INSN_LITTLE, BREAK_INSN_BIG>
/* Default implementation of gdbarch_displaced_hw_singlestep. */ /* Default implementation of gdbarch_displaced_hw_singlestep. */
extern int extern bool
default_displaced_step_hw_singlestep (struct gdbarch *, default_displaced_step_hw_singlestep (struct gdbarch *,
struct displaced_step_closure *); struct displaced_step_closure *);

View File

@ -3986,7 +3986,7 @@ set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch,
gdbarch->displaced_step_copy_insn = displaced_step_copy_insn; gdbarch->displaced_step_copy_insn = displaced_step_copy_insn;
} }
int bool
gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure) gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
{ {
gdb_assert (gdbarch != NULL); gdb_assert (gdbarch != NULL);

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 The default implementation returns false on all targets that
provide a gdbarch_software_single_step routine, and true otherwise. */ provide a gdbarch_software_single_step routine, and true otherwise. */
typedef int (gdbarch_displaced_step_hw_singlestep_ftype) (struct gdbarch *gdbarch, struct displaced_step_closure *closure); typedef bool (gdbarch_displaced_step_hw_singlestep_ftype) (struct gdbarch *gdbarch, struct displaced_step_closure *closure);
extern int gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure); extern bool gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure);
extern void set_gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep); 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 /* 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 # The default implementation returns false on all targets that
# provide a gdbarch_software_single_step routine, and true otherwise. # provide a gdbarch_software_single_step routine, and true otherwise.
m;int;displaced_step_hw_singlestep;struct displaced_step_closure *closure;closure;;default_displaced_step_hw_singlestep;;0 m;bool;displaced_step_hw_singlestep;struct displaced_step_closure *closure;closure;;default_displaced_step_hw_singlestep;;0
# Fix up the state resulting from successfully single-stepping a # Fix up the state resulting from successfully single-stepping a
# displaced instruction, to give the result we would have gotten from # displaced instruction, to give the result we would have gotten from

View File

@ -994,11 +994,11 @@ ppc_displaced_step_fixup (struct gdbarch *gdbarch,
/* Always use hardware single-stepping to execute the /* Always use hardware single-stepping to execute the
displaced instruction. */ displaced instruction. */
static int static bool
ppc_displaced_step_hw_singlestep (struct gdbarch *gdbarch, ppc_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
struct displaced_step_closure *closure) struct displaced_step_closure *closure)
{ {
return 1; return true;
} }
/* Checks for an atomic sequence of instructions beginning with a /* Checks for an atomic sequence of instructions beginning with a

View File

@ -586,11 +586,11 @@ s390_displaced_step_fixup (struct gdbarch *gdbarch,
/* Implement displaced_step_hw_singlestep gdbarch method. */ /* Implement displaced_step_hw_singlestep gdbarch method. */
static int static bool
s390_displaced_step_hw_singlestep (struct gdbarch *gdbarch, s390_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
struct displaced_step_closure *closure) struct displaced_step_closure *closure)
{ {
return 1; return true;
} }
/* Prologue analysis. */ /* Prologue analysis. */