• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

GNU Binutils with patches for OS216


Commit MetaInfo

Revisionb3ba1b4442c71e25f857581f47db64cea2687f2e (tree)
Time2003-01-10 04:14:46
AuthorDaniel Jacobowitz <drow@fals...>
CommiterDaniel Jacobowitz

Log Message

* lin-lwp.c (child_wait): Ignore exit statuses for processes other
than inferior_ptid.
(lin_lwp_wait): Ignore exit statuses for unknown LWPs.

Change Summary

Incremental Difference

--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -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+
17 2003-01-09 Andrew Cagney <ac131313@redhat.com>
28
39 * frame.h (frame_obstack_zalloc): Replace frame_obstack_alloc.
--- a/gdb/lin-lwp.c
+++ b/gdb/lin-lwp.c
@@ -1,5 +1,5 @@
11 /* 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.
33
44 This file is part of GDB.
55
@@ -1062,6 +1062,14 @@ child_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
10621062
10631063 save_errno = errno;
10641064
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+
10651073 clear_sigio_trap ();
10661074 clear_sigint_trap ();
10671075 }
@@ -1206,6 +1214,17 @@ lin_lwp_wait (ptid_t ptid, struct target_waitstatus *ourstatus)
12061214 }
12071215
12081216 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+
12091228 if (! lp)
12101229 {
12111230 lp = add_lwp (BUILD_LWP (lwpid, GET_PID (inferior_ptid)));