From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18512 invoked by alias); 16 Jan 2014 17:33:46 -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 18500 invoked by uid 89); 16 Jan 2014 17:33:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 16 Jan 2014 17:33:45 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0GHXhqn030830 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 16 Jan 2014 12:33:43 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s0GHXfmC008669; Thu, 16 Jan 2014 12:33:42 -0500 Message-ID: <52D817F5.6060303@redhat.com> Date: Thu, 16 Jan 2014 17:33:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: [RFC 00/32] clean up target delegation References: <1389640367-5571-1-git-send-email-tromey@redhat.com> <52D6852E.6080400@redhat.com> <87wqi1rzrn.fsf@fleche.redhat.com> <87r489ovt3.fsf@fleche.redhat.com> In-Reply-To: <87r489ovt3.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-01/txt/msg00628.txt.bz2 On 01/15/2014 08:05 PM, Tom Tromey wrote: > Tom> I started implementing the easy bits but then I realized that the debug > Tom> target puts a wrinkle into this. For instance, inheriting to_shortname > Tom> is needed when target debug is active. > > I did go ahead and write the appended, which removes the calls that > truly aren't needed. Excellent. Thanks. For the archives, last night I updated my deprecated_xfer_memory removal branch (in github), rebasing on top of Tom's. After that, de_fault is gone. > > Tom > > commit b15ac78fa8b7c50df3eae348871c0e0d2e231199 > Author: Tom Tromey > Date: Wed Jan 15 12:58:50 2014 -0700 > > remove some calls to INHERIT and de_fault > > This removes a few unnecessary calls to INHERIT and de_fault: > > * to_doc is only used when a target is registered > * to_magic is only used when a target is pushed and not useful for > current_target. > * to_open and to_close are only ever called using a specific > target_ops object; there is no need to de_fault them. > > 2014-01-15 Tom Tromey > > * target.c (update_current_target): Do not INHERIT to_doc or > to_magic. Do not de_fault to_open or to_close. > > diff --git a/gdb/ChangeLog b/gdb/ChangeLog > index 7a1b817..f4c9923 100644 > --- a/gdb/ChangeLog > +++ b/gdb/ChangeLog > @@ -1,5 +1,10 @@ > 2014-01-15 Tom Tromey > > + * target.c (update_current_target): Do not INHERIT to_doc or > + to_magic. Do not de_fault to_open or to_close. > + > +2014-01-15 Tom Tromey > + > * gcore.h (objfile_find_memory_regions): Declare. > * gcore.c (objfile_find_memory_regions): No longer static. Add > "self" argument. > diff --git a/gdb/target.c b/gdb/target.c > index 44e2490..f121e91 100644 > --- a/gdb/target.c > +++ b/gdb/target.c > @@ -604,13 +604,11 @@ update_current_target (void) > { > INHERIT (to_shortname, t); > INHERIT (to_longname, t); > - INHERIT (to_doc, t); > INHERIT (to_attach_no_wait, t); > INHERIT (deprecated_xfer_memory, t); > INHERIT (to_have_steppable_watchpoint, t); > INHERIT (to_have_continuable_watchpoint, t); > INHERIT (to_has_thread_control, t); > - INHERIT (to_magic, t); > } > #undef INHERIT > > @@ -622,12 +620,6 @@ update_current_target (void) > if (!current_target.field) \ > current_target.field = value > > - de_fault (to_open, > - (void (*) (char *, int)) > - tcomplain); > - de_fault (to_close, > - (void (*) (struct target_ops *)) > - target_ignore); > de_fault (deprecated_xfer_memory, > (int (*) (CORE_ADDR, gdb_byte *, int, int, > struct mem_attrib *, struct target_ops *)) > -- Pedro Alves