This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 02/23] dwarf: add DW_AT_data_location support
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: Keven Boell <keven dot boell at intel dot com>, gdb-patches at sourceware dot org, sanimir dot agovic at intel dot com, Tom Tromey <tromey at redhat dot com>
- Date: Sat, 14 Jun 2014 15:21:28 +0200
- Subject: Re: [PATCH 02/23] dwarf: add DW_AT_data_location support
- Authentication-results: sourceware.org; auth=none
- References: <1401861266-6240-1-git-send-email-keven dot boell at intel dot com> <1401861266-6240-3-git-send-email-keven dot boell at intel dot com> <20140610121014 dot GA6480 at adacore dot com>
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