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] [RFC] python: gdb.Type: strip typedefs past pointers too


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


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