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 3/3] gdb: Show type summary for anonymous structures from c_print_typedef


On 7/19/19 10:06 PM, Andrew Burgess wrote:

>     An additional area of interest is how C++ handles anonymous types used
>     within a typedef; enums are handled basically inline with how C
>     handles them, but structs (and classes) are slightly different.  The
>     behaviour before the patch is different, and is unchanged by this
>     patch.  Consider this code compiled for C++:
>     
>        typedef struct {
>          int i;
>        } struct_t;
>     
>     Both before and after this patch, this is show by 'info types' as:
>     
>        3:      typedef struct_t struct_t;

Curious, and odd.

>     gdb/ChangeLog:
>     
>             * c-typeprint.c (c_print_typedef): Pass -1 instead of 0 to
>             type_print.
>     
>     gdb/testsuite/ChangeLog:
>     
>             * gdb.ada/info_auto_lang.exp: Update expected results.
>             * gdb.base/info-types.c: Add additional types to check.
>             * gdb.base/info-types.exp: Update expected results.

LGTM.

Thanks,
Pedro Alves


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