This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] ada-lang.c:coerce_unspec_val_to_type: Preserve laziness.


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]