gdb: remove parameter of gdbarch_displaced_step_hw_singlestep
authorSimon Marchi <simon.marchi@polymtl.ca>
Thu, 29 Oct 2020 22:02:13 +0000 (18:02 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 29 Oct 2020 22:02:13 +0000 (18:02 -0400)
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

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/infrun.c
gdb/rs6000-tdep.c
gdb/s390-tdep.c

index fe585c4f531be4c13e15109244f9f39ffc083d78..7dfea4e9058542b4981337a02d10a3e98dba7a0a 100644 (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
index 73bfcf5448febb8d630b3ee94cb27642c0f98708..639fe59038740323f3c58eacb04a6b2ed5e1574a 100644 (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;
 }
index 2f15758dbd545436e352a5441fb5177c3a4bf014..bd7a6c602e0b15f900a63932e8c7d95def3517fd 100644 (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 */
index 1f66e0384a0b25901b84ba899ea45a2c48ca933f..8d5fa3fc976d14043cf4bf982f50aa59c5c8d1da 100644 (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);
 }
index 418b5c169886401933e93d2d92638092a89ce6a2..7eea838ac3de5a7143ae2bd7a718445764661e2a 100644 (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,
index 285d9f9b46d44beebe870dae77008741c602eb56..45dae111f18967407c423fb24139a91f4d2f0372 100644 (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
index ae65f290fc847ab8e1029c161063945f7b020cea..8b1507b4ea8cc0689b5fd77860310bbe24136edc 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 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
index 5f1e2f9d9583c202d334b82dac7b2fddedc92ea2..bff29c536c9d37dab1111f564b1d0c193212e394 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;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
index 5a6ff165802ce688c0d8641af4be6d5ac554890b..e8c8fc0a95b44b9c164bbb7d5b2c6a1778aaaf39 100644 (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);
        }
     }
 
index d4d7781a790d68f5735d8982c8bda2b1e0ea6fee..264d4e03e7fc205a141f83b77f4a88d194e1a548 100644 (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;
 }
index 176f170cd81157fbedbd7e9bf4f573cf79a907ed..d3b96ebb494573975c170662a7bac2513590cf2c 100644 (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;
 }