From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 352 invoked by alias); 15 Jan 2014 20:05:23 -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 338 invoked by uid 89); 15 Jan 2014 20:05:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.1 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; Wed, 15 Jan 2014 20:05:22 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s0FK5EWo005744 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 15 Jan 2014 15:05:14 -0500 Received: from barimba (ovpn-113-85.phx2.redhat.com [10.3.113.85]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s0FK5CYk021885 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 15 Jan 2014 15:05:13 -0500 From: Tom Tromey To: Pedro Alves 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> Date: Wed, 15 Jan 2014 20:05:00 -0000 In-Reply-To: <87wqi1rzrn.fsf@fleche.redhat.com> (Tom Tromey's message of "Wed, 15 Jan 2014 09:11:24 -0700") Message-ID: <87r489ovt3.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: 2014-01/txt/msg00559.txt.bz2 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. 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 *))