else
{
linux_nat_debug_printf ("PTRACE_ATTACH %s, 0, 0 (OK)",
- target_pid_to_str (ptid).c_str ());
+ ptid.to_string ().c_str ());
lp = add_lwp (ptid);
if (signo == GDB_SIGNAL_0)
{
linux_nat_debug_printf ("lwp %s has no pending signal",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
}
else if (!signal_pass_state (signo))
{
linux_nat_debug_printf
("lwp %s had signal %s but it is in no pass state",
- target_pid_to_str (lp->ptid).c_str (), gdb_signal_to_string (signo));
+ lp->ptid.to_string ().c_str (), gdb_signal_to_string (signo));
}
else
{
linux_nat_debug_printf ("lwp %s has pending signal %s",
- target_pid_to_str (lp->ptid).c_str (),
+ lp->ptid.to_string ().c_str (),
gdb_signal_to_string (signo));
return gdb_signal_to_host (signo);
if (lp->status != 0)
linux_nat_debug_printf ("Pending %s for %s on detach.",
strsignal (WSTOPSIG (lp->status)),
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
/* If there is a pending SIGSTOP, get rid of it. */
if (lp->signalled)
{
linux_nat_debug_printf ("Sending SIGCONT to %s",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
kill_lwp (lwpid, SIGCONT);
lp->signalled = 0;
if (inf->vfork_child != NULL)
{
linux_nat_debug_printf ("Not resuming %s (vfork parent)",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
}
else if (!lwp_status_pending_p (lp))
{
linux_nat_debug_printf ("Resuming sibling %s, %s, %s",
- target_pid_to_str (lp->ptid).c_str (),
+ lp->ptid.to_string ().c_str (),
(signo != GDB_SIGNAL_0
? strsignal (gdb_signal_to_host (signo))
: "0"),
else
{
linux_nat_debug_printf ("Not resuming sibling %s (has pending)",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
}
}
else
linux_nat_debug_printf ("Not resuming sibling %s (not stopped)",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
}
/* Callback for iterate_over_lwps. If LWP is EXCEPT, do nothing.
linux_nat_debug_printf ("Preparing to %s %s, %s, inferior_ptid %s",
step ? "step" : "resume",
- target_pid_to_str (ptid).c_str (),
+ ptid.to_string ().c_str (),
(signo != GDB_SIGNAL_0
? strsignal (gdb_signal_to_host (signo)) : "0"),
- target_pid_to_str (inferior_ptid).c_str ());
+ inferior_ptid.to_string ().c_str ());
/* A specific PTID means `step only this process id'. */
resume_many = (minus_one_ptid == ptid
linux_nat_debug_printf ("%s %s, %s (resume event thread)",
step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
- target_pid_to_str (lp->ptid).c_str (),
+ lp->ptid.to_string ().c_str (),
(signo != GDB_SIGNAL_0
? strsignal (gdb_signal_to_host (signo)) : "0"));
the top of the file. */
thread_dead = 1;
linux_nat_debug_printf ("%s vanished.",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
}
if (pid != 0)
break;
{
thread_dead = 1;
linux_nat_debug_printf ("Thread group leader %s vanished.",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
break;
}
gdb_assert (pid == lp->ptid.lwp ());
linux_nat_debug_printf ("waitpid %s received %s",
- target_pid_to_str (lp->ptid).c_str (),
+ lp->ptid.to_string ().c_str (),
status_to_str (status).c_str ());
/* Check if the thread has exited. */
thread_dead = 1;
linux_nat_debug_printf ("%s exited.",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
}
}
int ret;
linux_nat_debug_printf ("kill %s **<SIGSTOP>**",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
errno = 0;
ret = kill_lwp (lp->ptid.lwp (), SIGSTOP);
if (!linux_nat_has_pending_sigint (lp->ptid.lwp ()))
{
linux_nat_debug_printf ("Clearing bogus flag for %s",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
lp->ignore_sigint = 0;
}
}
lp->stopped = 0;
linux_nat_debug_printf
("PTRACE_CONT %s, 0, 0 (%s) (discarding SIGINT)",
- target_pid_to_str (lp->ptid).c_str (),
+ lp->ptid.to_string ().c_str (),
errno ? safe_strerror (errno) : "OK");
return stop_wait_callback (lp);
linux_nat_debug_printf ("Pending event %s in %s",
status_to_str ((int) status).c_str (),
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
/* Save the sigtrap event. */
lp->status = status;
/* We caught the SIGSTOP that we intended to catch. */
linux_nat_debug_printf ("Expected SIGSTOP caught for %s.",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
lp->signalled = 0;
if (pc != lp->stop_pc)
{
linux_nat_debug_printf ("PC of %s changed. was=%s, now=%s",
- target_pid_to_str (lp->ptid).c_str (),
+ lp->ptid.to_string ().c_str (),
paddress (target_gdbarch (), lp->stop_pc),
paddress (target_gdbarch (), pc));
discard = 1;
else if (!breakpoint_inserted_here_p (regcache->aspace (), pc))
{
linux_nat_debug_printf ("previous breakpoint of %s, at %s gone",
- target_pid_to_str (lp->ptid).c_str (),
+ lp->ptid.to_string ().c_str (),
paddress (target_gdbarch (), lp->stop_pc));
discard = 1;
if (discard)
{
linux_nat_debug_printf ("pending event of %s cancelled.",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
lp->status = 0;
linux_resume_one_lwp (lp, lp->step, GDB_SIGNAL_0);
else if (siginfo.si_code == TRAP_TRACE)
{
linux_nat_debug_printf ("%s stopped by trace",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
/* We may have single stepped an instruction that
triggered a watchpoint. In that case, on some
if (lp->stop_reason == TARGET_STOPPED_BY_SW_BREAKPOINT)
{
linux_nat_debug_printf ("%s stopped by software breakpoint",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
/* Back up the PC if necessary. */
if (pc != sw_bp_pc)
else if (lp->stop_reason == TARGET_STOPPED_BY_HW_BREAKPOINT)
{
linux_nat_debug_printf ("%s stopped by hardware breakpoint",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
}
else if (lp->stop_reason == TARGET_STOPPED_BY_WATCHPOINT)
{
linux_nat_debug_printf ("%s stopped by hardware watchpoint",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
}
lp->stop_pc = pc;
if (event_lp != NULL)
{
linux_nat_debug_printf ("Select single-step %s",
- target_pid_to_str (event_lp->ptid).c_str ());
+ event_lp->ptid.to_string ().c_str ());
}
}
&& num_lwps (lp->ptid.pid ()) > 1)
{
linux_nat_debug_printf ("%s exited.",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
/* If there is at least one more LWP, then the exit signal
was not the end of the debugged application and should be
if (lp->last_resume_kind == resume_stop)
{
linux_nat_debug_printf ("resume_stop SIGSTOP caught for %s.",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
}
else
{
linux_nat_debug_printf
("%s %s, 0, 0 (discard delayed SIGSTOP)",
lp->step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
linux_resume_one_lwp (lp, lp->step, GDB_SIGNAL_0);
gdb_assert (lp->resumed);
&& WIFSTOPPED (status) && WSTOPSIG (status) == SIGINT)
{
linux_nat_debug_printf ("Delayed SIGINT caught for %s.",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
/* This is a delayed SIGINT. */
lp->ignore_sigint = 0;
linux_resume_one_lwp (lp, lp->step, GDB_SIGNAL_0);
linux_nat_debug_printf ("%s %s, 0, 0 (discard SIGINT)",
lp->step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
gdb_assert (lp->resumed);
/* Discard the event. */
linux_nat_debug_printf
("%s %s, %s (preempt 'handle')",
lp->step ? "PTRACE_SINGLESTEP" : "PTRACE_CONT",
- target_pid_to_str (lp->ptid).c_str (),
+ lp->ptid.to_string ().c_str (),
(signo != GDB_SIGNAL_0
? strsignal (gdb_signal_to_host (signo)) : "0"));
return;
{
linux_nat_debug_printf ("Using pending wait status %s for %s.",
status_to_str (lp->status).c_str (),
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
}
/* But if we don't find a pending event, we'll have to wait. Always
if (linux_target->low_status_is_event (status))
{
linux_nat_debug_printf ("trap ptid is %s.",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
}
if (lp->waitstatus.kind () != TARGET_WAITKIND_IGNORE)
if (!lp->stopped)
{
linux_nat_debug_printf ("NOT resuming LWP %s, not stopped",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
}
else if (!lp->resumed)
{
linux_nat_debug_printf ("NOT resuming LWP %s, not resumed",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
}
else if (lwp_status_pending_p (lp))
{
linux_nat_debug_printf ("NOT resuming LWP %s, has pending status",
- target_pid_to_str (lp->ptid).c_str ());
+ lp->ptid.to_string ().c_str ());
}
else
{
{
linux_nat_debug_printf
("resuming stopped-resumed LWP %s at %s: step=%d",
- target_pid_to_str (lp->ptid).c_str (), paddress (gdbarch, pc),
+ lp->ptid.to_string ().c_str (), paddress (gdbarch, pc),
lp->step);
linux_resume_one_lwp_throw (lp, lp->step, GDB_SIGNAL_0);
{
ptid_t event_ptid;
- linux_nat_debug_printf ("[%s], [%s]", target_pid_to_str (ptid).c_str (),
+ linux_nat_debug_printf ("[%s], [%s]", ptid.to_string ().c_str (),
target_options_to_string (target_options).c_str ());
/* Flush the async file first. */
if (!lwp->stopped)
{
linux_nat_debug_printf ("running -> suspending %s",
- target_pid_to_str (lwp->ptid).c_str ());
+ lwp->ptid.to_string ().c_str ());
if (lwp->last_resume_kind == resume_stop)
{
if (find_thread_ptid (linux_target, lwp->ptid)->stop_requested)
linux_nat_debug_printf ("already stopped/stop_requested %s",
- target_pid_to_str (lwp->ptid).c_str ());
+ lwp->ptid.to_string ().c_str ());
else
linux_nat_debug_printf ("already stopped/no stop_requested yet %s",
- target_pid_to_str (lwp->ptid).c_str ());
+ lwp->ptid.to_string ().c_str ());
}
}
return 0;
struct btrace_thread_info *btinfo;
DEBUG ("resuming thread %s (%s): %x (%s)", print_thread_id (tp),
- target_pid_to_str (tp->ptid).c_str (), flag,
+ tp->ptid.to_string ().c_str (), flag,
btrace_thread_flag_to_str (flag));
btinfo = &tp->btrace;
{
enum btrace_thread_flag flag, cflag;
- DEBUG ("resume %s: %s%s", target_pid_to_str (ptid).c_str (),
+ DEBUG ("resume %s: %s%s", ptid.to_string ().c_str (),
::execution_direction == EXEC_REVERSE ? "reverse-" : "",
step ? "step" : "cont");
DEBUG ("cancel resume thread %s (%s): %x (%s)",
print_thread_id (tp),
- target_pid_to_str (tp->ptid).c_str (), flags.raw (),
+ tp->ptid.to_string ().c_str (), flags.raw (),
btrace_thread_flag_to_str (flags));
tp->btrace.flags &= ~(BTHR_MOVE | BTHR_STOP);
btinfo->flags &= ~(BTHR_MOVE | BTHR_STOP);
DEBUG ("stepping thread %s (%s): %x (%s)", print_thread_id (tp),
- target_pid_to_str (tp->ptid).c_str (), flags.raw (),
+ tp->ptid.to_string ().c_str (), flags.raw (),
btrace_thread_flag_to_str (flags));
/* We can't step without an execution history. */
/* Clear this, if needed we'll re-mark it below. */
clear_async_event_handler (record_btrace_async_inferior_event_handler);
- DEBUG ("wait %s (0x%x)", target_pid_to_str (ptid).c_str (),
+ DEBUG ("wait %s (0x%x)", ptid.to_string ().c_str (),
(unsigned) options);
/* As long as we're not replaying, just forward the request. */
{
*status = btrace_step_no_resumed ();
- DEBUG ("wait ended by %s: %s", target_pid_to_str (null_ptid).c_str (),
+ DEBUG ("wait ended by %s: %s", null_ptid.to_string ().c_str (),
status->to_string ().c_str ());
return null_ptid;
DEBUG ("wait ended by thread %s (%s): %s",
print_thread_id (eventing),
- target_pid_to_str (eventing->ptid).c_str (),
+ eventing->ptid.to_string ().c_str (),
status->to_string ().c_str ());
return eventing->ptid;
void
record_btrace_target::stop (ptid_t ptid)
{
- DEBUG ("stop %s", target_pid_to_str (ptid).c_str ());
+ DEBUG ("stop %s", ptid.to_string ().c_str ());
/* As long as we're not replaying, just forward the request. */
if ((::execution_direction != EXEC_REVERSE)