Re: [PATCH 02/23] dwarf: add DW_AT_data_location support

Jan Kratochvil
2014-06-14T13:21:39Z

On Tue, 10 Jun 2014 14:10:14 +0200, Joel Brobecker wrote:
> > --- a/gdb/gdbtypes.c
> > +++ b/gdb/gdbtypes.c
> > @@ -1635,8 +1635,12 @@ is_dynamic_type (struct type *type)
> > or the elements it contains have a dynamic contents. */
> > if (is_dynamic_type (TYPE_INDEX_TYPE (type)))
> > return 1;
> > - else
> > - return is_dynamic_type (TYPE_TARGET_TYPE (type));
> > + else if (TYPE_DATA_LOCATION (type) != NULL
> > + && (TYPE_DATA_LOCATION_KIND (type) == PROP_LOCEXPR
> > + || TYPE_DATA_LOCATION_KIND (type) == PROP_LOCLIST))
> > + return 1;
> > + else
> > + return is_dynamic_type (TYPE_TARGET_TYPE (type));
>
> The comment needs to be updated. Your change is also splitting
> the "if bounds or contents is dynamic" logic. Perhaps you could
> simply add the data-location check at the start of the function
> with a command that says: A type which has a data_location which
> [bla bla] is a dynamic type

The indentation is somehow incorrect there.

Jan