From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 73880 invoked by alias); 6 Nov 2015 09:42: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 73853 invoked by uid 89); 6 Nov 2015 09:42:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_STOCKGEN,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no 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; Fri, 06 Nov 2015 09:42:55 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id D536EA3816 for ; Fri, 6 Nov 2015 09:42:54 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id tA69grvF024320; Fri, 6 Nov 2015 04:42:54 -0500 Message-ID: <563C761D.9070401@redhat.com> Date: Fri, 06 Nov 2015 09:42:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Kevin Buettner , gdb-patches@sourceware.org Subject: Re: [PATCH] testsuite: Define and use gdb_target_symbol_prefix_flags_asm References: <20151105222822.2f41149f@pinnacle.lan> In-Reply-To: <20151105222822.2f41149f@pinnacle.lan> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-11/txt/msg00196.txt.bz2 On 11/06/2015 05:28 AM, Kevin Buettner wrote: > +# It's possible to use this version (_asm) for C/C++ source files too, > +# but a string is usually required in such files; providing a version > +# (no _asm) which encloses the prefix with double quotes makes it > +# somewhat easier to define the supporting macros in the test case. > + > +proc gdb_target_symbol_prefix_flags_asm {} { > + set prefix [gdb_target_symbol_prefix] > + if {$prefix ne ""} { > + return "additional_flags=-DSYMBOL_PREFIX=$prefix" > } else { > - return "" > + return ""; > } > } > > +# gdb_target_symbol_prefix_flags returns the same string as > +# gdb_target_symbol_prefix_flags_asm, above, but with the prefix > +# enclosed in double quotes if there is a prefix. > +# > +# See the comment for gdb_target_symbol_prefix_flags_asm for an > +# extended discussion. > + > +proc gdb_target_symbol_prefix_flags {} { > + set flags [gdb_target_symbol_prefix_flags_asm] > + regsub {(DSYMBOL_PREFIX=)(.*)$} $flags {\1"\2"} flags > + return flags Hmm, I think it'd end up simpler/less magic to remove the indirection through gdb_target_symbol_prefix_flags_asm after all. It's about the same number of worker lines, but no magic regex. Like: proc gdb_target_symbol_prefix_flags_asm {} { set prefix [gdb_target_symbol_prefix] if {$prefix ne ""} { return "additional_flags=-DSYMBOL_PREFIX=\"$prefix\"" } return "" } WDYT? Otherwise LGTM. Thanks, Pedro Alves