OSDN Git Service

* thread-db.c (check_event): Don't report an error if we encounter
authorMark Kettenis <kettenis@gnu.org>
Fri, 30 Mar 2001 19:36:35 +0000 (19:36 +0000)
committerMark Kettenis <kettenis@gnu.org>
Fri, 30 Mar 2001 19:36:35 +0000 (19:36 +0000)
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.

gdb/ChangeLog
gdb/thread-db.c

index 62487dd..41a4daa 100644 (file)
@@ -1,3 +1,10 @@
+2001-03-30  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.
+
 2001-03-28  Andrew Cagney  <ac131313@redhat.com>
 
        * config/pa/xm-hppah.h (malloc): Really delete declaration
index 70283d0..956d0d8 100644 (file)
@@ -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: