/* Return a printable representation of pthdebug function return
STATUS. */
-static char *
+static const char *
pd_status2str (int status)
{
switch (status)
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
{
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);
+
+ pid_to_prc (&ptid);
- inferior_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
- ptid = beneath->to_wait (beneath, ptid, status, options);
- do_cleanups (cleanup);
+ 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);
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. */
/* Return a printable representation of composite PID for use in
"info threads" output. */
-static char *
+static const char *
aix_thread_pid_to_str (struct target_ops *ops, ptid_t ptid)
{
static char *ret = NULL;
/* Return a printable representation of extra information about
THREAD, for use in "info threads" output. */
-static char *
+static const char *
aix_thread_extra_thread_info (struct target_ops *self,
struct thread_info *thread)
{