This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] [RFC] python: gdb.Type: strip typedefs past pointers too
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Paul Bolle <pebolle at tiscali dot nl>
- Cc: gdb-patches at sourceware dot org
- Date: Mon, 20 Sep 2010 12:04:17 +0200
- Subject: Re: [PATCH] [RFC] python: gdb.Type: strip typedefs past pointers too
- References: <1284753356.21566.10.camel@localhost.localdomain>
On Fri, 17 Sep 2010 21:55:56 +0200, Paul Bolle wrote:
> 1) I drafted a patch (pasted below this message) that works around this
> limitation:
>
> (gdb) ptype wchar_t
> type = long int
> (gdb) ptype wchar_t *
> type = long int *
What is the goal of this patch? strip_typedefs I understand to be the Python
interface to check_typedef.
check_typedef is there to prepare whatever type you get to a point where you
have something you can process as pointer/array/integer/etc. It also sets type
sizeof of the outer typedef to sizeof of the resolved inner type for opaque
types, depending on how they got resolved. With VLA patch the resolved size
also depends on the current/variable size.
I still do not see a use case why is it useful to resolve typedefs in the
inner sub-types. Some functions will call check_typedef again while
recursively processing the type anyway. What is your use case?
The strip_typedefs description should be fixed anyway as the text is now
ambiguous.
Regards,
Jan