public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/39285] New: Missing debug info for enum members in C++
@ 2009-02-24 8:12 ppluzhnikov at google dot com
2009-02-24 8:38 ` [Bug c++/39285] [4.4 Regression] " pinskia at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: ppluzhnikov at google dot com @ 2009-02-24 8:12 UTC (permalink / raw)
To: gcc-bugs
GCC @144404 does not generate DW_AT_const_value for enum members in C++ mode
(in C everything appears fine). This is a regression from 4.3.1.
Test case:
enum E { red = 1, green = 42 };
int main()
{
E e = red;
return e;
}
When above is compiled with gcc-4.3.1, readelf -w shows:
<2><2f>: Abbrev Number: 3 (DW_TAG_enumerator)
<30> DW_AT_name : red
<34> DW_AT_const_value : 1
<2><35>: Abbrev Number: 4 (DW_TAG_enumerator)
<36> DW_AT_name : (indirect string, offset: 0x8): green
<3a> DW_AT_const_value : 42
<1><3c>: Abbrev Number: 5 (DW_TAG_subprogram)
...
When compiled with gcc-4.4.0:
<2><2f>: Abbrev Number: 3 (DW_TAG_enumerator)
<30> DW_AT_name : red
<2><34>: Abbrev Number: 4 (DW_TAG_enumerator)
<35> DW_AT_name : (indirect string, offset: 0x8): green
<1><3a>: Abbrev Number: 5 (DW_TAG_subprogram)
...
AFAICT, this is causing the following GDB tests to fail:
FAIL: gdb.cp/classes.exp: print obj_with_enum (2)
FAIL: gdb.cp/classes.exp: print obj_with_enum.priv_enum
FAIL: gdb.cp/classes.exp: ptype obj_with_enum.priv_enum
FAIL: gdb.cp/classes.exp: print ('ClassWithEnum::PrivEnum') 42
FAIL: gdb.cp/m-data.exp: simple object, enum
FAIL: gdb.cp/m-data.exp: derived template object, derived enum
FAIL: gdb.cp/m-data.exp: template object, derived enum
FAIL: gdb.cp/m-static.exp: derived template object, static enum
FAIL: gdb.cp/m-static.exp: template object, static derived enum
--
Summary: Missing debug info for enum members in C++
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ppluzhnikov at google dot com
GCC build triplet: i686-host_pc-linux-gnu
GCC host triplet: i686-host_pc-linux-gnu
GCC target triplet: i686-host_pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39285
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/39285] [4.4 Regression] Missing debug info for enum members in C++
2009-02-24 8:12 [Bug c++/39285] New: Missing debug info for enum members in C++ ppluzhnikov at google dot com
@ 2009-02-24 8:38 ` pinskia at gcc dot gnu dot org
2009-02-24 13:27 ` rguenth at gcc dot gnu dot org
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2009-02-24 8:38 UTC (permalink / raw)
To: gcc-bugs
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-debug
Summary|Missing debug info for enum |[4.4 Regression] Missing
|members in C++ |debug info for enum members
| |in C++
Target Milestone|--- |4.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39285
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/39285] [4.4 Regression] Missing debug info for enum members in C++
2009-02-24 8:12 [Bug c++/39285] New: Missing debug info for enum members in C++ ppluzhnikov at google dot com
2009-02-24 8:38 ` [Bug c++/39285] [4.4 Regression] " pinskia at gcc dot gnu dot org
@ 2009-02-24 13:27 ` rguenth at gcc dot gnu dot org
2009-02-24 13:30 ` rguenth at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-02-24 13:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2009-02-24 13:27 -------
This is because as we come here (gen_enumeration_type_die):
for (link = TYPE_VALUES (type);
link != NULL; link = TREE_CHAIN (link))
{
dw_die_ref enum_die = new_die (DW_TAG_enumerator, type_die, link);
tree value = TREE_VALUE (link);
add_name_attribute (enum_die,
IDENTIFIER_POINTER (TREE_PURPOSE (link)));
if (host_integerp (value, TYPE_UNSIGNED (TREE_TYPE (value))))
value is a CONST_DECL, not an integer constant. Whereas for GCC 4.3 we
had INTEGER_CSTs there.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2009-02-24 13:27:44
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39285
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug c++/39285] [4.4 Regression] Missing debug info for enum members in C++
2009-02-24 8:12 [Bug c++/39285] New: Missing debug info for enum members in C++ ppluzhnikov at google dot com
2009-02-24 8:38 ` [Bug c++/39285] [4.4 Regression] " pinskia at gcc dot gnu dot org
2009-02-24 13:27 ` rguenth at gcc dot gnu dot org
@ 2009-02-24 13:30 ` rguenth at gcc dot gnu dot org
2009-02-24 14:48 ` [Bug debug/39285] " rguenth at gcc dot gnu dot org
2009-02-24 14:48 ` rguenth at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-02-24 13:30 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from rguenth at gcc dot gnu dot org 2009-02-24 13:29 -------
I have a patch. This was noticed and fixed for SDB previously.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2009-02-24 13:27:44 |2009-02-24 13:29:48
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39285
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug debug/39285] [4.4 Regression] Missing debug info for enum members in C++
2009-02-24 8:12 [Bug c++/39285] New: Missing debug info for enum members in C++ ppluzhnikov at google dot com
` (2 preceding siblings ...)
2009-02-24 13:30 ` rguenth at gcc dot gnu dot org
@ 2009-02-24 14:48 ` rguenth at gcc dot gnu dot org
2009-02-24 14:48 ` rguenth at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-02-24 14:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from rguenth at gcc dot gnu dot org 2009-02-24 14:47 -------
Fixed.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Known to work| |4.3.3
Resolution| |FIXED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39285
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug debug/39285] [4.4 Regression] Missing debug info for enum members in C++
2009-02-24 8:12 [Bug c++/39285] New: Missing debug info for enum members in C++ ppluzhnikov at google dot com
` (3 preceding siblings ...)
2009-02-24 14:48 ` [Bug debug/39285] " rguenth at gcc dot gnu dot org
@ 2009-02-24 14:48 ` rguenth at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2009-02-24 14:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from rguenth at gcc dot gnu dot org 2009-02-24 14:47 -------
Subject: Bug 39285
Author: rguenth
Date: Tue Feb 24 14:47:30 2009
New Revision: 144407
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144407
Log:
2009-02-24 Richard Guenther <rguenther@suse.de>
PR debug/39285
* dwarf2out.c (gen_enumeration_type_die): Handle CONST_DECLs.
Modified:
trunk/gcc/ChangeLog
trunk/gcc/dwarf2out.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39285
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2009-02-24 14:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-24 8:12 [Bug c++/39285] New: Missing debug info for enum members in C++ ppluzhnikov at google dot com
2009-02-24 8:38 ` [Bug c++/39285] [4.4 Regression] " pinskia at gcc dot gnu dot org
2009-02-24 13:27 ` rguenth at gcc dot gnu dot org
2009-02-24 13:30 ` rguenth at gcc dot gnu dot org
2009-02-24 14:48 ` [Bug debug/39285] " rguenth at gcc dot gnu dot org
2009-02-24 14:48 ` rguenth at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).