From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32352 invoked by alias); 17 Jul 2014 16:19:57 -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 32323 invoked by uid 89); 17 Jul 2014 16:19:56 -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:19:55 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6HGJrR1007037 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 17 Jul 2014 12:19:54 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6HGJqbC028598; Thu, 17 Jul 2014 12:19:53 -0400 Message-ID: <53C7F7A8.8040505@redhat.com> Date: Thu, 17 Jul 2014 16:35: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> In-Reply-To: <87k37cx996.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-07/txt/msg00473.txt.bz2 On 07/17/2014 05:03 PM, Tom Tromey wrote: > Pedro> I wonder about generating the target_foo() entry point methods too... > > FWIW I hadn't thought of it. Looking a little, there seems to be a bit > less uniformity here. Some of the entry points do extra work, and some > have extra arguments (I happened to see target_get_section_table). Hmm, I think you might have looked at some other method. That one's arguments seem to match. But yeah, there's some missing uniformity here. E.g., target_terminal_inferior is currently horrible for actually bypassing calling the target method in some cases. target_detach is another case that does extra work. > Of course anything's doable with either some refactoring or more macro > annotations. Yeah. > I think the question I would start with is what we would expect to get > from the transform. For the delegation series I think we got a pretty > big reduction in confusion. And for this patch I think we get not just > more uniform and useful debug output, but also simpler maintenance. I was thinking simpler maintenance and clearer resulting code, by enforcing the rule that the entry point does nothing more than calling the target_ops method, to avoid surprises like target_terminal_inferior. > One possible benefit from automating the target_* entry points is > simpler maintenance as well. However this has to be weighed against the > loss of readability that comes from having the top-level API disappear > behind a veil of macros and/or generator scripts. Definitely. -- Pedro Alves