Bug 497405 - Incorrect debug info for typedef statements within namespaces
Summary: Incorrect debug info for typedef statements within namespaces
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 11
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-04-23 19:05 UTC by Sami Wagiaalla
Modified: 2016-06-07 22:46 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-06-16 15:17:12 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
candidate fix (751 bytes, patch)
2009-05-11 16:08 UTC, Dodji Seketeli
no flags Details | Diff

Description Sami Wagiaalla 2009-04-23 19:05:15 UTC
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.

Comment 1 Dodji Seketeli 2009-05-11 16:08:35 UTC
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.

Comment 2 Dodji Seketeli 2009-05-11 18:12:23 UTC
Okay the patch seems to bootstrap/regtest fine on gcc trunk.

Comment 3 Dodji Seketeli 2009-05-18 19:28:27 UTC
So I have opened an upstream bug at http://gcc.gnu.org/bugzilla/show_bug.cgi?id=40109.

Comment 4 Dodji Seketeli 2009-05-18 19:32:09 UTC
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 :)

Comment 5 Bug Zapper 2009-06-09 14:28:48 UTC
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


Note You need to log in before you can comment on or make changes to this bug.