gdb: make gdbarch_displaced_step_copy_insn return an std::unique_ptr
[deliverable/binutils-gdb.git] / gdb / i386-linux-tdep.c
index 5827cb4eec37825e290163b9530bd51ed772b8cb..7baa705225aa9fd2972d90369296097575fa62c3 100644 (file)
@@ -797,12 +797,12 @@ i386_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
    which does not seem worth it.  The same effect is achieved by patching that
    'nop' instruction there instead.  */
 
-static struct displaced_step_closure *
+static std::unique_ptr<displaced_step_closure>
 i386_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
                                     CORE_ADDR from, CORE_ADDR to,
                                     struct regcache *regs)
 {
-  displaced_step_closure *closure_
+  std::unique_ptr<displaced_step_closure> closure_
     =  i386_displaced_step_copy_insn (gdbarch, from, to, regs);
 
   if (i386_linux_get_syscall_number_from_regcache (regs) != -1)
@@ -810,7 +810,7 @@ i386_linux_displaced_step_copy_insn (struct gdbarch *gdbarch,
       /* The closure returned by i386_displaced_step_copy_insn is simply a
         buffer with a copy of the instruction. */
       i386_displaced_step_closure *closure
-       = (i386_displaced_step_closure *) closure_;
+       = (i386_displaced_step_closure *) closure_.get ();
 
       /* Fake nop.  */
       closure->buf[0] = 0x90;
This page took 0.023169 seconds and 4 git commands to generate.