This is the mail archive of the
mailing list for the GCC project.
Re: Ping2: [PATCH] PR debug/16063. Add DW_AT_type to DW_TAG_enumeration.
- From: Mark Wielaard <mjw at redhat dot com>
- To: Jason Merrill <jason at redhat dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Cary Coutant <ccoutant at google dot com>, Tom Tromey <tromey at redhat dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Richard Henderson <rth at redhat dot com>
- Date: Tue, 20 May 2014 19:51:11 +0200
- Subject: Re: Ping2: [PATCH] PR debug/16063. Add DW_AT_type to DW_TAG_enumeration.
- Authentication-results: sourceware.org; auth=none
- References: <1397510343 dot 5633 dot 44 dot camel at bordewijk dot wildebeest dot org> <1398162670 dot 29199 dot 127 dot camel at bordewijk dot wildebeest dot org> <1398683852 dot 4016 dot 30 dot camel at bordewijk dot wildebeest dot org> <20140428122313 dot GE1817 at tucnak dot redhat dot com> <1398688641 dot 4016 dot 35 dot camel at bordewijk dot wildebeest dot org> <53718FE3 dot 9090108 at redhat dot com> <20140513072108 dot GA11487 at toonder dot wildebeest dot org> <537A6E9B dot 4050304 at redhat dot com> <20140520065546 dot GB2916 at toonder dot wildebeest dot org> <537B6A0A dot 1080409 at redhat dot com>
On Tue, May 20, 2014 at 10:43:22AM -0400, Jason Merrill wrote:
> On 05/20/2014 02:55 AM, Mark Wielaard wrote:
> >On Mon, May 19, 2014 at 04:50:35PM -0400, Jason Merrill wrote:
> >>On 05/13/2014 03:21 AM, Mark Wielaard wrote:
> >>>So the debugger doesn't have to guess the properties of the enum's
> >>>underlying base type, like size, encoding and signedness.
> >>Well, the enum already has DW_AT_byte_size. It seems to me that it should
> >>also have DW_AT_encoding to provide the other two properties you mention.
> >Right, that is the idea, since an enum doesn't provide those attributes,
> >it should have a reference to the underlying base type that provides them.
> Yes, but why is that better than providing them directly?
Because that would loose the information of which underlying type
is used to implement the enum. And it is probably less efficient to
replicate all the attributes for each enum. It is also simply how the
DWARF standard specifies these properties. They are not attached to the
DW_TAG_enumeration_type directly but specified through the underlying
type. Which is what gdb expects now.
The DWARF part isn't what this patch is blocked on. That has already
been discussed on the DWARF standard list, coordinated with the gdb
hackers and approved some months ago. The part that hasn't been reviewed
and approved yet is the frontend changes that implement the lang-hook.