Bug 27160 - Debugging output forgets scope for typedefs.
Summary: Debugging output forgets scope for typedefs.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.1.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-14 12:47 UTC by Daniel Jacobowitz
Modified: 2010-02-22 21:34 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.5.0
Known to fail:
Last reconfirmed: 2006-04-19 00:39:25


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Jacobowitz 2006-04-14 12:47:09 UTC
Compile this simple code with g++ -g.  I tried 3.3, 4.0, and 4.1 compilers.

namespace bar
{
   struct whatever
     {
        int someval;
     };
   typedef whatever zot;
};

int main()
{
  bar::whatever b;
  bar::zot c;
  return 1;
}

The debugging information will reveal that "whatever" is in bar, but not "zot".  In fact, "zot" will appear to be defined in main instead.  This prevents the debugger from e.g. "ptype bar::zot".
Comment 1 Andrew Pinski 2006-04-19 00:39:25 UTC
Confirmed.
Comment 2 Tom Tromey 2010-02-05 18:04:45 UTC
I tried this with some random svn trunk checkout, and it worked ok:

 <1><25>: Abbrev Number: 2 (DW_TAG_namespace)
    <26>   DW_AT_name        : bar      
    <2a>   DW_AT_decl_file   : 1        
    <2b>   DW_AT_decl_line   : 2        
    <2c>   DW_AT_sibling     : <0x42>   
 <2><30>: Abbrev Number: 3 (DW_TAG_structure_type)
    <31>   DW_AT_name        : (indirect string, offset: 0x4c): whatever        
    <35>   DW_AT_declaration : 1        
 <2><36>: Abbrev Number: 4 (DW_TAG_typedef)
    <37>   DW_AT_name        : zot      
    <3b>   DW_AT_decl_file   : 1        
    <3c>   DW_AT_decl_line   : 7        
    <3d>   DW_AT_type        : <0x42>   
Comment 3 Daniel Jacobowitz 2010-02-22 21:34:21 UTC
Works for me too, using GCC 4.4.