Bug 497405 - Incorrect debug info for typedef statements within namespaces
Incorrect debug info for typedef statements within namespaces
Product: Fedora
Classification: Fedora
Component: gcc (Show other bugs)
All Linux
low Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2009-04-23 15:05 EDT by Sami Wagiaalla
Modified: 2016-06-07 18:46 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2009-06-16 11:17:12 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Sami Wagiaalla 2009-04-23 15:05:15 EDT
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 12:08:35 EDT
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 14:12:23 EDT
Okay the patch seems to bootstrap/regtest fine on gcc trunk.
Comment 3 Dodji Seketeli 2009-05-18 15:28:27 EDT
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 15:32:09 EDT
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 10:28:48 EDT
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:

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