summaryrefslogtreecommitdiff
path: root/gdb/thread-db.c
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2001-03-30 19:36:35 +0000
committerMark Kettenis <kettenis@gnu.org>2001-03-30 19:36:35 +0000
commit95a856212b2220f94f87145e5f0bc1c64ecb79dd (patch)
tree1026f84d9fdb1110609b7670e6d5d65fcc7f545f /gdb/thread-db.c
parent5fba8300571683b3d2db0f11a0c8522016df24f9 (diff)
downloadbinutils-gdb-95a856212b2220f94f87145e5f0bc1c64ecb79dd.tar.gz
* 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.
Diffstat (limited to 'gdb/thread-db.c')
-rw-r--r--gdb/thread-db.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/gdb/thread-db.c b/gdb/thread-db.c
index 70283d07963..956d0d813b7 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: