This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
[PATCH] thread-db.c fix
- To: gdb-patches at sources dot redhat dot com
- Subject: [PATCH] thread-db.c fix
- From: Mark Kettenis <kettenis at wins dot uva dot nl>
- Date: Fri, 30 Mar 2001 21:38:17 +0200
The attached patch fixes a problem in thread-db.c:check_event(). See
comment for an explanation of the problem.
Checked in.
Mark
Index: ChangeLog
from Mark Kettenis <kettenis@gnu.org>
* thread-db.c (check_event): Don't report an error if we encounter
a thread creation event for a thread that's already in the thread
list, since that may legitemately happen. Instead only call
attach_thread if it's not already in the thread list.
Index: thread-db.c
===================================================================
RCS file: /cvs/src/src/gdb/thread-db.c,v
retrieving revision 1.5
diff -u -p -r1.5 thread-db.c
--- thread-db.c 2001/03/01 01:39:21 1.5
+++ thread-db.c 2001/03/30 19:35:18
@@ -697,10 +697,11 @@ check_event (int pid)
error ("Thread creation event doesn't match breakpoint.");
#endif
- if (in_thread_list (pid))
- error ("Spurious thread creation event.");
-
- attach_thread (pid, msg.th_p, &ti, 1);
+ /* We may already know about this thread, for instance when the
+ user has issued the `info threads' command before the SIGTRAP
+ for hitting the thread creation breakpoint was reported. */
+ if (! in_thread_list (pid))
+ attach_thread (pid, msg.th_p, &ti, 1);
return;
case TD_DEATH: