if (!in_thread_list (currthread))
{
struct inferior *inf = NULL;
- int pid = ptid_get_pid (currthread);
+ int pid = currthread.pid ();
if (ptid_is_pid (inferior_ptid)
- && pid == ptid_get_pid (inferior_ptid))
+ && pid == inferior_ptid.pid ())
{
/* inferior_ptid has no thread member yet. This can happen
with the vAttach -> remote_wait,"TAAthread:" path if the
extended-remote which already was debugging an inferior, we
may not know about it yet. Add it before adding its child
thread, so notifications are emitted in a sensible order. */
- if (find_inferior_pid (ptid_get_pid (currthread)) == NULL)
+ if (find_inferior_pid (currthread.pid ()) == NULL)
{
struct remote_state *rs = get_remote_state ();
int fake_pid_p = !remote_multi_process_p (rs);
inf = remote_add_inferior (fake_pid_p,
- ptid_get_pid (currthread), -1, 1);
+ currthread.pid (), -1, 1);
}
/* This is really a new thread. Add it. */
/* We only need to change the remote current thread if it's pointing
at some other process. */
- if (ptid_get_pid (rs->general_thread) != ptid_get_pid (inferior_ptid))
+ if (rs->general_thread.pid () != inferior_ptid.pid ())
set_general_thread (inferior_ptid);
}
/* The main thread is always alive. */
return 1;
- if (ptid_get_pid (ptid) != 0 && ptid_get_lwp (ptid) == 0)
+ if (ptid.pid () != 0 && ptid_get_lwp (ptid) == 0)
/* The main thread is always alive. This can happen after a
vAttach, if the remote side doesn't support
multi-threading. */
if (remote_multi_process_p (rs))
{
- pid = ptid_get_pid (ptid);
+ pid = ptid.pid ();
if (pid < 0)
buf += xsnprintf (buf, endbuf - buf, "p-%x.", -pid);
else
then since there's no way to know the pid of the reported
threads, use the magic number. */
if (ptid_equal (inferior_ptid, null_ptid))
- pid = ptid_get_pid (magic_null_ptid);
+ pid = magic_null_ptid.pid ();
else
- pid = ptid_get_pid (inferior_ptid);
+ pid = inferior_ptid.pid ();
if (obuf)
*obuf = pp;
_("remote_threads_extra_info"));
if (ptid_equal (tp->ptid, magic_null_ptid)
- || (ptid_get_pid (tp->ptid) != 0 && ptid_get_lwp (tp->ptid) == 0))
+ || (tp->ptid.pid () != 0 && ptid_get_lwp (tp->ptid) == 0))
/* This is the main thread which was added by GDB. The remote
server doesn't know about it. */
return NULL;
ptid_t
remote_target::get_ada_task_ptid (long lwp, long thread)
{
- return ptid_t (ptid_get_pid (inferior_ptid), lwp, 0);
+ return ptid_t (inferior_ptid.pid (), lwp, 0);
}
\f
fake_pid_p = 1;
}
- remote_add_inferior (fake_pid_p, ptid_get_pid (curr_ptid), -1, 1);
+ remote_add_inferior (fake_pid_p, curr_ptid.pid (), -1, 1);
/* Add the main thread and switch to it. Don't try reading
registers yet, since we haven't fetched the target description
void
remote_target::remote_detach_1 (inferior *inf, int from_tty)
{
- int pid = ptid_get_pid (inferior_ptid);
+ int pid = inferior_ptid.pid ();
struct remote_state *rs = get_remote_state ();
int is_fork_parent;
pid_t child_pid;
child_ptid = inferior_thread ()->pending_follow.value.related_pid;
- child_pid = ptid_get_pid (child_ptid);
+ child_pid = child_ptid.pid ();
remote_detach_pid (child_pid);
}
ptid_t nptid;
/* All (-1) threads of process. */
- nptid = ptid_t (ptid_get_pid (ptid), -1, 0);
+ nptid = ptid_t (ptid.pid (), -1, 0);
p += xsnprintf (p, endp - p, ":");
p = write_ptid (p, endp, nptid);
if (ptid_is_pid (ptid))
/* All (-1) threads of process. */
- nptid = ptid_t (ptid_get_pid (ptid), -1, 0);
+ nptid = ptid_t (ptid.pid (), -1, 0);
else
{
/* Small optimization: if we already have a stop reply for
if (ws->kind == TARGET_WAITKIND_FORKED
|| ws->kind == TARGET_WAITKIND_VFORKED)
{
- if (event_pid == -1 || event_pid == ptid_get_pid (thread_ptid))
+ if (event_pid == -1 || event_pid == thread_ptid.pid ())
return 1;
}
reply = (struct stop_reply *) rns->pending_event[notif_client_stop.id];
/* Discard the in-flight notification. */
- if (reply != NULL && ptid_get_pid (reply->ptid) == inf->pid)
+ if (reply != NULL && reply->ptid.pid () == inf->pid)
{
stop_reply_xfree (reply);
rns->pending_event[notif_client_stop.id] = NULL;
}
/* If no process is specified, assume inferior_ptid. */
- pid = ptid_get_pid (inferior_ptid);
+ pid = inferior_ptid.pid ();
if (*p == '\0')
;
else if (*p == ';')
remote_target::kill ()
{
int res = -1;
- int pid = ptid_get_pid (inferior_ptid);
+ int pid = inferior_ptid.pid ();
struct remote_state *rs = get_remote_state ();
if (packet_support (PACKET_vKill) != PACKET_DISABLE)
threadalive_test (const char *cmd, int tty)
{
int sample_thread = SAMPLE_THREAD;
- int pid = ptid_get_pid (inferior_ptid);
+ int pid = inferior_ptid.pid ();
ptid_t ptid = ptid_t (pid, sample_thread, 0);
if (remote_thread_alive (ptid))
return normal_pid_to_str (ptid);
else
xsnprintf (buf, sizeof buf, "Thread %d.%ld",
- ptid_get_pid (ptid), ptid_get_lwp (ptid));
+ ptid.pid (), ptid_get_lwp (ptid));
else
xsnprintf (buf, sizeof buf, "Thread %ld",
ptid_get_lwp (ptid));