From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4102 invoked by alias); 17 Jul 2014 16:51:17 -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 4091 invoked by uid 89); 17 Jul 2014 16:51:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 17 Jul 2014 16:51:14 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6HGpCkA027318 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 17 Jul 2014 12:51:13 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6HGkLof009884; Thu, 17 Jul 2014 12:46:22 -0400 Message-ID: <53C7FDDD.1090805@redhat.com> Date: Thu, 17 Jul 2014 16:52:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: [RFC] auto-generate most target debug methods References: <1403208237-27023-1-git-send-email-tromey@redhat.com> <53C5042B.6080406@redhat.com> <87sim1z71y.fsf@fleche.redhat.com> <53C7E1D8.7060808@redhat.com> <87k37cx996.fsf@fleche.redhat.com> <53C7F7A8.8040505@redhat.com> <87d2d4x7ju.fsf@fleche.redhat.com> In-Reply-To: <87d2d4x7ju.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-07/txt/msg00481.txt.bz2 On 07/17/2014 05:40 PM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > >>> have extra arguments (I happened to see target_get_section_table). > > Pedro> Hmm, I think you might have looked at some other method. That > Pedro> one's arguments seem to match. > > Sorry, I wasn't totally clear. > That particular function takes a target_ops parameter -- but generally > the target_* entry points do not. Ah. > > Pedro> But yeah, there's some missing uniformity here. E.g., > Pedro> target_terminal_inferior is currently horrible for actually > Pedro> bypassing calling the target method in some cases. target_detach > Pedro> is another case that does extra work. > > Another somewhat related oddity in the current code is that some spots > bypass these entry points, or at least seem to. Search for > "current_target.beneath" outside of target.[ch] to see. Yeah, most of those are related to xfer_partial. I wrote somewhere that I thought we can actually make that one a regular delegated method now, but I don't have the pointer handy, nor do I off hand recall why. But I can look it up if you want me to. > > Pedro> I was thinking simpler maintenance and clearer resulting code, by > Pedro> enforcing the rule that the entry point does nothing more than > Pedro> calling the target_ops method, to avoid surprises like > Pedro> target_terminal_inferior. > > Yeah, ok. Well, that makes sense, it's just unclear to me if the > cost/benefit ratio is in our favor here, given the apparent amount of > inconsistency already in-tree. Yeah, agreed. It was just a thought, brainstorming material. I'm definitely not going to jump right into attempting it. -- Pedro Alves