struct aix_thread_info : public private_thread_info
{
pthdb_pthread_t pdtid; /* thread's libpthdebug id */
- pthdb_tid_t tid; /* kernel thread id */
};
/* Return the aix_thread_info attached to THREAD. */
if (status != PTHDB_SUCCESS || pthid == PTHDB_INVALID_PTID)
continue;
- ptid_t ptid (pid, 0, pthid);
+ status = pthdb_pthread_tid (data->pd_session, pdtid, &tid);
+ ptid_t ptid (pid, tid, pthid);
+
status = pthdb_pthread_state (data->pd_session, pdtid, &state);
in_queue_threads.insert (pdtid);
aix_thread_info *priv = new aix_thread_info;
/* init priv */
priv->pdtid = pdtid;
- status = pthdb_pthread_tid (data->pd_session, pdtid, &tid);
- priv->tid = tid;
/* Check if this is the main thread. If it is, then change
its ptid and add its private data. */
if (in_thread_list (proc_target, ptid_t (pid)))
iter_tid (struct thread_info *thread, void *tidp)
{
const pthdb_tid_t tid = *(pthdb_tid_t *)tidp;
- aix_thread_info *priv = get_aix_thread_info (thread);
-
- return priv->tid == tid;
+ return thread->ptid.lwp () == tid;
}
/* Synchronize libpthdebug's state with the inferior and with GDB,
aix_thread_info *priv = get_aix_thread_info (thread);
- tid[0] = priv->tid;
+ tid[0] = ptid.lwp ();
if (tid[0] == PTHDB_INVALID_TID)
error (_("aix-thread resume: no tid for pthread %ld"),
ptid.lwp ());
{
thread = current_inferior ()->find_thread (regcache->ptid ());
aix_thread_info *priv = get_aix_thread_info (thread);
- tid = priv->tid;
+ tid = regcache->ptid().lwp ();
if (tid == PTHDB_INVALID_TID)
fetch_regs_user_thread (regcache, priv->pdtid);
{
thread = current_inferior ()->find_thread (regcache->ptid ());
aix_thread_info *priv = get_aix_thread_info (thread);
- tid = priv->tid;
+ tid = regcache->ptid ().lwp ();
if (tid == PTHDB_INVALID_TID)
store_regs_user_thread (regcache, priv->pdtid);
aix_thread_info *priv = get_aix_thread_info (thread_info);
return string_printf (_("Thread %s (tid %s)"), pulongest (ptid.tid ()),
- pulongest (priv->tid));
+ pulongest (ptid.lwp ()));
}
return beneath ()->pid_to_str (ptid);