This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: unbreak typedefed bitfield
- From: Tom Tromey <tromey at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Vladimir Prus <vladimir at codesourcery dot com>, gdb-patches at sourceware dot org
- Date: Fri, 18 Dec 2009 12:54:17 -0700
- Subject: Re: RFA: unbreak typedefed bitfield
- References: <200912181541.30891.vladimir@codesourcery.com> <20091218130612.GD2788@adacore.com>
- Reply-to: tromey at redhat dot com
>>>>> "Joel" == Joel Brobecker <brobecker@adacore.com> writes:
Joel> I have a general feeling that most of the time, the typedef should
Joel> have never been passed down. But I haven't spent the time and
Joel> effort to try to think globally.
There are definitely cases where we want to preserve the type that the
user wrote.
In C, this matters for printing various character types. E.g., both
wchar_t and char32_t may be typedefs of int, but we want to print them
differently if they use different encodings.
This preservation has to be pervasive, because of things like:
print (wchar_t) 32
This example doesn't work today, but probably should.
I agree that check_typedef is a problem.
Perhaps we could approach the check_typedef problem using a semantic
analyzer to ensure correct use. There are other idioms in gdb that also
require careful attention that would benefit from this; cleanups and
proper use of TRY_CATCH come to mind, but there are probably others.
Another approach would be to change TYPE_LENGTH to first call
check_typedef.
Tom