if (print_inferior_events)
{
/* Ensure that we have a process ptid. */
- ptid_t process_ptid = pid_to_ptid (ptid_get_pid (child_ptid));
+ ptid_t process_ptid = ptid_t (child_ptid.pid ());
target_terminal::ours_for_output ();
fprintf_filtered (gdb_stdlog,
struct inferior *parent_inf, *child_inf;
/* Add process to GDB's tables. */
- child_inf = add_inferior (ptid_get_pid (child_ptid));
+ child_inf = add_inferior (child_ptid.pid ());
parent_inf = current_inferior ();
child_inf->attach_flag = parent_inf->attach_flag;
/* Add the new inferior first, so that the target_detach below
doesn't unpush the target. */
- child_inf = add_inferior (ptid_get_pid (child_ptid));
+ child_inf = add_inferior (child_ptid.pid ());
parent_inf = current_inferior ();
child_inf->attach_flag = parent_inf->attach_flag;
if (print_inferior_events)
{
/* Ensure that we have a process ptid. */
- ptid_t process_ptid = pid_to_ptid (ptid_get_pid (parent_ptid));
+ ptid_t process_ptid = ptid_t (parent_ptid.pid ());
target_terminal::ours_for_output ();
fprintf_filtered (gdb_stdlog,
if (print_inferior_events)
{
const char *pidstr
- = target_pid_to_str (pid_to_ptid (inf->vfork_parent->pid));
+ = target_pid_to_str (ptid_t (inf->vfork_parent->pid));
target_terminal::ours_for_output ();
{
struct thread_info *th, *tmp;
struct inferior *inf = current_inferior ();
- int pid = ptid_get_pid (ptid);
+ int pid = ptid.pid ();
ptid_t process_ptid;
/* This is an exec event that we actually wish to pay attention to.
stop provides a nicer sequence of events for user and MI
notifications. */
ALL_THREADS_SAFE (th, tmp)
- if (ptid_get_pid (th->ptid) == pid && !ptid_equal (th->ptid, ptid))
+ if (th->ptid.pid () == pid && !ptid_equal (th->ptid, ptid))
delete_thread (th);
/* We also need to clear any left over stale state for the
update_breakpoints_after_exec ();
/* What is this a.out's name? */
- process_ptid = pid_to_ptid (pid);
+ process_ptid = ptid_t (pid);
printf_unfiltered (_("%s is executing new program: %s\n"),
target_pid_to_str (process_ptid),
exec_file_target);
{
/* Resume all threads of the current process (and none of other
processes). */
- resume_ptid = pid_to_ptid (ptid_get_pid (inferior_ptid));
+ resume_ptid = ptid_t (inferior_ptid.pid ());
}
else
{
we're about to resume, implicitly and explicitly. */
ALL_NON_EXITED_THREADS (tp)
{
- if (!ptid_match (tp->ptid, resume_ptid))
+ if (!tp->ptid.matches (resume_ptid))
continue;
clear_proceed_status_thread (tp);
}
continue;
/* Ignore threads of processes we're not resuming. */
- if (!ptid_match (tp->ptid, resume_ptid))
+ if (!tp->ptid.matches (resume_ptid))
continue;
if (!thread_still_needs_step_over (tp))
ALL_NON_EXITED_THREADS (tp)
{
/* Ignore threads of processes we're not resuming. */
- if (!ptid_match (tp->ptid, resume_ptid))
+ if (!tp->ptid.matches (resume_ptid))
continue;
if (tp->resumed)
thread had been temporarily paused for some step-over), set up
for reporting the stop now. */
ALL_NON_EXITED_THREADS (tp)
- if (ptid_match (tp->ptid, ptid))
+ if (tp->ptid.matches (ptid))
{
if (tp->state != THREAD_RUNNING)
continue;
is set. */
stb.printf ("infrun: target_wait (%d.%ld.%ld",
- ptid_get_pid (waiton_ptid),
- ptid_get_lwp (waiton_ptid),
- ptid_get_tid (waiton_ptid));
- if (ptid_get_pid (waiton_ptid) != -1)
+ waiton_ptid.pid (),
+ waiton_ptid.lwp (),
+ waiton_ptid.tid ());
+ if (waiton_ptid.pid () != -1)
stb.printf (" [%s]", target_pid_to_str (waiton_ptid));
stb.printf (", status) =\n");
stb.printf ("infrun: %d.%ld.%ld [%s],\n",
- ptid_get_pid (result_ptid),
- ptid_get_lwp (result_ptid),
- ptid_get_tid (result_ptid),
+ result_ptid.pid (),
+ result_ptid.lwp (),
+ result_ptid.tid (),
target_pid_to_str (result_ptid));
stb.printf ("infrun: %s\n", status_string.c_str ());
/* First see how many events we have. Count only resumed threads
that have an event pending. */
ALL_NON_EXITED_THREADS (event_tp)
- if (ptid_match (event_tp->ptid, waiton_ptid)
+ if (event_tp->ptid.matches (waiton_ptid)
&& event_tp->resumed
&& event_tp->suspend.waitstatus_pending_p)
num_events++;
/* Select the Nth thread that has had an event. */
ALL_NON_EXITED_THREADS (event_tp)
- if (ptid_match (event_tp->ptid, waiton_ptid)
+ if (event_tp->ptid.matches (waiton_ptid)
&& event_tp->resumed
&& event_tp->suspend.waitstatus_pending_p)
if (random_selector-- == 0)
/* First check if there is a resumed thread with a wait status
pending. */
- if (ptid_equal (ptid, minus_one_ptid) || ptid_is_pid (ptid))
+ if (ptid_equal (ptid, minus_one_ptid) || ptid.is_pid ())
{
tp = random_pending_event_thread (ptid);
}
prepare_for_detach (void)
{
struct inferior *inf = current_inferior ();
- ptid_t pid_ptid = pid_to_ptid (inf->pid);
+ ptid_t pid_ptid = ptid_t (inf->pid);
displaced_step_inferior_state *displaced = get_displaced_stepping_state (inf);
fprintf_unfiltered (gdb_stdlog,
"infrun: saving status %s for %d.%ld.%ld\n",
statstr.c_str (),
- ptid_get_pid (tp->ptid),
- ptid_get_lwp (tp->ptid),
- ptid_get_tid (tp->ptid));
+ tp->ptid.pid (),
+ tp->ptid.lwp (),
+ tp->ptid.tid ());
}
/* Record for later. */
{
if (debug_infrun)
{
- ptid_t ptid = pid_to_ptid (ws.value.integer);
+ ptid_t ptid = ptid_t (ws.value.integer);
fprintf_unfiltered (gdb_stdlog,
"infrun: %s exited while "
"infrun: target_wait %s, saving "
"status for %d.%ld.%ld\n",
statstr.c_str (),
- ptid_get_pid (t->ptid),
- ptid_get_lwp (t->ptid),
- ptid_get_tid (t->ptid));
+ t->ptid.pid (),
+ t->ptid.lwp (),
+ t->ptid.tid ());
}
/* Record for later. */
process as not-executing so that finish_thread_state marks
them stopped (in the user's perspective) if/when we present
the stop to the user. */
- mark_ptid = pid_to_ptid (ptid_get_pid (ecs->ptid));
+ mark_ptid = ptid_t (ecs->ptid.pid ());
}
else
mark_ptid = ecs->ptid;
/* Ignore threads of processes the caller is not
resuming. */
if (!sched_multi
- && ptid_get_pid (tp->ptid) != ptid_get_pid (ecs->ptid))
+ && tp->ptid.pid () != ecs->ptid.pid ())
continue;
/* When stepping over a breakpoint, we lock all threads
print_exited_reason (struct ui_out *uiout, int exitstatus)
{
struct inferior *inf = current_inferior ();
- const char *pidstr = target_pid_to_str (pid_to_ptid (inf->pid));
+ const char *pidstr = target_pid_to_str (ptid_t (inf->pid));
annotate_exited (exitstatus);
if (exitstatus)