[Bug debug/16063] Debuggers need more information about enum types in C++

2014-09-12 Thread mpolacek at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16063

Marek Polacek mpolacek at gcc dot gnu.org changed:

   What|Removed |Added

 CC||mpolacek at gcc dot gnu.org

--- Comment #9 from Marek Polacek mpolacek at gcc dot gnu.org ---
So, is this fixed?


[Bug debug/16063] Debuggers need more information about enum types in C++

2014-09-12 Thread mark at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16063

Mark Wielaard mark at gcc dot gnu.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--- Comment #10 from Mark Wielaard mark at gcc dot gnu.org ---
(In reply to Marek Polacek from comment #9)
 So, is this fixed?

Yes, I do believe so, in gcc trunk. Sorry for not closing earlier.


[Bug debug/16063] Debuggers need more information about enum types in C++

2014-06-25 Thread tromey at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16063

Tom Tromey tromey at gcc dot gnu.org changed:

   What|Removed |Added

 CC||chihin.ko at oracle dot com

--- Comment #8 from Tom Tromey tromey at gcc dot gnu.org ---
*** Bug 54774 has been marked as a duplicate of this bug. ***


[Bug debug/16063] Debuggers need more information about enum types in C++

2014-05-21 Thread mark at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=16063

--- Comment #7 from Mark Wielaard mark at gcc dot gnu.org ---
Author: mark
Date: Wed May 21 15:44:59 2014
New Revision: 210717

URL: http://gcc.gnu.org/viewcvs?rev=210717root=gccview=rev
Log:
PR debug/16063. Add DW_AT_type to DW_TAG_enumeration.

Add a new lang-hook that provides the underlying base type of an
ENUMERAL_TYPE. The default implementation will just use type_for_size.
The implementation for C++ will use the ENUM_UNDERLYING_TYPE if it exists.
Use this enum_underlying_base_type lang-hook in dwarf2out.c to add a
DW_AT_type base type reference to a DW_TAG_enumeration.

gcc/
* dwarf2out.c (gen_enumeration_type_die): Add DW_AT_type if DWARF
version = 3 or not strict DWARF.
* langhooks.h (struct lang_hooks_for_types): Add
enum_underlying_base_type.
* langhooks.c (lhd_enum_underlying_base_type): New function.
* gcc/langhooks.h (struct lang_hooks_for_types): Add
enum_underlying_base_type.
* langhooks-def.h (lhd_enum_underlying_base_type): New declaration.
(LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): New define.
(LANG_HOOKS_FOR_TYPES_INITIALIZER): Add new lang hook.

gcc/cp/
* cp-lang.c (cxx_enum_underlying_base_type): New function.
(LANG_HOOKS_ENUM_UNDERLYING_BASE_TYPE): Define.

Modified:
trunk/gcc/ChangeLog
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/cp-lang.c
trunk/gcc/dwarf2out.c
trunk/gcc/langhooks-def.h
trunk/gcc/langhooks.c
trunk/gcc/langhooks.h


[Bug debug/16063] Debuggers need more information about enum types in C++

2014-03-23 Thread mark at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16063

--- Comment #6 from Mark Wielaard mark at gcc dot gnu.org ---
Posted a patch:
http://gcc.gnu.org/ml/gcc-patches/2014-03/msg01198.html


[Bug debug/16063] Debuggers need more information about enum types in C++

2012-06-29 Thread tromey at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16063

Tom Tromey tromey at gcc dot gnu.org changed:

   What|Removed |Added

 CC||tromey at gcc dot gnu.org

--- Comment #5 from Tom Tromey tromey at gcc dot gnu.org 2012-06-29 13:50:49 
UTC ---
DWARF 4 allows this:

The enumeration type entry may have a DW_AT_type attribute which refers to the
underlying
data type used to implement the enumeration.

I think this is definitely needed for enum class, where the base
type can be specified by the user.
However, emitting it unconditionally wouldn't hurt.