From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 119854 invoked by alias); 5 Nov 2015 10:55:00 -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 119836 invoked by uid 89); 5 Nov 2015 10:54:59 -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; Thu, 05 Nov 2015 10:54:59 +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 (Postfix) with ESMTPS id 328A8A4504 for ; Thu, 5 Nov 2015 10:54:58 +0000 (UTC) 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 tA5AsuQF026341; Thu, 5 Nov 2015 05:54:57 -0500 Message-ID: <563B3580.9030309@redhat.com> Date: Thu, 05 Nov 2015 10:55: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] gdb.dwarf2: Define and use gdb_target_symbol_prefix for symbol prefixes References: <20151029212509.438b5642@pinnacle.lan> <20151029222505.3bb590b9@pinnacle.lan> <56335065.1060100@redhat.com> <20151104233946.51336127@pinnacle.lan> <563B3389.20502@redhat.com> In-Reply-To: <563B3389.20502@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-11/txt/msg00179.txt.bz2 On 11/05/2015 10:46 AM, Pedro Alves wrote: >> > I'm willing to make these changes, but I want to first be sure that >> > I'm not missing an easier fix. BTW, an alternative to the below would be to have two tcl procedures, one for asm, and another for C/C++/etc, like gdb_target_symbol_prefix_flags_asm / gdb_target_symbol_prefix_flags. The C version would just call the asm version and add the double quotes. Thanks, Pedro Alves > IMO, it's clearer to separate the concerns -- concatenation > and final stringification. > > Start with the usual concatenation: > > #define CONCAT1(a, b) CONCAT2(a, b) > #define CONCAT2(a, b) a ## b > > #ifdef SYMBOL_PREFIX > # define SYMBOL1(str) CONCAT1(SYMBOL_PREFIX, str) > #else > # define SYMBOL1(str) str > #endif > > > Then add a stringification layer: > > #define STR1(s) #s > #define STR(s) STR1(s) > > #define SYMBOL(str) STR(SYMBOL1(str)) > > > This way you have these expansions: > > SYMBOL1(main) -> _main > SYMBOL(main) -> "_main"