------- Comment #5 from nikolay at totalviewtech dot com 2007-08-24 13:15 ------- This is not fixed neither in 4.1.0 nor in any later version. The problem is that DIE for static foofoo was indeed produced, but produced in wrong place. <2><260>: Abbrev Number: 7 (DW_TAG_subprogram) --- Constructor declaration DW_AT_external : 1 DW_AT_name : A DW_AT_decl_file : 1 DW_AT_decl_line : 16 DW_AT_declaration : 1 <1><27f>: Abbrev Number: 10 (DW_TAG_subprogram) --- Broken declaration DW_AT_sibling : <2bc> DW_AT_specification: <260> DW_AT_decl_line : 22 DW_AT_inline : 0 (not inlined) ..... <2><2a7>: Abbrev Number: 13 (DW_TAG_variable)- this is where foofoo was emited DW_AT_name : foofoo DW_AT_decl_file : 1 DW_AT_decl_line : 28 DW_AT_type : <3a1> DW_AT_location : 5 byte block: 3 c0 86 4 8 (DW_OP_addr: 80486c0) <1><2c1>: Abbrev Number: 15 (DW_TAG_subprogram) -- real constructor declaration DW_AT_sibling : <2fd> DW_AT_abstract_origin: <27f> DW_AT_low_pc : 0x8048474 DW_AT_high_pc : 0x80484ed DW_AT_frame_base : 0 (location list) <2><2ee>: Abbrev Number: 17 (DW_TAG_lexical_block) -- this is the scope, where foo and all other variables should be defined. DW_AT_low_pc : 0x8048495 DW_AT_high_pc : 0x80484eb <3><2f7>: Abbrev Number: 18 (DW_TAG_variable) --- this is supposed to be "iii" DW_AT_location : 2 byte block: 91 74 (DW_OP_fbreg: -12) --------------------------------------------------------------------- So dwarf producer is clearly confused and emits static foofoo in wrong broken subprogram declaration. Instead it should emit it inside lexical block <2ee>
-- nikolay at totalviewtech dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nikolay at totalviewtech dot | |com http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33044