From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4635 invoked by alias); 9 Jul 2010 02:35:34 -0000 Received: (qmail 4613 invoked by uid 22791); 9 Jul 2010 02:35:32 -0000 X-SWARE-Spam-Status: No, hits=-0.6 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-pv0-f169.google.com (HELO mail-pv0-f169.google.com) (74.125.83.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Jul 2010 02:35:26 +0000 Received: by pvc30 with SMTP id 30so1355905pvc.0 for ; Thu, 08 Jul 2010 19:35:24 -0700 (PDT) Received: by 10.142.163.8 with SMTP id l8mr10585141wfe.42.1278642924417; Thu, 08 Jul 2010 19:35:24 -0700 (PDT) Received: from [172.16.146.33] ([60.12.143.10]) by mx.google.com with ESMTPS id l40sm120185rvb.18.2010.07.08.19.35.22 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 08 Jul 2010 19:35:23 -0700 (PDT) Message-ID: <4C368A68.9010308@gmail.com> Date: Fri, 09 Jul 2010 02:35:00 -0000 From: asmwarrior User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.19) Gecko/20081209 Thunderbird/2.0.0.19 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: gdb@sourceware.org, gcc@gcc.gnu.org Subject: Two debug entries for one local variables, is it a bug in GCC or GDB Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-07/txt/msg00032.txt.bz2 I have post this message to both GCC and GDB, because I'm not sure it is a bug in GDB or GCC. Hi, I have just find two dwarf debug entries for one local variables. For example, the sample code is just like: ----------------------------------------- wxString ParserThread::ReadAncestorList() { wxString ccc; wxString templateArgument; wxString aaa; aaa = m_Tokenizer.GetToken(); // eat ":" templateArgument = aaa; while (!TestDestroy()) { //Peek the next token wxString next = m_Tokenizer.PeekToken(); if (next.IsEmpty() || next==ParserConsts::opbrace || next==ParserConsts::semicolon ) // here, we are at the end of ancestor list { break; } else if (next==ParserConsts::lt) // class AAA : BBB< int, float> { wxString arg = SkipAngleBraces(); if(!arg.IsEmpty()) // find a matching<> { templateArgument< find. Error!!!") ); } } ... ------------------------------------------- But I found that GDG can show the wxString aaa correctly, but wxString templateArgument incorrectly. I have just check the debug information in the object file. and found that there are two entries for local variable "argumentTemplate", but only one entry for "aaa". -------------------------------------------- <2><40a9f>: Abbrev Number: 182 (DW_TAG_variable) <40aa1> DW_AT_name : (indirect string, offset: 0x1095): templateArgument <40aa5> DW_AT_decl_file : 19 <40aa6> DW_AT_decl_line : 2593 <40aa8> DW_AT_type :<0xd168> <40aac> DW_AT_accessibility: 3 (private) <40aad> DW_AT_location : 2 byte block: 53 6 (DW_OP_reg3; DW_OP_deref) <2><40ab0>: Abbrev Number: 164 (DW_TAG_lexical_block) <40ab2> DW_AT_ranges : 0x168 <3><40ab6>: Abbrev Number: 165 (DW_TAG_variable) <40ab8> DW_AT_name : ccc <40abc> DW_AT_decl_file : 19 <40abd> DW_AT_decl_line : 2592 <40abf> DW_AT_type :<0xd168> <40ac3> DW_AT_location : 2 byte block: 91 50 (DW_OP_fbreg: -48) <3><40ac6>: Abbrev Number: 179 (DW_TAG_variable) <40ac8> DW_AT_name : (indirect string, offset: 0x1095): templateArgument <40acc> DW_AT_decl_file : 19 <40acd> DW_AT_decl_line : 2593 <40acf> DW_AT_type :<0xd168> <40ad3> DW_AT_location : 2 byte block: 91 4c (DW_OP_fbreg: -52) <3><40ad6>: Abbrev Number: 165 (DW_TAG_variable) <40ad8> DW_AT_name : aaa <40adc> DW_AT_decl_file : 19 <40add> DW_AT_decl_line : 2594 <40adf> DW_AT_type :<0xd168> <40ae3> DW_AT_location : 2 byte block: 91 48 (DW_OP_fbreg: -56) <3><40ae6>: Abbrev Number: 170 (DW_TAG_lexical_block) ------------------------------------------------------------------------------ Also, you can see the screen shot in my Codeblocks forums' post: http://forums.codeblocks.org/index.php/topic,12873.msg86906.html#msg86906 So, my question is: Is this a bug in GCC or GDB? ( I have just test the MinGW GCC 4.5 and MinGW 4.4.4, they get the same result) Thanks Asmwarrior (ollydbg from codeblocks' forum)