public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/18112] New:  -feliminate-dwarf2-dups produces debug entries in wrong scope
@ 2004-10-22 14:25 nikolay at etnus dot com
  2004-10-22 17:31 ` [Bug debug/18112] " pinskia at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: nikolay at etnus dot com @ 2004-10-22 14:25 UTC (permalink / raw)
  To: gcc-bugs

Consider this program, compiled with  -feliminate-dwarf2-dups 
----------------------------
#include <iostream>
#include <string>

using namespace std;

int main(){
  string s1 = "Hello";
}
-----------------------------
readelf -wi produces: 
<0><103c>: Abbrev Number: 91 (DW_TAG_compile_unit)
     DW_AT_stmt_list   : 712	
     DW_AT_producer    : (indirect string, offset: 0xff3): GNU C++ 3.4.1	
     DW_AT_language    : 4	(C++)
     DW_AT_name        : ../../src/tx_ttf_string.cxx	
     DW_AT_comp_dir    :
/home/nikolay/builds/xander-linux-x86/totalview/debugger/src/tests/bld/gcc_3.4.1_32
.........................
 <1><2153>: Abbrev Number: 119 (DW_TAG_subprogram)
     DW_AT_sibling     : <2186>	
     DW_AT_external    : 1	
     DW_AT_name        : main	
     DW_AT_decl_file   : 54	
     DW_AT_decl_line   : 8	
     DW_AT_type        : <10b6>	
     DW_AT_low_pc      : 0x8048970 134515056	
     DW_AT_high_pc     : 0x80489f3 134515187	
     DW_AT_frame_base  : 1 byte block: 55 	(DW_OP_reg5; )
 <2><216e>: Abbrev Number: 116 (DW_TAG_lexical_block)
     DW_AT_low_pc      : 0x804898d 134515085	
     DW_AT_high_pc     : 0x80489e9 134515177	
 <3><2177>: Abbrev Number: 120 (DW_TAG_variable)
     DW_AT_name        : s1	
     DW_AT_decl_file   : 54	
     DW_AT_decl_line   : 9	
     DW_AT_type        : <#a92e>	
     DW_AT_location    : 2 byte block: 91 68 	(DW_OP_fbreg: -24; )

Notice, that variable s1 is of type <#a92e>,
The problem is, that type <#a92e> is defined as typedef in different CU 
(which is fine) and inside the scope of some "arbitrary" structure (which is
wrong). 
Effectively type of s1 is not visible (out of scope) in main and is reported as
<void> by the debugger.

-- 
           Summary:  -feliminate-dwarf2-dups produces debug entries in wrong
                    scope
           Product: gcc
           Version: 3.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: debug
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: nikolay at etnus dot com
                CC: gcc-bugs at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18112


^ permalink raw reply	[flat|nested] 8+ messages in thread
[parent not found: <bug-18112-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2012-01-11 12:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-10-22 14:25 [Bug debug/18112] New: -feliminate-dwarf2-dups produces debug entries in wrong scope nikolay at etnus dot com
2004-10-22 17:31 ` [Bug debug/18112] " pinskia at gcc dot gnu dot org
2004-10-22 17:40 ` nikolay at etnus dot com
2004-10-22 17:43 ` pinskia at gcc dot gnu dot org
2004-10-22 18:17 ` nikolay at etnus dot com
2004-10-22 18:22 ` pinskia at gcc dot gnu dot org
2004-10-22 18:39 ` nikolay at etnus dot com
     [not found] <bug-18112-4@http.gcc.gnu.org/bugzilla/>
2012-01-11 12:41 ` rguenth at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).