gdb: make gdbarch_displaced_step_hw_singlestep return bool
authorSimon Marchi <simon.marchi@polymtl.ca>
Tue, 20 Oct 2020 21:39:47 +0000 (17:39 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Tue, 20 Oct 2020 21:39:48 +0000 (17:39 -0400)
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
gdb/aarch64-tdep.c
gdb/aarch64-tdep.h
gdb/arch-utils.c
gdb/arch-utils.h
gdb/gdbarch.c
gdb/gdbarch.h
gdb/gdbarch.sh
gdb/rs6000-tdep.c
gdb/s390-tdep.c

index bc50f0eac4e47e554edd1d8617a1d79f3de68a45..1ea6780418074462d021256c27158e45e5a9529b 100644 (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>
 
        * gdbarch.sh: Make generated predicates return bool.
index cbc7038dbba9472a12a3ae927bbb0937b10b2bdd..73bfcf5448febb8d630b3ee94cb27642c0f98708 100644 (file)
@@ -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.
index f6ebabeaeb95b49010c0e70cfd9ca714e554a52f..2f15758dbd545436e352a5441fb5177c3a4bf014 100644 (file)
@@ -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 */
index 12e3b8dbbb97ddad3b1ffc9ea626d8c601cf5610..27ac2f7232885da7fbc9041da789b5b24443414d 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "dis-asm.h"
 
-int
+bool
 default_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
                                      struct displaced_step_closure *closure)
 {
index 8cb0db04c8c4121295a08e2634e6674e43797e22..418b5c169886401933e93d2d92638092a89ce6a2 100644 (file)
@@ -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 *);
 
index 664aa9cdbff2019b4142e1eb5feb0e628f100993..3a55820f72ce5b004c1c4810a06b14292bac577f 100644 (file)
@@ -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);
index a12374875da33a1860935ed034f0da0970ad280a..d126dfcd6dda8f4711e4d9f32a99b93d6d087198 100644 (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 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
index 5fe37e0abc0942edc1035960d06d8914edfd5dc2..0b59ef05ff17ad42edff80ed3a0bc126c7f4b792 100755 (executable)
@@ -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
index 7e65151a046ee8125680367683390875505a47e8..d4d7781a790d68f5735d8982c8bda2b1e0ea6fee 100644 (file)
@@ -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
index 4d3644e5a7608f9c238750fb6470a3e8049e35ad..176f170cd81157fbedbd7e9bf4f573cf79a907ed 100644 (file)
@@ -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.  */