+2003-01-09 Daniel Jacobowitz <drow@mvista.com>
+
+ * lin-lwp.c (child_wait): Ignore exit statuses for processes other
+ than inferior_ptid.
+ (lin_lwp_wait): Ignore exit statuses for unknown LWPs.
+
2003-01-09 Andrew Cagney <ac131313@redhat.com>
* frame.h (frame_obstack_zalloc): Replace frame_obstack_alloc.
/* Multi-threaded debugging support for GNU/Linux (LWP layer).
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GDB.
save_errno = errno;
+ /* Make sure we don't report an event for the exit of the
+ original program, if we've detached from it. */
+ if (pid != -1 && ! WIFSTOPPED (status) && pid != GET_PID (inferior_ptid))
+ {
+ pid = -1;
+ save_errno = EINTR;
+ }
+
clear_sigio_trap ();
clear_sigint_trap ();
}
}
lp = find_lwp_pid (pid_to_ptid (lwpid));
+
+ /* Make sure we don't report an event for the exit of an LWP not in
+ our list, i.e. not part of the current process. This can happen
+ if we detach from a program we original forked and then it
+ exits. */
+ if (! WIFSTOPPED (status) && ! lp)
+ {
+ status = 0;
+ continue;
+ }
+
if (! lp)
{
lp = add_lwp (BUILD_LWP (lwpid, GET_PID (inferior_ptid)));