From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1513 invoked by alias); 17 Jul 2014 16:03:54 -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 1499 invoked by uid 89); 17 Jul 2014 16:03:53 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.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 (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 17 Jul 2014 16:03:52 +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 s6HG3pTU009162 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 17 Jul 2014 12:03:51 -0400 Received: from barimba (ovpn-113-27.phx2.redhat.com [10.3.113.27]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s6HG3nJO004096 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Thu, 17 Jul 2014 12:03:50 -0400 From: Tom Tromey To: Pedro Alves 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> Date: Thu, 17 Jul 2014 16:12:00 -0000 In-Reply-To: <53C7E1D8.7060808@redhat.com> (Pedro Alves's message of "Thu, 17 Jul 2014 15:46:48 +0100") Message-ID: <87k37cx996.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-07/txt/msg00471.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> I think it'll end up being useful to print the arguments before Pedro> the call too, but I don't think we do that today, so this way Pedro> looks fine to me. Doing this means marking "out" parameters so they can be skipped. This is why I didn't do it, but that was due to using a purely type-based approach -- with the new machinery it ought to be a bit more doable, provided we don't mind a ton of macros in target_ops. >> +static void >> +delegate_resume (struct target_ops *self, ptid_t arg1, int >> TARGET_DEBUG_PRINTER (target_debug_print_step) arg2, enum gdb_signal >> arg3) Pedro> Doesn't really matter much, but would it be trivial to strip Pedro> out the TARGET_DEBUG_PRINTER part in these generated methods? Probably easy. 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). Of course anything's doable with either some refactoring or more macro annotations. 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. 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. Tom