This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] handle DW_AT_type on an enumeration


On Thu, 2014-03-27 at 10:14 -0600, Tom Tromey wrote:
> DWARF allows an enumeration type to have a DW_AT_type.  GDB doesn't
> recognize this, but there is a patch to change GCC to emit it, and a
> DWARF proposal to further allow an enum type with a DW_AT_type to omit
> the DW_AT_byte_size.  This patch changes gdb to implement this.

Note that neither the gcc patch nor the DWARF spec clarification have
been accepted yet. But I do think consensus is that this is the proper
way to do things.

> Built and regtested on x86-64 Fedora 20.

I build and did a make check against GCC with this patch applied:
http://gcc.gnu.org/ml/gcc-patches/2014-03/msg01448.html
And saw no regressions (and the new test passes) on RHEL6 x86_64.

> @@ -13247,6 +13255,20 @@ read_enumeration_type (struct die_info *die, struct dwarf2_cu *cu)
>    /* Finish the creation of this type by using the enum's children.  */
>    update_enumeration_type_from_children (die, type, cu);

You might want to add a comment here that you are still calling
update_enumeration_type_from_children to guess the TYPE_FLAG_ENUM even
though you will drop the TYPE_UNSIGNED guess later. At least I was a
little confused at first why you still called
update_enumeration_type_from_children in case you already knew the type.

Cheers,

Mark



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]