GNU Binutils with patches for OS216
Revision | b3ba1b4442c71e25f857581f47db64cea2687f2e (tree) |
---|---|
Time | 2003-01-10 04:14:46 |
Author | Daniel Jacobowitz <drow@fals...> |
Commiter | Daniel Jacobowitz |
* lin-lwp.c (child_wait): Ignore exit statuses for processes other
than inferior_ptid.
(lin_lwp_wait): Ignore exit statuses for unknown LWPs.
@@ -1,3 +1,9 @@ | ||
1 | +2003-01-09 Daniel Jacobowitz <drow@mvista.com> | |
2 | + | |
3 | + * lin-lwp.c (child_wait): Ignore exit statuses for processes other | |
4 | + than inferior_ptid. | |
5 | + (lin_lwp_wait): Ignore exit statuses for unknown LWPs. | |
6 | + | |
1 | 7 | 2003-01-09 Andrew Cagney <ac131313@redhat.com> |
2 | 8 | |
3 | 9 | * frame.h (frame_obstack_zalloc): Replace frame_obstack_alloc. |
@@ -1,5 +1,5 @@ | ||
1 | 1 | /* Multi-threaded debugging support for GNU/Linux (LWP layer). |
2 | - Copyright 2000, 2001 Free Software Foundation, Inc. | |
2 | + Copyright 2000, 2001, 2002, 2003 Free Software Foundation, Inc. | |
3 | 3 | |
4 | 4 | This file is part of GDB. |
5 | 5 |
@@ -1062,6 +1062,14 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus) | ||
1062 | 1062 | |
1063 | 1063 | save_errno = errno; |
1064 | 1064 | |
1065 | + /* Make sure we don't report an event for the exit of the | |
1066 | + original program, if we've detached from it. */ | |
1067 | + if (pid != -1 && ! WIFSTOPPED (status) && pid != GET_PID (inferior_ptid)) | |
1068 | + { | |
1069 | + pid = -1; | |
1070 | + save_errno = EINTR; | |
1071 | + } | |
1072 | + | |
1065 | 1073 | clear_sigio_trap (); |
1066 | 1074 | clear_sigint_trap (); |
1067 | 1075 | } |
@@ -1206,6 +1214,17 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus) | ||
1206 | 1214 | } |
1207 | 1215 | |
1208 | 1216 | lp = find_lwp_pid (pid_to_ptid (lwpid)); |
1217 | + | |
1218 | + /* Make sure we don't report an event for the exit of an LWP not in | |
1219 | + our list, i.e. not part of the current process. This can happen | |
1220 | + if we detach from a program we original forked and then it | |
1221 | + exits. */ | |
1222 | + if (! WIFSTOPPED (status) && ! lp) | |
1223 | + { | |
1224 | + status = 0; | |
1225 | + continue; | |
1226 | + } | |
1227 | + | |
1209 | 1228 | if (! lp) |
1210 | 1229 | { |
1211 | 1230 | lp = add_lwp (BUILD_LWP (lwpid, GET_PID (inferior_ptid))); |