From: Tom Tromey <tromey@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches@sourceware.org, Ulrich Weigand <uweigand@de.ibm.com>
Subject: Re: RFC: don't call add_target for thread_db_ops
Date: Thu, 25 Jul 2013 18:25:00 -0000 [thread overview]
Message-ID: <87li4uv6nh.fsf@fleche.redhat.com> (raw)
In-Reply-To: <51F1581D.4080008@redhat.com> (Pedro Alves's message of "Thu, 25 Jul 2013 17:53:49 +0100")
Pedro> On 07/25/2013 05:31 PM, Tom Tromey wrote:
Pedro> Thanks. Do you plan on doing the same to the remaining
Pedro> thread_stratum targets? If not, I'll do it at some point.
Pedro> I'd prefer not leaving the incomplete transition in
Pedro> place; it's bound to confuse someone later on. I wouldn't
Pedro> worry much if an affected target goes untested.
Tom> I wasn't planning to, but my main concern was the testing; I will write
Tom> the patch today.
Pedro> Thanks!
Here you go.
Tom
This removes a few more erroneous calls to add_target. These calls
end up installing the target in a user-visible way; but these targets
are all auto-activated and, I think, should never be explicitly
requested.
I have no way to test these.
CCing Ulrich for the SPU case.
* aix-thread.c (_initialize_aix_thread): Use
complete_target_initialization.
* bsd-uthread.c (_initialize_bsd_uthread): Use
complete_target_initialization.
* dec-thread.c (_initialize_dec_thread): Use
complete_target_initialization.
* ravenscar-thread.c (_initialize_ravenscar): Use
complete_target_initialization.
* sol-thread.c (_initialize_sol_thread): Use
complete_target_initialization.
* spu-multiarch.c (_initialize_spu_multiarch): Use
complete_target_initialization.
---
gdb/aix-thread.c | 2 +-
gdb/bsd-uthread.c | 2 +-
gdb/dec-thread.c | 2 +-
gdb/ravenscar-thread.c | 2 +-
gdb/sol-thread.c | 2 +-
gdb/spu-multiarch.c | 2 +-
6 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gdb/aix-thread.c b/gdb/aix-thread.c
index fd1d69b..70f9a3e 100644
--- a/gdb/aix-thread.c
+++ b/gdb/aix-thread.c
@@ -1837,7 +1837,7 @@ void
_initialize_aix_thread (void)
{
init_aix_thread_ops ();
- add_target (&aix_thread_ops);
+ complete_target_initialization (&aix_thread_ops);
/* Notice when object files get loaded and unloaded. */
observer_attach_new_objfile (new_objfile);
diff --git a/gdb/bsd-uthread.c b/gdb/bsd-uthread.c
index 6a07985..0a2ea81 100644
--- a/gdb/bsd-uthread.c
+++ b/gdb/bsd-uthread.c
@@ -547,7 +547,7 @@ extern initialize_file_ftype _initialize_bsd_uthread;
void
_initialize_bsd_uthread (void)
{
- add_target (bsd_uthread_target ());
+ complete_target_initialization (bsd_uthread_target ());
bsd_uthread_data = gdbarch_data_register_pre_init (bsd_uthread_init);
diff --git a/gdb/dec-thread.c b/gdb/dec-thread.c
index 27cf004..f07721d 100644
--- a/gdb/dec-thread.c
+++ b/gdb/dec-thread.c
@@ -727,7 +727,7 @@ void
_initialize_dec_thread (void)
{
init_dec_thread_ops ();
- add_target (&dec_thread_ops);
+ complete_target_initialization (&dec_thread_ops);
observer_attach_new_objfile (dec_thread_new_objfile_observer);
diff --git a/gdb/ravenscar-thread.c b/gdb/ravenscar-thread.c
index 0a3100d..26b8171 100644
--- a/gdb/ravenscar-thread.c
+++ b/gdb/ravenscar-thread.c
@@ -433,7 +433,7 @@ _initialize_ravenscar (void)
ravenscar ops if needed. */
observer_attach_inferior_created (ravenscar_inferior_created);
- add_target (&ravenscar_ops);
+ complete_target_initialization (&ravenscar_ops);
add_prefix_cmd ("ravenscar", no_class, set_ravenscar_command,
_("Prefix command for changing Ravenscar-specific settings"),
diff --git a/gdb/sol-thread.c b/gdb/sol-thread.c
index f1b29a0..c9abaf7 100644
--- a/gdb/sol-thread.c
+++ b/gdb/sol-thread.c
@@ -1276,7 +1276,7 @@ _initialize_sol_thread (void)
resolve (td_thr_getgregs);
resolve (td_thr_setgregs);
- add_target (&sol_thread_ops);
+ complete_target_initialization (&sol_thread_ops);
add_cmd ("sol-threads", class_maintenance, info_solthreads,
_("Show info on Solaris user threads."), &maintenanceinfolist);
diff --git a/gdb/spu-multiarch.c b/gdb/spu-multiarch.c
index a74bd30..e93f142 100644
--- a/gdb/spu-multiarch.c
+++ b/gdb/spu-multiarch.c
@@ -410,7 +410,7 @@ _initialize_spu_multiarch (void)
{
/* Install ourselves on the target stack. */
init_spu_ops ();
- add_target (&spu_ops);
+ complete_target_initialization (&spu_ops);
/* Install observers to watch for SPU objects. */
observer_attach_inferior_created (spu_multiarch_inferior_created);
--
1.8.1.4
next prev parent reply other threads:[~2013-07-25 18:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-02 16:37 Tom Tromey
2013-07-03 8:46 ` Pedro Alves
2013-07-25 14:14 ` Tom Tromey
2013-07-25 14:39 ` Pedro Alves
2013-07-25 16:31 ` Tom Tromey
2013-07-25 16:53 ` Pedro Alves
2013-07-25 18:25 ` Tom Tromey [this message]
2013-07-26 15:23 ` Ulrich Weigand
2013-08-05 16:52 ` Tom Tromey
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87li4uv6nh.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
--cc=uweigand@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox