* [pushed] gdb: make gdbarch_displaced_step_hw_singlestep return bool
@ 2020-10-20 21:40 Simon Marchi
0 siblings, 0 replies; only message in thread
From: Simon Marchi @ 2020-10-20 21:40 UTC (permalink / raw)
To: gdb-patches
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
---
gdb/ChangeLog | 14 ++++++++++++++
gdb/aarch64-tdep.c | 4 ++--
gdb/aarch64-tdep.h | 4 ++--
gdb/arch-utils.c | 2 +-
gdb/arch-utils.h | 2 +-
gdb/gdbarch.c | 2 +-
gdb/gdbarch.h | 4 ++--
gdb/gdbarch.sh | 2 +-
gdb/rs6000-tdep.c | 4 ++--
gdb/s390-tdep.c | 4 ++--
10 files changed, 28 insertions(+), 14 deletions(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index bc50f0eac4e4..1ea678041807 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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>
* gdbarch.sh: Make generated predicates return bool.
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c
index cbc7038dbba9..73bfcf5448fe 100644
--- a/gdb/aarch64-tdep.c
+++ b/gdb/aarch64-tdep.c
@@ -3269,11 +3269,11 @@ aarch64_displaced_step_fixup (struct gdbarch *gdbarch,
/* Implement the "displaced_step_hw_singlestep" gdbarch method. */
-int
+bool
aarch64_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
struct displaced_step_closure *closure)
{
- return 1;
+ return true;
}
/* Get the correct target description for the given VQ value.
diff --git a/gdb/aarch64-tdep.h b/gdb/aarch64-tdep.h
index f6ebabeaeb95..2f15758dbd54 100644
--- a/gdb/aarch64-tdep.h
+++ b/gdb/aarch64-tdep.h
@@ -117,7 +117,7 @@ void aarch64_displaced_step_fixup (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs);
-int aarch64_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
- struct displaced_step_closure *closure);
+bool aarch64_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
+ displaced_step_closure *closure);
#endif /* aarch64-tdep.h */
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 12e3b8dbbb97..27ac2f723288 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -38,7 +38,7 @@
#include "dis-asm.h"
-int
+bool
default_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
struct displaced_step_closure *closure)
{
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
index 8cb0db04c8c4..418b5c169886 100644
--- a/gdb/arch-utils.h
+++ b/gdb/arch-utils.h
@@ -75,7 +75,7 @@ struct bp_manipulation_endian
BREAK_INSN_LITTLE, BREAK_INSN_BIG>
/* Default implementation of gdbarch_displaced_hw_singlestep. */
-extern int
+extern bool
default_displaced_step_hw_singlestep (struct gdbarch *,
struct displaced_step_closure *);
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 664aa9cdbff2..3a55820f72ce 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -3986,7 +3986,7 @@ set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch,
gdbarch->displaced_step_copy_insn = displaced_step_copy_insn;
}
-int
+bool
gdbarch_displaced_step_hw_singlestep (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
{
gdb_assert (gdbarch != NULL);
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index a12374875da3..d126dfcd6dda 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 int (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);
+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);
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 5fe37e0abc09..0b59ef05ff17 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;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
# displaced instruction, to give the result we would have gotten from
diff --git a/gdb/rs6000-tdep.c b/gdb/rs6000-tdep.c
index 7e65151a046e..d4d7781a790d 100644
--- a/gdb/rs6000-tdep.c
+++ b/gdb/rs6000-tdep.c
@@ -994,11 +994,11 @@ ppc_displaced_step_fixup (struct gdbarch *gdbarch,
/* Always use hardware single-stepping to execute the
displaced instruction. */
-static int
+static bool
ppc_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
struct displaced_step_closure *closure)
{
- return 1;
+ return true;
}
/* Checks for an atomic sequence of instructions beginning with a
diff --git a/gdb/s390-tdep.c b/gdb/s390-tdep.c
index 4d3644e5a760..176f170cd811 100644
--- a/gdb/s390-tdep.c
+++ b/gdb/s390-tdep.c
@@ -586,11 +586,11 @@ s390_displaced_step_fixup (struct gdbarch *gdbarch,
/* Implement displaced_step_hw_singlestep gdbarch method. */
-static int
+static bool
s390_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
struct displaced_step_closure *closure)
{
- return 1;
+ return true;
}
/* Prologue analysis. */
--
2.28.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-10-20 21:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-20 21:40 [pushed] gdb: make gdbarch_displaced_step_hw_singlestep return bool Simon Marchi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).