{
struct thread_db_info *info = XCNEW (struct thread_db_info);
- info->pid = ptid_get_pid (inferior_ptid);
+ info->pid = inferior_ptid.pid ();
info->handle = handle;
/* The workaround works by reading from /proc/pid/status, so it is
/* This ptid comes from linux-nat.c, which should always fill in the
LWP. */
- gdb_assert (ptid_get_lwp (ptid) != 0);
+ gdb_assert (ptid.lwp () != 0);
- info = get_thread_db_info (ptid_get_pid (ptid));
+ info = get_thread_db_info (ptid.pid ());
/* Access an lwp we know is stopped. */
info->proc_handle.thread = stopped;
- err = info->td_ta_map_lwp2thr_p (info->thread_agent, ptid_get_lwp (ptid),
+ err = info->td_ta_map_lwp2thr_p (info->thread_agent, ptid.lwp (),
&th);
if (err != TD_OK)
error (_("Cannot find user-level thread for LWP %ld: %s"),
- ptid_get_lwp (ptid), thread_db_err_str (err));
+ ptid.lwp (), thread_db_err_str (err));
err = info->td_thr_get_info_p (&th, &ti);
if (err != TD_OK)
{
struct thread_db_info *info;
- info = get_thread_db_info (ptid_get_pid (child));
+ info = get_thread_db_info (child.pid ());
if (info == NULL)
return 0;
td_ta_map_lwp2thr uses ps_get_thread_area, but we can't use that
currently on core targets, as it uses ptrace directly. */
if (target_has_execution
- && linux_proc_task_list_dir_exists (ptid_get_pid (inferior_ptid)))
+ && linux_proc_task_list_dir_exists (inferior_ptid.pid ()))
info->td_ta_thr_iter_p = NULL;
else
CHK (TDB_VERBOSE_DLSYM (info, td_ta_thr_iter));
if (info->td_ta_thr_iter_p == NULL)
{
struct lwp_info *lp;
- int pid = ptid_get_pid (inferior_ptid);
+ int pid = inferior_ptid.pid ();
thread_info *curr_thread = inferior_thread ();
linux_stop_and_wait_all_lwps ();
ALL_LWPS (lp)
- if (ptid_get_pid (lp->ptid) == pid)
+ if (lp->ptid.pid () == pid)
thread_from_lwp (curr_thread, lp->ptid);
linux_unstop_all_lwps ();
return 1;
/* This library "refused" to work on current inferior. */
- delete_thread_db_info (ptid_get_pid (inferior_ptid));
+ delete_thread_db_info (inferior_ptid.pid ());
return 0;
}
{
struct thread_db_info *info;
- info = get_thread_db_info (ptid_get_pid (inferior_ptid));
+ info = get_thread_db_info (inferior_ptid.pid ());
if (info != NULL)
return 1;
child's thread list, we'll mistakenly think it has no threads
since the thread PID fields won't match the PID we give to
libthread_db. */
- if (!linux_ns_same (ptid_get_pid (inferior_ptid), LINUX_NS_PID))
+ if (!linux_ns_same (inferior_ptid.pid (), LINUX_NS_PID))
{
warning (_ ("Target and debugger are in different PID "
"namespaces; thread lists and other data are "
return ptid;
}
- info = get_thread_db_info (ptid_get_pid (ptid));
+ info = get_thread_db_info (ptid.pid ());
/* If this process isn't using thread_db, we're done. */
if (info == NULL)
{
/* New image, it may or may not end up using thread_db. Assume
not unless we find otherwise. */
- delete_thread_db_info (ptid_get_pid (ptid));
+ delete_thread_db_info (ptid.pid ());
if (!thread_db_list)
unpush_target (&the_thread_db_target);
void
thread_db_target::mourn_inferior ()
{
- delete_thread_db_info (ptid_get_pid (inferior_ptid));
+ delete_thread_db_info (inferior_ptid.pid ());
beneath ()->mourn_inferior ();
thread_db_thread_info *priv = get_thread_db_thread_info (thread_info);
snprintf (buf, sizeof (buf), "Thread 0x%lx (LWP %ld)",
- (unsigned long) priv->tid, ptid_get_lwp (ptid));
+ (unsigned long) priv->tid, ptid.lwp ());
return buf;
}
{
td_err_e err;
psaddr_t address;
- thread_db_info *info = get_thread_db_info (ptid_get_pid (ptid));
+ thread_db_info *info = get_thread_db_info (ptid.pid ());
thread_db_thread_info *priv = get_thread_db_thread_info (thread_info);
/* Finally, get the address of the variable. */
thread_db_target::get_ada_task_ptid (long lwp, long thread)
{
/* NPTL uses a 1:1 model, so the LWP id suffices. */
- return ptid_t (ptid_get_pid (inferior_ptid), lwp, 0);
+ return ptid_t (inferior_ptid.pid (), lwp, 0);
}
void
{
struct thread_db_info *info;
- if (ptid_equal (ptid, minus_one_ptid))
- info = get_thread_db_info (ptid_get_pid (inferior_ptid));
+ if (ptid == minus_one_ptid)
+ info = get_thread_db_info (inferior_ptid.pid ());
else
- info = get_thread_db_info (ptid_get_pid (ptid));
+ info = get_thread_db_info (ptid.pid ());
/* This workaround is only needed for child fork lwps stopped in a
PTRACE_O_TRACEFORK event. When the inferior is resumed, the
static void
maintenance_check_libthread_db (const char *args, int from_tty)
{
- int inferior_pid = ptid_get_pid (inferior_ptid);
+ int inferior_pid = inferior_ptid.pid ();
struct thread_db_info *info;
if (inferior_pid == 0)