diff options
author | Tom Tromey <tromey@redhat.com> | 2013-07-25 14:28:14 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-07-25 14:28:14 +0000 |
commit | 56f4fed4c8ec7ea80656cecac20f5077f08a5854 (patch) | |
tree | 86d372a98adc97e02768d1beafa9ca1b28ef6c62 /gdb/linux-thread-db.c | |
parent | e73fd3d4b8b7c697660398b913e3898044e1fe5f (diff) | |
download | gdb-56f4fed4c8ec7ea80656cecac20f5077f08a5854.tar.gz |
don't call add_target for thread_db_ops
Right now, "help target" will include this line:
target multi-thread -- Threads and pthreads support
However, it doesn't make sense to invoke "target multi-thread".
This patch fixes the problem by not registering the multi-thread
target. add_target does some needed initialization of the target_ops,
so I broke this out into a new function.
It isn't clear to me whether this patch requires a test case or not.
I'm not sure whether there are other unregistered targets; but if
there are, it seems unlikely that we test for their absence from the
help.
Built and regtested on x86-64 Fedora 18.
* linux-thread-db.c (init_thread_db_ops): Call
complete_target_initialization.
(_initialize_thread_db): Don't call add_target.
* target.c (complete_target_initialization): New function.
(add_target_with_completer): Call it.
* target.h (complete_target_initialization): Declare.
Diffstat (limited to 'gdb/linux-thread-db.c')
-rw-r--r-- | gdb/linux-thread-db.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/linux-thread-db.c b/gdb/linux-thread-db.c index 23c29c9dd1d..36968272c07 100644 --- a/gdb/linux-thread-db.c +++ b/gdb/linux-thread-db.c @@ -2057,6 +2057,8 @@ init_thread_db_ops (void) thread_db_ops.to_extra_thread_info = thread_db_extra_thread_info; thread_db_ops.to_get_ada_task_ptid = thread_db_get_ada_task_ptid; thread_db_ops.to_magic = OPS_MAGIC; + + complete_target_initialization (&thread_db_ops); } /* Provide a prototype to silence -Wmissing-prototypes. */ @@ -2066,7 +2068,6 @@ void _initialize_thread_db (void) { init_thread_db_ops (); - add_target (&thread_db_ops); /* Defer loading of libthread_db.so until inferior is running. This allows gdb to load correct libthread_db for a given |