[PATCH 3/3] gdb: Show type summary for anonymous structures from c_print_typedef

Pedro Alves palves@redhat.com
Sat Jul 20 13:47:00 GMT 2019


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



More information about the Gdb-patches mailing list