return lp->ptid.pid () == lp->ptid.lwp ();
}
+/* Convert an LWP's pending status to a std::string. */
+
+static std::string
+pending_status_str (lwp_info *lp)
+{
+ gdb_assert (lwp_status_pending_p (lp));
+
+ if (lp->waitstatus.kind () != TARGET_WAITKIND_IGNORE)
+ return lp->waitstatus.to_string ();
+ else
+ return status_to_str (lp->status);
+}
+
\f
/* LWP accessors. */
this thread with a signal? */
gdb_assert (signo == GDB_SIGNAL_0);
- linux_nat_debug_printf ("Short circuiting for status 0x%x",
- lp->status);
+ linux_nat_debug_printf ("Short circuiting for status %s",
+ pending_status_str (lp).c_str ());
if (target_can_async_p ())
{
if (lp != NULL)
{
linux_nat_debug_printf ("Using pending wait status %s for %s.",
- status_to_str (lp->status).c_str (),
+ pending_status_str (lp).c_str (),
lp->ptid.to_string ().c_str ());
}
/* The last resume GDB requested on this thread. */
resume_kind last_resume_kind = resume_continue;
- /* If non-zero, a pending wait status. */
+ /* If non-zero, a pending wait status. A pending process exit is
+ recorded in WAITSTATUS, because W_EXITCODE(0,0) happens to be
+ 0. */
int status = 0;
/* When 'stopped' is set, this is where the lwp last stopped, with
/* Non-zero if we expect a duplicated SIGINT. */
int ignore_sigint = 0;
- /* If WAITSTATUS->KIND != TARGET_WAITKIND_SPURIOUS, the waitstatus
- for this LWP's last event. This may correspond to STATUS above,
- or to a local variable in lin_lwp_wait. */
+ /* If WAITSTATUS->KIND != TARGET_WAITKIND_IGNORE, the waitstatus for
+ this LWP's last event. This usually corresponds to STATUS above,
+ however because W_EXITCODE(0,0) happens to be 0, a process exit
+ will be recorded here, while 'status == 0' is ambiguous. */
struct target_waitstatus waitstatus;
/* Signal whether we are in a SYSCALL_ENTRY or