Bug 54774 - insufficient debug info for strong typed enum
Summary: insufficient debug info for strong typed enum
Status: RESOLVED DUPLICATE of bug 16063
Alias: None
Product: gcc
Classification: Unclassified
Component: debug (show other bugs)
Version: 4.6.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
: 55447 (view as bug list)
Depends on:
Blocks:
 
Reported: 2012-10-02 00:39 UTC by chihin ko
Modified: 2014-06-25 18:55 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 4.4.4, 4.5.0, 4.6.0, 4.7.0
Last reconfirmed: 2012-12-07 00:00:00


Attachments
compileable c++ test case and dwarf dump (17.59 KB, application/x-tar)
2012-10-02 00:39 UTC, chihin ko
Details

Note You need to log in before you can comment on or make changes to this bug.
Description chihin ko 2012-10-02 00:39:05 UTC
Created attachment 28320 [details]
compileable c++ test case and dwarf dump

For strong typed enum, there is no  type information:

#include <iostream>

enum UI: unsigned int
{
        None = 0,
        Single = 1,
        Multiple = 0xFFFF0000U
};

 <1><26aa>: Abbrev Number: 69 (DW_TAG_enumeration_type)
     DW_AT_name        : UI
     DW_AT_byte_size   : 4
     DW_AT_decl_file   : 1
     DW_AT_decl_line   : 3
     DW_AT_sibling     : <26cc>

  Should have a DW_AT_type : <unsigned int type> under DW_TAG_enumeration_type
Comment 1 Jakub Jelinek 2012-10-02 10:53:11 UTC
Guess we'd need to either move ENUM_FIXED_UNDERLYING_TYPE_P bit (and possibly
ENUM_UNDERLYING_TYPE convention) out of the FE to tree.h, or add a langhook
to query that info from the FE (won't work well with LTO though, but there are tons of things that don't either).
Comment 2 Paolo Carlini 2012-11-23 14:49:24 UTC
*** Bug 55447 has been marked as a duplicate of this bug. ***
Comment 3 chihin ko 2012-12-06 19:57:46 UTC
This problem can trace back from gcc 4.4.4.
Comment 4 Jakub Jelinek 2012-12-06 20:38:45 UTC
But it isn't a regression, so Summary shouldn't be changed for that fact.  You can fill in Known to work: (guess empty) and Known to fail:.
Comment 5 Paolo Carlini 2012-12-07 00:11:10 UTC
Confirming.
Comment 6 Mark Wielaard 2014-03-24 14:32:21 UTC
I think this is a duplicate of PR debug/16063.

With the proposed patch for that applied the debuginfo for the UI enum looks like:

 [  243e]    enumeration_type
             name                 (string) "UI"
             byte_size            (data1) 4
             type                 (ref4) [  2463]
             decl_file            (data1) 1
             decl_line            (data1) 3
             sibling              (ref4) [  2463]
 [  244d]      enumerator
               name                 (strp) "None"
               const_value          (data1) 0
 [  2453]      enumerator
               name                 (strp) "Single"
               const_value          (data1) 1
 [  2459]      enumerator
               name                 (strp) "Multiple"
               const_value          (data4) 4294901760
 [  2463]    base_type
             byte_size            (data1) 4
             encoding             (data1) unsigned (7)
Comment 7 Tom Tromey 2014-06-25 18:55:30 UTC
(In reply to Mark Wielaard from comment #6)
> I think this is a duplicate of PR debug/16063.

I agree.

*** This bug has been marked as a duplicate of bug 16063 ***