aboutsummaryrefslogtreecommitdiff
path: root/gdb/aix-thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/aix-thread.c')
-rw-r--r--gdb/aix-thread.c23
1 files changed, 10 insertions, 13 deletions
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index ced6203..f3434a6 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -985,12 +985,11 @@ aix_thread_resume (struct target_ops *ops,
if (!PD_TID (ptid))
{
- struct cleanup *cleanup = save_inferior_ptid ();
+ scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
struct target_ops *beneath = find_target_beneath (ops);
inferior_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
beneath->to_resume (beneath, ptid, step, sig);
- do_cleanups (cleanup);
}
else
{
@@ -1022,14 +1021,16 @@ static ptid_t
aix_thread_wait (struct target_ops *ops,
ptid_t ptid, struct target_waitstatus *status, int options)
{
- struct cleanup *cleanup = save_inferior_ptid ();
struct target_ops *beneath = find_target_beneath (ops);
- pid_to_prc (&ptid);
+ {
+ scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
- inferior_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
- ptid = beneath->to_wait (beneath, ptid, status, options);
- do_cleanups (cleanup);
+ pid_to_prc (&ptid);
+
+ inferior_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
+ ptid = beneath->to_wait (beneath, ptid, status, options);
+ }
if (ptid_get_pid (ptid) == -1)
return pid_to_ptid (-1);
@@ -1684,16 +1685,12 @@ aix_thread_xfer_partial (struct target_ops *ops, enum target_object object,
const gdb_byte *writebuf,
ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
{
- struct cleanup *old_chain = save_inferior_ptid ();
- enum target_xfer_status xfer;
+ scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
struct target_ops *beneath = find_target_beneath (ops);
inferior_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
- xfer = beneath->to_xfer_partial (beneath, object, annex, readbuf,
+ return beneath->to_xfer_partial (beneath, object, annex, readbuf,
writebuf, offset, len, xfered_len);
-
- do_cleanups (old_chain);
- return xfer;
}
/* Clean up after the inferior exits. */