This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Do not consider reference types as dynamic
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Pierre-Marie de Rodat <derodat at adacore dot com>
- Cc: Yao Qi <qiyaoltc at gmail dot com>, GDB Patches <gdb-patches at sourceware dot org>
- Date: Fri, 17 Apr 2015 08:30:04 -0700
- Subject: Re: [PATCH] Do not consider reference types as dynamic
- Authentication-results: sourceware.org; auth=none
- References: <54FEDC09 dot 3050106 at adacore dot com> <20150323133627 dot GG5438 at adacore dot com> <551BB1C9 dot 10006 at adacore dot com> <551E5309 dot 7090509 at adacore dot com> <86k2xbrpzs dot fsf at gmail dot com> <5530EC8C dot 1070308 at adacore dot com> <553121B2 dot 1040406 at adacore dot com>
> If the definition above is correct, then we should enhance
> typeprint.c/c-typeprint.c/etc. to resolve dynamic type as type
> printing goes in order to get the actual array bounds in the output.
> This means: propagating a (possibly null) value in a lot of
> functions and use it for type resolution when possible. I guess this
> would involve a big patch but would also cover the "ptype" case.
>
> I guess another way to "just get things working" would be to revert
> my previous patch and to enhance the dynamic property mechanism
> (dwarf2loc.h) to handle reference values that are not present in
> memory. For instance: extend the property_addr_info structure to
> hold either the address of objects (as today) or the address of the
> referenced object (for reference types).
>
> Thoughts?
Thanks for looking into that, Pierre-Marie.
My 2 cents, based on the little amount of experience we've had dealing
with dyanmic types in Ada, and the amount of experience we've had
dealing with the GNAT encodings, I have a feeling that it's best to
maintain reference types as being non-dynamic, and enhance the functions
that print reference objects instead. We should probably compare what
Ada does (ada_val_print_ref) compared to C, for instance, as we handle
those reference values correctly, I believe.
--
Joel