aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.h
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2013-07-25 14:28:15 +0000
committerTom Tromey <tromey@redhat.com>2013-07-25 14:28:15 +0000
commitc22a2b88fe63d857110e9c86f3775e55197c9a04 (patch)
tree4b5febcd2b0fa3f5eaaf1e4cd62287f6cdca8509 /gdb/target.h
parentcbb6aada97409ccf45cdc24ef7f7e464906ada9a (diff)
downloadgdb-c22a2b88fe63d857110e9c86f3775e55197c9a04.zip
gdb-c22a2b88fe63d857110e9c86f3775e55197c9a04.tar.gz
gdb-c22a2b88fe63d857110e9c86f3775e55197c9a04.tar.bz2
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/target.h')
-rw-r--r--gdb/target.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/gdb/target.h b/gdb/target.h
index e413e55..1cf198f 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1747,6 +1747,9 @@ int target_verify_memory (const gdb_byte *data,
/* Routines for maintenance of the target structures...
+ complete_target_initialization: Finalize a target_ops by filling in
+ any fields needed by the target implementation.
+
add_target: Add a target to the list of all possible targets.
push_target: Make this target the top of the stack of currently used
@@ -1765,6 +1768,8 @@ extern void add_target (struct target_ops *);
extern void add_target_with_completer (struct target_ops *t,
completer_ftype *completer);
+extern void complete_target_initialization (struct target_ops *t);
+
/* Adds a command ALIAS for target T and marks it deprecated. This is useful
for maintaining backwards compatibility when renaming targets. */