diff options
author | Michael Snyder <msnyder@vmware.com> | 2001-04-30 18:21:17 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2001-04-30 18:21:17 +0000 |
commit | 540af400154502df8054af624998b03f659f1043 (patch) | |
tree | a5d6f34df91521e01023f08ad1c6f60de49c3057 /gdb/thread-db.c | |
parent | 502dcf4e393a5113e25a9c579df326b2435ef566 (diff) | |
download | gdb-540af400154502df8054af624998b03f659f1043.zip gdb-540af400154502df8054af624998b03f659f1043.tar.gz gdb-540af400154502df8054af624998b03f659f1043.tar.bz2 |
2001-04-30 Michael Snyder <msnyder@redhat.com>
* thread-db.c: Revert 2001-04-26 change for debugging output.
* lin-lwp.c: Ditto.
Diffstat (limited to 'gdb/thread-db.c')
-rw-r--r-- | gdb/thread-db.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/gdb/thread-db.c b/gdb/thread-db.c index 3d5f7b4..e357751 100644 --- a/gdb/thread-db.c +++ b/gdb/thread-db.c @@ -31,16 +31,12 @@ #include "symfile.h" #include "objfiles.h" #include "target.h" -#include "command.h" -#include "gdbcmd.h" #include "regcache.h" #ifndef LIBTHREAD_DB_SO #define LIBTHREAD_DB_SO "libthread_db.so.1" #endif -int debug_linux_threads = 0; /* Set non-zero for debugging output. */ - /* If we're running on Linux, we must explicitly attach to any new threads. */ /* FIXME: There is certainly some room for improvements: @@ -55,7 +51,7 @@ static struct target_ops thread_db_ops; static struct target_ops *target_beneath; /* Pointer to the next function on the objfile event chain. */ -static void (*new_objfile_event_chain) (struct objfile *objfile); +static void (*target_new_objfile_chain) (struct objfile *objfile); /* Non-zero if we're using this module's target vector. */ static int using_thread_db; @@ -592,8 +588,8 @@ thread_db_new_objfile (struct objfile *objfile) } quit: - if (new_objfile_event_chain) - new_objfile_event_chain (objfile); + if (target_new_objfile_chain) + target_new_objfile_chain (objfile); } static void @@ -701,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: @@ -1026,12 +1023,7 @@ _initialize_thread_db (void) add_target (&thread_db_ops); /* Add ourselves to objfile event chain. */ - new_objfile_event_chain = target_new_objfile_hook; + target_new_objfile_chain = target_new_objfile_hook; target_new_objfile_hook = thread_db_new_objfile; } - add_show_from_set (add_set_cmd ("debug-linux-threads", class_support, - var_boolean, (char *) &debug_linux_threads, - "Set debug output for linux-threads \ -on or off.\nUse \"on\" to enable, \"off\" to disable.", &setlist), - &showlist); } |