+2008-05-15 Pedro Alves <pedro@codesourcery.com>
+
+ * linux-nat.c (trap_ptid): Delete.
+ (linux_nat_detach, linux_nat_wait, linux_nat_mourn_inferior):
+ Adjust.
+ * linux-thread-db.c (thread_db_wait): Adjust.
+
2008-05-15 Joel Brobecker <brobecker@adacore.com>
* linespec.c (decode_line_1): Fix a couple of comments.
static int num_lwps;
\f
-/* If the last reported event was a SIGTRAP, this variable is set to
- the process id of the LWP/thread that got it. */
-ptid_t trap_ptid;
-\f
-
/* Since we cannot wait (in linux_nat_wait) for the initial process and
any cloned processes with a single call to waitpid, we have to use
the WNOHANG flag and call waitpid in a loop. To optimize
target_pid_to_str (lwp_list->ptid));
}
- trap_ptid = null_ptid;
-
/* Destroy LWP info; it's no longer valid. */
init_lwp_list ();
if (WIFSTOPPED (status) && WSTOPSIG (status) == SIGTRAP)
{
- trap_ptid = lp->ptid;
if (debug_linux_nat)
fprintf_unfiltered (gdb_stdlog,
- "LLW: trap_ptid is %s.\n",
- target_pid_to_str (trap_ptid));
+ "LLW: trap ptid is %s.\n",
+ target_pid_to_str (lp->ptid));
}
- else
- trap_ptid = null_ptid;
if (lp->waitstatus.kind != TARGET_WAITKIND_IGNORE)
{
static void
linux_nat_mourn_inferior (void)
{
- trap_ptid = null_ptid;
-
/* Destroy LWP info; it's no longer valid. */
init_lwp_list ();
static ptid_t
thread_db_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
{
- extern ptid_t trap_ptid;
-
ptid = target_beneath->to_wait (ptid, ourstatus);
if (ourstatus->kind == TARGET_WAITKIND_IGNORE)
event gets postponed by other simultaneous events. In such a
case, we want to just ignore the event and continue on. */
- if (!ptid_equal (trap_ptid, null_ptid))
- trap_ptid = thread_from_lwp (trap_ptid);
-
ptid = thread_from_lwp (ptid);
if (GET_PID (ptid) == -1)
ourstatus->kind = TARGET_WAITKIND_SPURIOUS;