This is the mail archive of the
archer@sourceware.org
mailing list for the Archer project.
Re: archer-swagiaal-using-directive patch on static variables inmethods
- From: Sami Wagiaalla <swagiaal at redhat dot com>
- To: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- Cc: archer at sourceware dot org
- Date: Tue, 02 Dec 2008 13:49:59 -0500
- Subject: Re: archer-swagiaal-using-directive patch on static variables inmethods
- References: <20081124002822.GA9859@host0.dyn.jankratochvil.net> <492C6060.60107@redhat.com> <20081126142322.GA29416@host0.dyn.jankratochvil.net> <492DB4FB.8000303@redhat.com> <20081129001102.GA5006@host0.dyn.jankratochvil.net>
The problem is you try to create missing DIEs both for DW_AT_specification and
DW_AT_abstract_origin. But DWARF3 (3.3.8.2+3.3.8.3, pages 64-66/267)
describes such DIEs inheritance only for DW_AT_abstract_origin and not
DW_AT_specification.
So I created a branch where I reverted my patch
(1de38657622396795ce681e64b03fb74e81e6c3d) and applied yours
(60eb8684d0d85d0884aca7a2f013e5eb16a51d47) and I get one regression in
one of my test cases:
namespace G{
namespace H {
int ghx = 6;
}
}
namespace I{
int marker7(){
using namespace G::H;
ghx;
return L::marker8();
}
}
Print ghx at marker7 fails.
Problem is that the connection between the function die and its import
statement containing parent is a DW_AT_specification. In this case die
<87> should be inherited by <2a3>
<2><72>: Abbrev Number: 6 (DW_TAG_subprogram)
<73> DW_AT_external : 1
<74> DW_AT_name : (indirect string, offset: 0xbf): marker7
<78> DW_AT_decl_file : 1
<79> DW_AT_decl_line : 31
<7a> DW_AT_MIPS_linkage_name: (indirect string, offset: 0x7e):
_ZN1I7marker7Ev
<7e> DW_AT_type : <0x96>
<82> DW_AT_declaration : 1
<83> DW_AT_sibling : <0x8f>
<3><87>: Abbrev Number: 3 (DW_TAG_imported_module)
<88> DW_AT_decl_file : 1
<89> DW_AT_decl_line : 32
<8a> DW_AT_import : <0xa6> [Abbrev Number: 9 (DW_TAG_namespace)]
...
<1><2a3>: Abbrev Number: 17 (DW_TAG_subprogram)
<2a4> DW_AT_specification: <0x8f>
<2a8> DW_AT_low_pc : 0x400572
<2b0> DW_AT_high_pc : 0x40057d
<2b8> DW_AT_frame_base : 0x17c (location list)