From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mark Kettenis To: gdb-patches@sources.redhat.com Subject: [PATCH] thread-db.c fix Date: Fri, 30 Mar 2001 11:38:00 -0000 Message-id: <200103301938.f2UJcHl03879@delius.kettenis.local> X-SW-Source: 2001-03/msg00557.html 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 * 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: