the program has stepped into a Linux kernel helper routine (which must be
handled as a special case). */
-static struct 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)
{
- arm_displaced_step_closure *dsc = new arm_displaced_step_closure;
+ std::unique_ptr<arm_displaced_step_closure> dsc
+ (new arm_displaced_step_closure);
/* Detect when we enter an (inaccessible by GDB) Linux kernel helper, and
stop at the return location. */
fprintf_unfiltered (gdb_stdlog, "displaced: detected kernel helper "
"at %.8lx\n", (unsigned long) from);
- arm_catch_kernel_helper_return (gdbarch, from, to, regs, dsc);
+ arm_catch_kernel_helper_return (gdbarch, from, to, regs, dsc.get ());
}
else
{
/* Override the default handling of SVC instructions. */
dsc->u.svc.copy_svc_os = arm_linux_copy_svc;
- arm_process_displaced_insn (gdbarch, from, to, regs, dsc);
+ arm_process_displaced_insn (gdbarch, from, to, regs, dsc.get ());
}
- arm_displaced_init_closure (gdbarch, from, to, dsc);
+ arm_displaced_init_closure (gdbarch, from, to, dsc.get ());
- return dsc;
+ /* This is a work around for a problem with g++ 4.8. */
+ return displaced_step_closure_up (dsc.release ());
}
/* Implementation of `gdbarch_stap_is_single_operand', as defined in
set_gdbarch_gcc_target_options (gdbarch, arm_linux_gcc_target_options);
}
+void _initialize_arm_linux_tdep ();
void
-_initialize_arm_linux_tdep (void)
+_initialize_arm_linux_tdep ()
{
gdbarch_register_osabi (bfd_arch_arm, 0, GDB_OSABI_LINUX,
arm_linux_init_abi);