td_thrhandle_t th;
td_err_e val;
- if (ptid_lwp_p (thread_id))
+ if (thread_id.lwp_p ())
return thread_id; /* It's already an LWP ID. */
/* It's a thread. Convert to LWP. */
- val = p_td_ta_map_id2thr (main_ta, ptid_get_tid (thread_id), &th);
+ val = p_td_ta_map_id2thr (main_ta, thread_id.tid (), &th);
if (val == TD_NOTHR)
return ptid_t (-1); /* Thread must have terminated. */
else if (val != TD_OK)
td_thrhandle_t th;
td_err_e val;
- if (ptid_tid_p (lwp))
+ if (lwp.tid_p ())
return lwp; /* It's already a thread ID. */
/* It's an LWP. Convert it to a thread ID. */
error (_("This version of Solaris can't start inactive threads."));
if (info_verbose && ptid.pid () == -1)
warning (_("Specified thread %ld seems to have terminated"),
- ptid_get_tid (save_ptid));
+ save_ptid.tid ());
}
beneath ()->resume (ptid, step, signo);
if (ptid.pid () != -1)
{
- ptid_t save_ptid = ptid;
+ ptid_t ptid_for_warning = ptid;
ptid = thread_to_lwp (ptid, -2);
if (ptid.pid () == -2) /* Inactive thread. */
error (_("This version of Solaris can't start inactive threads."));
if (info_verbose && ptid.pid () == -1)
warning (_("Specified thread %ld seems to have terminated"),
- ptid_get_tid (save_ptid));
+ ptid_for_warning.tid ());
}
rtnval = beneath ()->wait (ptid, ourstatus, options);
rtnval = save_ptid;
/* See if we have a new thread. */
- if (ptid_tid_p (rtnval)
- && !ptid_equal (rtnval, save_ptid)
+ if (rtnval.tid_p ()
+ && rtnval != save_ptid
&& (!in_thread_list (rtnval)
|| is_exited (rtnval)))
add_thread (rtnval);
gdb_fpregset_t *fpregset_p = &fpregset;
ptid_t ptid = regcache->ptid ();
- if (!ptid_tid_p (ptid))
+ if (!ptid.tid_p ())
{
/* It's an LWP; pass the request on to the layer beneath. */
beneath ()->fetch_registers (regcache, regnum);
}
/* Solaris thread: convert PTID into a td_thrhandle_t. */
- thread = ptid_get_tid (ptid);
+ thread = ptid.tid ();
if (thread == 0)
error (_("sol_thread_fetch_registers: thread == 0"));
prfpregset_t fpregset;
ptid_t ptid = regcache->ptid ();
- if (!ptid_tid_p (ptid))
+ if (!ptid.tid_p ())
{
/* It's an LWP; pass the request on to the layer beneath. */
beneath ()->store_registers (regcache, regnum);
}
/* Solaris thread: convert PTID into a td_thrhandle_t. */
- thread = ptid_get_tid (ptid);
+ thread = ptid.tid ();
val = p_td_ta_map_id2thr (main_ta, thread, &thandle);
if (val != TD_OK)
{
scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
- if (ptid_tid_p (inferior_ptid) || !target_thread_alive (inferior_ptid))
+ if (inferior_ptid.tid_p () || !target_thread_alive (inferior_ptid))
{
/* It's either a thread or an LWP that isn't alive. Any live
LWP will do so use the first available.
bool
sol_thread_target::thread_alive (ptid_t ptid)
{
- if (ptid_tid_p (ptid))
+ if (ptid.tid_p ())
{
/* It's a (user-level) thread. */
td_err_e val;
td_thrhandle_t th;
int pid;
- pid = ptid_get_tid (ptid);
- if ((val = p_td_ta_map_id2thr (main_ta, pid, &th)) != TD_OK)
+ pid = ptid.tid ();
+ val = p_td_ta_map_id2thr (main_ta, pid, &th);
+ if (val != TD_OK)
return false; /* Thread not found. */
- if ((val = p_td_thr_validate (&th)) != TD_OK)
+ val = p_td_thr_validate (&th);
+ if (val != TD_OK)
return false; /* Thread not valid. */
return true; /* Known thread. */
}
scoped_restore save_inferior_ptid = make_scoped_restore (&inferior_ptid);
- if (ptid_tid_p (inferior_ptid) || !target_thread_alive (inferior_ptid))
+ if (inferior_ptid.tid_p () || !target_thread_alive (inferior_ptid))
{
/* It's either a thread or an LWP that isn't alive. Any live
LWP will do so use the first available.
return PS_OK;
}
-#ifdef PR_MODEL_LP64
/* Identify process as 32-bit or 64-bit. At the moment we're using
BFD to do this. There might be a more Solaris-specific
(e.g. procfs) method, but this ought to work. */
return PS_OK;
}
-#endif /* PR_MODEL_LP64 */
#if (defined(__i386__) || defined(__x86_64__)) && defined (sun)
of libthread_db would fail because of ps_lgetLDT being undefined. */
ps_err_e
-ps_lgetLDT (struct ps_prochandle *ph, lwpid_t lwpid,
- struct ssd *pldt)
+ps_lgetLDT (struct ps_prochandle *ph, lwpid_t lwpid, struct ssd *pldt) /* ARI: editCase function */
{
/* NOTE: only used on Solaris, therefore OK to refer to procfs.c. */
struct ssd *ret;
{
static char buf[100];
- if (ptid_tid_p (ptid))
+ if (ptid.tid_p ())
{
ptid_t lwp;
if (lwp.pid () == -1)
xsnprintf (buf, sizeof (buf), "Thread %ld (defunct)",
- ptid_get_tid (ptid));
+ ptid.tid ());
else if (lwp.pid () != -2)
xsnprintf (buf, sizeof (buf), "Thread %ld (LWP %ld)",
- ptid_get_tid (ptid), lwp.lwp ());
+ ptid.tid (), lwp.lwp ());
else
xsnprintf (buf, sizeof (buf), "Thread %ld ",
- ptid_get_tid (ptid));
+ ptid.tid ());
}
else if (ptid.lwp () != 0)
xsnprintf (buf, sizeof (buf), "LWP %ld ", ptid.lwp ());
{
long *tid = (long *) data;
- if (ptid_get_tid (thread->ptid) == *tid)
+ if (thread->ptid.tid () == *tid)
return 1;
return 0;