gdb: make gdbarch_displaced_step_copy_insn return an std::unique_ptr
[deliverable/binutils-gdb.git] / gdb / infrun.c
index fdb06035dd4718079692ec87e7526ff070c0f633..0bff0d1247429da885b936f548d674873e3d53e8 100644 (file)
@@ -1629,7 +1629,6 @@ displaced_step_prepare_throw (thread_info *tp)
   const address_space *aspace = regcache->aspace ();
   CORE_ADDR original, copy;
   ULONGEST len;
-  struct displaced_step_closure *closure;
   int status;
 
   /* We should never reach this function if the architecture does not
@@ -1721,9 +1720,9 @@ displaced_step_prepare_throw (thread_info *tp)
                                 len);
     };
 
-  closure = gdbarch_displaced_step_copy_insn (gdbarch,
-                                             original, copy, regcache);
-  if (closure == NULL)
+  displaced->step_closure
+    = gdbarch_displaced_step_copy_insn (gdbarch, original, copy, regcache);
+  if (displaced->step_closure == NULL)
     {
       /* The architecture doesn't know how or want to displaced step
         this instruction or instruction sequence.  Fallback to
@@ -1735,7 +1734,6 @@ displaced_step_prepare_throw (thread_info *tp)
      succeeds.  */
   displaced->step_thread = tp;
   displaced->step_gdbarch = gdbarch;
-  displaced->step_closure.reset (closure);
   displaced->step_original = original;
   displaced->step_copy = copy;
 
This page took 0.024567 seconds and 4 git commands to generate.