From 6b9aa0c1adaefdd9a212b2982da55c3f2b2a4111 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Fri, 30 Mar 2001 19:36:35 +0000 Subject: [PATCH] * 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. --- gdb/ChangeLog | 7 +++++++ gdb/thread-db.c | 9 +++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 62487dd23f..41a4daa7f4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2001-03-30 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. + 2001-03-28 Andrew Cagney * config/pa/xm-hppah.h (malloc): Really delete declaration diff --git a/gdb/thread-db.c b/gdb/thread-db.c index 70283d0796..956d0d813b 100644 --- a/gdb/thread-db.c +++ b/gdb/thread-db.c @@ -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: -- 2.11.0