Remove save_inferior_ptid
[deliverable/binutils-gdb.git] / gdb / spu-multiarch.c
index 3da502cea5e1411238f652d4111a6460e3b5c69b..7682ca2980732b5e87285cd87ce9938be8a16468 100644 (file)
@@ -76,10 +76,11 @@ parse_spufs_run (ptid_t ptid, int *fd, CORE_ADDR *addr)
   tdep = gdbarch_tdep (target_gdbarch ());
 
   /* Fetch instruction preceding current NIP.  */
-  old_chain = save_inferior_ptid ();
-  inferior_ptid = ptid;
-  regval = target_read_memory (regcache_read_pc (regcache) - 4, buf, 4);
-  do_cleanups (old_chain);
+  {
+    scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
+    inferior_ptid = ptid;
+    regval = target_read_memory (regcache_read_pc (regcache) - 4, buf, 4);
+  }
   if (regval != 0)
     return 0;
   /* It should be a "sc" instruction.  */
This page took 0.024934 seconds and 4 git commands to generate.