Re: [PATCH 1/2] gdb: include allocated/associated properties in 'maint print type'

Simon Marchi via Gdb-patches
2020-12-24T05:41:31Z

On 2020-12-23 6:53 p.m., Andrew Burgess wrote:
> Adds the allocated and associated dynamic properties into the output
> of the 'maintenance print type' command.
>
> gdb/ChangeLog:
>
> * gdbtypes (recursive_dump_type): Include allocated and associated
> properties.
> ---
> gdb/ChangeLog | 5 +++++
> gdb/gdbtypes.c | 18 ++++++++++++++++++
> 2 files changed, 23 insertions(+)
>
> diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c
> index 569e7a3e659..8e90c4b108b 100644
> --- a/gdb/gdbtypes.c
> +++ b/gdb/gdbtypes.c
> @@ -5269,6 +5269,24 @@ recursive_dump_type (struct type *type, int spaces)
> }
> puts_filtered ("\n");
> printf_filtered ("%*snfields %d ", spaces, "", type->num_fields ());
> + if (TYPE_ASSOCIATED_PROP (type) != nullptr
> + || TYPE_ALLOCATED_PROP (type) != nullptr)
> + {
> + printf_filtered ("%*s", spaces, "");
> + if (TYPE_ASSOCIATED_PROP (type) != nullptr)
> + {
> + printf_filtered ("associated ");
> + dump_dynamic_prop (*TYPE_ASSOCIATED_PROP (type));
> + }
> + if (TYPE_ALLOCATED_PROP (type) != nullptr)
> + {
> + if (TYPE_ASSOCIATED_PROP (type))

!= nullptr

Otherwise, LGTM.

Simon