+2017-06-10 Simon Marchi <simon.marchi@polymtl.ca>
+
+ * gdbarch.sh (displaced_step_free_closure): Remove.
+ * gdbarch.h, gdbarch.c: Re-generate.
+ * aarch64-linux-tdep.c (aarch64_linux_init_abi): Don't set
+ displaced_step_free_closure.
+ * amd64-linux-tdep.c (amd64_linux_init_abi_common): Likewise.
+ * arm-linux-tdep.c (arm_linux_init_abi): Likewise.
+ * i386-linux-tdep.c (i386_linux_init_abi): Likewise.
+ * rs6000-aix-tdep.c (rs6000_aix_init_osabi): Likewise.
+ * rs6000-tdep.c (rs6000_gdbarch_init): Likewise.
+ * s390-linux-tdep.c (s390_gdbarch_init): Likewise.
+ * arch-utils.h (simple_displaced_step_free_closure): Remove.
+ * arch-utils.c (simple_displaced_step_free_closure): Remove.
+ * infrun.c (displaced_step_clear): Call xfree instead of
+ gdbarch_displaced_step_free_closure.
+
2017-06-08 Sergio Durigan Junior <sergiodj@redhat.com>
* common/common-utils.c (stringify_argv): Check for "arg[0] !=
set_gdbarch_displaced_step_copy_insn (gdbarch,
aarch64_displaced_step_copy_insn);
set_gdbarch_displaced_step_fixup (gdbarch, aarch64_displaced_step_fixup);
- set_gdbarch_displaced_step_free_closure (gdbarch,
- simple_displaced_step_free_closure);
set_gdbarch_displaced_step_location (gdbarch, linux_displaced_step_location);
set_gdbarch_displaced_step_hw_singlestep (gdbarch,
aarch64_displaced_step_hw_singlestep);
set_gdbarch_displaced_step_copy_insn (gdbarch,
amd64_displaced_step_copy_insn);
set_gdbarch_displaced_step_fixup (gdbarch, amd64_displaced_step_fixup);
- set_gdbarch_displaced_step_free_closure (gdbarch,
- simple_displaced_step_free_closure);
set_gdbarch_displaced_step_location (gdbarch,
linux_displaced_step_location);
return (struct displaced_step_closure *) buf;
}
-
-void
-simple_displaced_step_free_closure (struct gdbarch *gdbarch,
- struct displaced_step_closure *closure)
-{
- xfree (closure);
-}
-
int
default_displaced_step_hw_singlestep (struct gdbarch *gdbarch,
struct displaced_step_closure *closure)
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs);
-/* Simple implementation of gdbarch_displaced_step_free_closure: Call
- xfree.
- This is appropriate for use with simple_displaced_step_copy_insn. */
-extern void
- simple_displaced_step_free_closure (struct gdbarch *gdbarch,
- struct displaced_step_closure *closure);
-
/* Default implementation of gdbarch_displaced_hw_singlestep. */
extern int
default_displaced_step_hw_singlestep (struct gdbarch *,
set_gdbarch_displaced_step_copy_insn (gdbarch,
arm_linux_displaced_step_copy_insn);
set_gdbarch_displaced_step_fixup (gdbarch, arm_displaced_step_fixup);
- set_gdbarch_displaced_step_free_closure (gdbarch,
- simple_displaced_step_free_closure);
set_gdbarch_displaced_step_location (gdbarch, linux_displaced_step_location);
/* Reversible debugging, process record. */
gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn;
gdbarch_displaced_step_hw_singlestep_ftype *displaced_step_hw_singlestep;
gdbarch_displaced_step_fixup_ftype *displaced_step_fixup;
- gdbarch_displaced_step_free_closure_ftype *displaced_step_free_closure;
gdbarch_displaced_step_location_ftype *displaced_step_location;
gdbarch_relocate_instruction_ftype *relocate_instruction;
gdbarch_overlay_update_ftype *overlay_update;
gdbarch->skip_permanent_breakpoint = default_skip_permanent_breakpoint;
gdbarch->displaced_step_hw_singlestep = default_displaced_step_hw_singlestep;
gdbarch->displaced_step_fixup = NULL;
- gdbarch->displaced_step_free_closure = NULL;
gdbarch->displaced_step_location = NULL;
gdbarch->relocate_instruction = NULL;
gdbarch->has_shared_address_space = default_has_shared_address_space;
/* Skip verify of displaced_step_copy_insn, has predicate. */
/* Skip verify of displaced_step_hw_singlestep, invalid_p == 0 */
/* Skip verify of displaced_step_fixup, has predicate. */
- if ((! gdbarch->displaced_step_free_closure) != (! gdbarch->displaced_step_copy_insn))
- log.puts ("\n\tdisplaced_step_free_closure");
if ((! gdbarch->displaced_step_location) != (! gdbarch->displaced_step_copy_insn))
log.puts ("\n\tdisplaced_step_location");
/* Skip verify of relocate_instruction, has predicate. */
fprintf_unfiltered (file,
"gdbarch_dump: displaced_step_fixup = <%s>\n",
host_address_to_string (gdbarch->displaced_step_fixup));
- fprintf_unfiltered (file,
- "gdbarch_dump: displaced_step_free_closure = <%s>\n",
- host_address_to_string (gdbarch->displaced_step_free_closure));
fprintf_unfiltered (file,
"gdbarch_dump: displaced_step_hw_singlestep = <%s>\n",
host_address_to_string (gdbarch->displaced_step_hw_singlestep));
gdbarch->displaced_step_fixup = displaced_step_fixup;
}
-void
-gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, struct displaced_step_closure *closure)
-{
- gdb_assert (gdbarch != NULL);
- gdb_assert (gdbarch->displaced_step_free_closure != NULL);
- if (gdbarch_debug >= 2)
- fprintf_unfiltered (gdb_stdlog, "gdbarch_displaced_step_free_closure called\n");
- gdbarch->displaced_step_free_closure (gdbarch, closure);
-}
-
-void
-set_gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch,
- gdbarch_displaced_step_free_closure_ftype displaced_step_free_closure)
-{
- gdbarch->displaced_step_free_closure = displaced_step_free_closure;
-}
-
CORE_ADDR
gdbarch_displaced_step_location (struct gdbarch *gdbarch)
{
extern void gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, struct displaced_step_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
extern void set_gdbarch_displaced_step_fixup (struct gdbarch *gdbarch, gdbarch_displaced_step_fixup_ftype *displaced_step_fixup);
-/* Free a closure returned by gdbarch_displaced_step_copy_insn.
-
- If you provide gdbarch_displaced_step_copy_insn, you must provide
- this function as well.
-
- If your architecture uses closures that don't need to be freed, then
- you can use simple_displaced_step_free_closure here.
-
- For a general explanation of displaced stepping and how GDB uses it,
- see the comments in infrun.c. */
-
-typedef void (gdbarch_displaced_step_free_closure_ftype) (struct gdbarch *gdbarch, struct displaced_step_closure *closure);
-extern void gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, struct displaced_step_closure *closure);
-extern void set_gdbarch_displaced_step_free_closure (struct gdbarch *gdbarch, gdbarch_displaced_step_free_closure_ftype *displaced_step_free_closure);
-
/* Return the address of an appropriate place to put displaced
instructions while we step over them. There need only be one such
place, since we're only stepping one thread over a breakpoint at a
# see the comments in infrun.c.
M;void;displaced_step_fixup;struct displaced_step_closure *closure, CORE_ADDR from, CORE_ADDR to, struct regcache *regs;closure, from, to, regs;;NULL
-# Free a closure returned by gdbarch_displaced_step_copy_insn.
-#
-# If you provide gdbarch_displaced_step_copy_insn, you must provide
-# this function as well.
-#
-# If your architecture uses closures that don't need to be freed, then
-# you can use simple_displaced_step_free_closure here.
-#
-# For a general explanation of displaced stepping and how GDB uses it,
-# see the comments in infrun.c.
-m;void;displaced_step_free_closure;struct displaced_step_closure *closure;closure;;NULL;;(! gdbarch->displaced_step_free_closure) != (! gdbarch->displaced_step_copy_insn)
-
# Return the address of an appropriate place to put displaced
# instructions while we step over them. There need only be one such
# place, since we're only stepping one thread over a breakpoint at a
set_gdbarch_displaced_step_copy_insn (gdbarch,
i386_linux_displaced_step_copy_insn);
set_gdbarch_displaced_step_fixup (gdbarch, i386_displaced_step_fixup);
- set_gdbarch_displaced_step_free_closure (gdbarch,
- simple_displaced_step_free_closure);
set_gdbarch_displaced_step_location (gdbarch,
linux_displaced_step_location);
/* Indicate that there is no cleanup pending. */
displaced->step_ptid = null_ptid;
- if (displaced->step_closure)
- {
- gdbarch_displaced_step_free_closure (displaced->step_gdbarch,
- displaced->step_closure);
- displaced->step_closure = NULL;
- }
+ xfree (displaced->step_closure);
+ displaced->step_closure = NULL;
}
static void
software single-stepping. */
set_gdbarch_displaced_step_copy_insn (gdbarch, NULL);
set_gdbarch_displaced_step_fixup (gdbarch, NULL);
- set_gdbarch_displaced_step_free_closure (gdbarch, NULL);
set_gdbarch_displaced_step_location (gdbarch, NULL);
set_gdbarch_push_dummy_call (gdbarch, rs6000_push_dummy_call);
set_gdbarch_displaced_step_hw_singlestep (gdbarch,
ppc_displaced_step_hw_singlestep);
set_gdbarch_displaced_step_fixup (gdbarch, ppc_displaced_step_fixup);
- set_gdbarch_displaced_step_free_closure (gdbarch,
- simple_displaced_step_free_closure);
set_gdbarch_displaced_step_location (gdbarch,
displaced_step_at_entry_point);
set_gdbarch_displaced_step_copy_insn (gdbarch,
s390_displaced_step_copy_insn);
set_gdbarch_displaced_step_fixup (gdbarch, s390_displaced_step_fixup);
- set_gdbarch_displaced_step_free_closure (gdbarch,
- simple_displaced_step_free_closure);
set_gdbarch_displaced_step_location (gdbarch, linux_displaced_step_location);
set_gdbarch_max_insn_length (gdbarch, S390_MAX_INSTR_SIZE);