This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] handle DW_AT_type on an enumeration
- From: Mark Wielaard <mjw at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 28 Mar 2014 10:34:40 +0100
- Subject: Re: [PATCH] handle DW_AT_type on an enumeration
- Authentication-results: sourceware.org; auth=none
- References: <1395936887-8173-1-git-send-email-tromey at redhat dot com>
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