From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15568 invoked by alias); 25 Jul 2013 18:25:36 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 15556 invoked by uid 89); 25 Jul 2013 18:25:35 -0000 X-Spam-SWARE-Status: No, score=-5.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,RDNS_NONE,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.1 Received: from Unknown (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Thu, 25 Jul 2013 18:25:34 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r6PIPOFX011979 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 25 Jul 2013 14:25:24 -0400 Received: from barimba (ovpn-113-128.phx2.redhat.com [10.3.113.128]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r6PIPMaA032211 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Thu, 25 Jul 2013 14:25:23 -0400 From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org, Ulrich Weigand Subject: Re: RFC: don't call add_target for thread_db_ops References: <1372783053-14925-1-git-send-email-tromey@redhat.com> <51D3E4CB.3060801@redhat.com> <87ehamwwtq.fsf@fleche.redhat.com> <51F13898.2050700@redhat.com> <87ppu6vbxx.fsf@fleche.redhat.com> <51F1581D.4080008@redhat.com> Date: Thu, 25 Jul 2013 18:25:00 -0000 In-Reply-To: <51F1581D.4080008@redhat.com> (Pedro Alves's message of "Thu, 25 Jul 2013 17:53:49 +0100") Message-ID: <87li4uv6nh.fsf@fleche.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-07/txt/msg00627.txt.bz2 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