This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] ada-lang.c:coerce_unspec_val_to_type: Preserve laziness.
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: Andrew Burgess <aburgess at broadcom dot com>, gdb-patches at sourceware dot org
- Date: Fri, 26 Jul 2013 18:08:03 +0100
- Subject: Re: [PATCH] ada-lang.c:coerce_unspec_val_to_type: Preserve laziness.
- References: <20130704182244 dot 16683 dot 55719 dot stgit at brno dot lan> <51D6A00A dot 2050803 at broadcom dot com> <51D6A2CE dot 7080502 at redhat dot com> <87mwpugwxy dot fsf at fleche dot redhat dot com>
On 07/10/2013 06:13 PM, Tom Tromey wrote:
>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
>
> Pedro> That works, but I had originally discarded such an approach
> Pedro> because it looked brittle to me. E.g., I was toying with optimizing
> Pedro> value_optimized_out by only fetching lazy values if it really can't
> Pedro> avoid it, and such a change would render this subtly broken.
>
> This code in ada-lang.c and similar code elsewhere always seems to me to
> be a call for a new value copy-constructor that takes a type argument.
> Then any necessary wackiness can be isolated in value.c.
Yeah! The deprecated_set_value_type calls have tended to morph into things
like that. I had actually started out with something like that, noticing
that this Ada code is like a reinterpret cast. I did something based on
refactoring value_copy, but wasn't getting happy with the results (or rather,
the time it was taking me), so I gave up. But I'd definitely support
it if someone went along those lines.
--
Pedro Alves