struct string_map
{
int num;
- char *str;
+ const char *str;
};
static struct ps_prochandle main_ph;
/* Return the libthread_db error string associated with ERRCODE. If
ERRCODE is unknown, return an appropriate message. */
-static char *
+static const char *
td_err_string (td_err_e errcode)
{
static struct string_map td_err_table[] =
/* Return the libthread_db state string assicoated with STATECODE.
If STATECODE is unknown, return an appropriate message. */
-static char *
+static const char *
td_state_string (td_thr_state_e statecode)
{
static struct string_map td_thr_state_table[] =
sol_thread_resume (struct target_ops *ops,
ptid_t ptid, int step, enum gdb_signal signo)
{
- struct cleanup *old_chain;
struct target_ops *beneath = find_target_beneath (ops);
- old_chain = save_inferior_ptid ();
+ scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
inferior_ptid = thread_to_lwp (inferior_ptid, ptid_get_pid (main_ph.ptid));
if (ptid_get_pid (inferior_ptid) == -1)
}
beneath->to_resume (beneath, ptid, step, signo);
-
- do_cleanups (old_chain);
}
/* Wait for any threads to stop. We may have to convert PTID from a
ptid_t rtnval;
ptid_t save_ptid;
struct target_ops *beneath = find_target_beneath (ops);
- struct cleanup *old_chain;
save_ptid = inferior_ptid;
- old_chain = save_inferior_ptid ();
+ scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
inferior_ptid = thread_to_lwp (inferior_ptid, ptid_get_pid (main_ph.ptid));
if (ptid_get_pid (inferior_ptid) == -1)
package being initialized, since that can only happen after we've
found the shared libs. */
- do_cleanups (old_chain);
-
return rtnval;
}
const gdb_byte *writebuf,
ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
{
- enum target_xfer_status retval;
- struct cleanup *old_chain;
struct target_ops *beneath = find_target_beneath (ops);
- old_chain = save_inferior_ptid ();
+ scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
if (ptid_tid_p (inferior_ptid) || !target_thread_alive (inferior_ptid))
{
inferior_ptid = procfs_first_available ();
}
- retval = beneath->to_xfer_partial (beneath, object, annex, readbuf,
- writebuf, offset, len, xfered_len);
-
- do_cleanups (old_chain);
-
- return retval;
+ return beneath->to_xfer_partial (beneath, object, annex, readbuf,
+ writebuf, offset, len, xfered_len);
}
static void
gdb_byte *buf, int size)
{
int ret;
- struct cleanup *old_chain;
- old_chain = save_inferior_ptid ();
+ scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
if (ptid_tid_p (inferior_ptid) || !target_thread_alive (inferior_ptid))
{
else
ret = target_read_memory (addr, (gdb_byte *) buf, size);
- do_cleanups (old_chain);
-
return (ret == 0 ? PS_OK : PS_ERR);
}
sol_thread_ops.to_magic = OPS_MAGIC;
}
-/* Silence -Wmissing-prototypes. */
-extern void _initialize_sol_thread (void);
-
void
_initialize_sol_thread (void)
{