This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] [Ada] Fix handling of array renamings
- From: Pierre-Marie de Rodat <derodat at adacore dot com>
- To: Joel Brobecker <brobecker at adacore dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 3 Sep 2015 09:27:03 +0200
- Subject: Re: [PATCH] [Ada] Fix handling of array renamings
- Authentication-results: sourceware.org; auth=none
- References: <1441178473-18654-1-git-send-email-derodat at adacore dot com> <20150902235954 dot GC3356 at adacore dot com>
On 09/03/2015 01:59 AM, Joel Brobecker wrote:
Generally speaking, we try very hard to avoid dereferencing objects,
especially arrays or structs, as this opens the door for accidently
fetching the entire object in situations where only one element was
needed. Since we are dealing with array subscripting, this is
necessarily the case here.
I guess you are referring to the call to coerce_ref my patch introduces.
My understanding was that this does not actually fetch the data but
instead creates a lazy value (see the call to value_at_lazy in
value.c:coerce_ref) from the reference "pointer", hence not fetching any
data beyond maybe the reference "pointer" itself.
Perhaps the object's lifetime is constrained and thus currently would
never trigger that excessive fetch.
Hm... I don't understand: about what object are you talking? The struct
value * in GDB? Why does its lifetime influences whether it is fetched?
But I need to look at the rest of the code in that function more
carefully to assess it, and I am too short on time now to do it.
I'll review again when I get back...
Sure, there's no hurry. :-) Thank you for reviewing, Joel!
--
Pierre-Marie de Rodat