From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1282 invoked by alias); 17 Jul 2014 14:46:55 -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 1171 invoked by uid 89); 17 Jul 2014 14:46:54 -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 14:46:52 +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 s6HEkoHX007654 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Thu, 17 Jul 2014 10:46:51 -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 s6HEkn69030386; Thu, 17 Jul 2014 10:46:49 -0400 Message-ID: <53C7E1D8.7060808@redhat.com> Date: Thu, 17 Jul 2014 14:50: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> In-Reply-To: <87sim1z71y.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-SW-Source: 2014-07/txt/msg00467.txt.bz2 On 07/16/2014 03:56 PM, Tom Tromey wrote: > Pedro> I like the idea of this patch a lot. > [...] > Pedro> Did you try an __attribute__(())-like approach? Something like: > > Appended is a patch that works this way. This looks great to me. > static void > +debug_post_attach (struct target_ops *self, int arg1) > +{ > + fprintf_unfiltered (gdb_stdlog, "-> %s->to_post_attach (...)\n", debug_target.to_shortname); > + debug_target.to_post_attach (&debug_target, arg1); > + fprintf_unfiltered (gdb_stdlog, "<- %s->to_post_attach (", debug_target.to_shortname); > + target_debug_print_struct_target_ops_p (&debug_target); > + fputs_unfiltered (", ", gdb_stdlog); > + target_debug_print_int (arg1); > + fputs_unfiltered (")\n", gdb_stdlog); I think it'll end up being useful to print the arguments before the call too, but I don't think we do that today, so this way looks fine to me. > +static void > +delegate_resume (struct target_ops *self, ptid_t arg1, int TARGET_DEBUG_PRINTER (target_debug_print_step) arg2, enum gdb_signal arg3) Doesn't really matter much, but would it be trivial to strip out the TARGET_DEBUG_PRINTER part in these generated methods? Thanks! I wonder about generating the target_foo() entry point methods too... -- Pedro Alves