The following program: namespace A{ class B{ }; typedef A::B AB; } int main(){ A::AB ab; return 0; } compiled with gcc generates the following debug info: ... <1><43>: Abbrev Number: 5 (DW_TAG_subprogram) <44> DW_AT_external : 1 <45> DW_AT_name : (indirect string, offset: 0x4c): main <49> DW_AT_decl_file : 1 <4a> DW_AT_decl_line : 10 <4b> DW_AT_type : <0x91> <4f> DW_AT_low_pc : 0x40053c <57> DW_AT_high_pc : 0x400547 <5f> DW_AT_frame_base : 0x0 (location list) <63> DW_AT_sibling : <0x91> <2><67>: Abbrev Number: 6 (DW_TAG_lexical_block) <68> DW_AT_low_pc : 0x400540 <70> DW_AT_high_pc : 0x400545 <3><78>: Abbrev Number: 7 (DW_TAG_typedef) <79> DW_AT_name : AB <7c> DW_AT_decl_file : 1 <7d> DW_AT_decl_line : 7 <7e> DW_AT_type : <0x3b> ... The typedef tag <78> is a child of subprogram main instead of namespace A.
Created attachment 343473 [details] candidate fix I am testing this patch for now. I couldn't find a way to easily catch that issue in a regression test in gcc right now, because I need to test that the DIE of the typedef is properly nested in the right namespace. I guess I will have to run the gdb testsuite as well, hoping to have a regression test that can catch the issue there.
Okay the patch seems to bootstrap/regtest fine on gcc trunk.
So I have opened an upstream bug at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40109.
Okay the upstream bug has been fixed. I guess I can't close this bug until a fedora package containing the fix is pushed. So I am unassigning myself from the bug and passing the ball to Jakub :)
This bug appears to have been reported against 'rawhide' during the Fedora 11 development cycle. Changing version to '11'. More information and reason for this action is here: http://fedoraproject.org/wiki/BugZappers/HouseKeeping