+2020-02-14 Simon Marchi <simon.marchi@efficios.com>
+
+ * aarch64-tdep.c (aarch64_displaced_step_copy_insn): Use
+ displaced_step_closure_up.
+ * aarch64-tdep.h (aarch64_displaced_step_copy_insn): Likewise.
+ (struct displaced_step_closure_up):
+ * amd64-tdep.c (amd64_displaced_step_copy_insn): Likewise.
+ * amd64-tdep.h (amd64_displaced_step_copy_insn): Likewise.
+ * arm-linux-tdep.c (arm_linux_displaced_step_copy_insn):
+ Likewise.
+ * gdbarch.sh (displaced_step_copy_insn): Likewise.
+ * gdbarch.c, gdbarch.h: Re-generate.
+ * i386-linux-tdep.c (i386_linux_displaced_step_copy_insn): Use
+ displaced_step_closure_up.
+ * i386-tdep.c (i386_displaced_step_copy_insn): Likewise.
+ * i386-tdep.h (i386_displaced_step_copy_insn): Likewise.
+ * infrun.h (displaced_step_closure_up): New type alias.
+ (struct displaced_step_inferior_state) <step_closure>: Change
+ type to displaced_step_closure_up.
+ * rs6000-tdep.c (ppc_displaced_step_copy_insn): Use
+ displaced_step_closure_up.
+ * s390-tdep.c (s390_displaced_step_copy_insn): Likewise.
+
2020-02-14 Tom Tromey <tom@tromey.com>
* minidebug.c (gnu_debug_key): New global.
/* Implement the "displaced_step_copy_insn" gdbarch method. */
-std::unique_ptr<displaced_step_closure>
+displaced_step_closure_up
aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs)
#define AARCH64_TDEP_H
#include "arch/aarch64.h"
+#include "infrun.h"
/* Forward declarations. */
struct gdbarch;
extern int aarch64_process_record (struct gdbarch *gdbarch,
struct regcache *regcache, CORE_ADDR addr);
-struct std::unique_ptr<displaced_step_closure>
+displaced_step_closure_up
aarch64_displaced_step_copy_insn (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs);
}
}
-std::unique_ptr<displaced_step_closure>
+displaced_step_closure_up
amd64_displaced_step_copy_insn (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs)
struct regcache;
#include "i386-tdep.h"
+#include "infrun.h"
/* Register numbers of various important registers. */
#define AMD64_NUM_REGS (AMD64_GSBASE_REGNUM + 1)
-extern std::unique_ptr<displaced_step_closure> amd64_displaced_step_copy_insn
+extern displaced_step_closure_up amd64_displaced_step_copy_insn
(struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to,
struct regcache *regs);
extern void amd64_displaced_step_fixup (struct gdbarch *gdbarch,
the program has stepped into a Linux kernel helper routine (which must be
handled as a special case). */
-static std::unique_ptr<displaced_step_closure>
+static displaced_step_closure_up
arm_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs)
return gdbarch->displaced_step_copy_insn != NULL;
}
-std::unique_ptr<displaced_step_closure>
+displaced_step_closure_up
gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs)
{
gdb_assert (gdbarch != NULL);
#include "frame.h"
#include "dis-asm.h"
#include "gdb_obstack.h"
+#include "infrun.h"
struct floatformat;
struct ui_file;
struct bp_target_info;
struct target_desc;
struct symbol;
-struct displaced_step_closure;
struct syscall;
struct agent_expr;
struct axs_value;
extern int gdbarch_displaced_step_copy_insn_p (struct gdbarch *gdbarch);
-typedef std::unique_ptr<displaced_step_closure> (gdbarch_displaced_step_copy_insn_ftype) (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
-extern std::unique_ptr<displaced_step_closure> gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
+typedef displaced_step_closure_up (gdbarch_displaced_step_copy_insn_ftype) (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
+extern displaced_step_closure_up gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to, struct regcache *regs);
extern void set_gdbarch_displaced_step_copy_insn (struct gdbarch *gdbarch, gdbarch_displaced_step_copy_insn_ftype *displaced_step_copy_insn);
/* Return true if GDB should use hardware single-stepping to execute
# If the instruction cannot execute out of line, return NULL. The
# core falls back to stepping past the instruction in-line instead in
# that case.
-M;std::unique_ptr<displaced_step_closure>;displaced_step_copy_insn;CORE_ADDR from, CORE_ADDR to, struct regcache *regs;from, to, regs
+M;displaced_step_closure_up;displaced_step_copy_insn;CORE_ADDR from, CORE_ADDR to, struct regcache *regs;from, to, regs
# Return true if GDB should use hardware single-stepping to execute
# the displaced instruction identified by CLOSURE. If false,
#include "frame.h"
#include "dis-asm.h"
#include "gdb_obstack.h"
+#include "infrun.h"
struct floatformat;
struct ui_file;
struct bp_target_info;
struct target_desc;
struct symbol;
-struct displaced_step_closure;
struct syscall;
struct agent_expr;
struct axs_value;
#include "symtab.h"
#include "arch-utils.h"
#include "xml-syscall.h"
+#include "infrun.h"
#include "i387-tdep.h"
#include "gdbsupport/x86-xstate.h"
which does not seem worth it. The same effect is achieved by patching that
'nop' instruction there instead. */
-static std::unique_ptr<displaced_step_closure>
+static displaced_step_closure_up
i386_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs)
{
- std::unique_ptr<displaced_step_closure> closure_
+ displaced_step_closure_up closure_
= i386_displaced_step_copy_insn (gdbarch, from, to, regs);
if (i386_linux_get_syscall_number_from_regcache (regs) != -1)
/* Some kernels may run one past a syscall insn, so we have to cope. */
-std::unique_ptr<displaced_step_closure>
+displaced_step_closure_up
i386_displaced_step_copy_insn (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs)
typedef buf_displaced_step_closure i386_displaced_step_closure;
-extern std::unique_ptr<displaced_step_closure> i386_displaced_step_copy_insn
+extern displaced_step_closure_up i386_displaced_step_copy_insn
(struct gdbarch *gdbarch, CORE_ADDR from, CORE_ADDR to,
struct regcache *regs);
extern void i386_displaced_step_fixup (struct gdbarch *gdbarch,
virtual ~displaced_step_closure () = 0;
};
+using displaced_step_closure_up = std::unique_ptr<displaced_step_closure>;
+
/* A simple displaced step closure that contains only a byte buffer. */
struct buf_displaced_step_closure : displaced_step_closure
/* The closure provided gdbarch_displaced_step_copy_insn, to be used
for post-step cleanup. */
- std::unique_ptr<displaced_step_closure> step_closure;
+ displaced_step_closure_up step_closure;
/* The address of the original instruction, and the copy we
made. */
/* We can't displaced step atomic sequences. */
-static std::unique_ptr<displaced_step_closure>
+static displaced_step_closure_up
ppc_displaced_step_copy_insn (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs)
/* Implementation of gdbarch_displaced_step_copy_insn. */
-static std::unique_ptr<displaced_step_closure>
+static displaced_step_closure_up
s390_displaced_step_copy_insn (struct gdbarch *gdbarch,
CORE_ADDR from, CORE_ADDR to,
struct regcache *regs)