aboutsummaryrefslogtreecommitdiff
path: root/gdb/spu-multiarch.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/spu-multiarch.c')
-rw-r--r--gdb/spu-multiarch.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c
index 3da502c..7682ca2 100644
--- a/gdb/spu-multiarch.c
+++ b/gdb/spu-multiarch.c
@@ -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. */