From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31119 invoked by alias); 2 Aug 2009 19:34:47 -0000 Received: (qmail 31111 invoked by uid 22791); 2 Aug 2009 19:34:47 -0000 X-SWARE-Spam-Status: No, hits=-1.5 required=5.0 tests=AWL,BAYES_00,SPF_FAIL X-Spam-Check-By: sourceware.org Received: from mx20.gnu.org (HELO mx20.gnu.org) (199.232.41.8) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 02 Aug 2009 19:34:41 +0000 Received: from mail.codesourcery.com ([65.74.133.4]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MXgpK-0006nR-Lh for gcc@gcc.gnu.org; Sun, 02 Aug 2009 15:34:38 -0400 Received: (qmail 20297 invoked from network); 2 Aug 2009 19:34:35 -0000 Received: from unknown (HELO ?192.168.2.100?) (wilson@127.0.0.2) by mail.codesourcery.com with ESMTPA; 2 Aug 2009 19:34:35 -0000 Message-ID: <4A75EA44.8050201@codesourcery.com> Date: Sun, 02 Aug 2009 19:34:00 -0000 From: Jim Wilson User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b3pre) Gecko/20090513 Fedora/3.0-2.3.beta2.fc11 Thunderbird/3.0b2 MIME-Version: 1.0 To: sumanth CC: gcc@gcc.gnu.org Subject: Re: extern variable References: <4A71B07A.1030600@redpinesignals.com> In-Reply-To: <4A71B07A.1030600@redpinesignals.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Detected-Operating-System: by mx20.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-08/txt/msg00019.txt.bz2 On 07/30/2009 07:38 AM, sumanth wrote: > How can I make sure the debugging information printed by my compiler for > extern variables is correct. > I am able to print them in gdb in with an _ (underscore). I am using > Gcc-4.3.4 and gdb 5.3 ELF targets usually don't prepend an underscore to symbol names. But if you are prepending an underscore for some reason, then you need to make sure that your ASM_OUTPUT_* macros handle this correctly. You set USER_LABEL_PREFIX to an underscore, and then you add the USER_LABEL_PREFIX unless the symbol name starts with '*'. See the ASM_GENERATE_INTERNAL_LABEL docs. This stuff can be tricky. You will probably have to step through your cc1 port in gdb to see exactly what is going on. It will be useful to look at an existing port that handles this correctly; step through it in gdb to see how it works. Jim