[PATCH] [1/2] value_fetch_lazy - ensure parent is not lazy before accessing.

Pedro Alves palves@redhat.com
Tue Jul 30 14:45:00 GMT 2013


On 07/11/2013 03:34 PM, Andrew Burgess wrote:
> Hi,
> 
> Within value_fetch_lazy, for bit field values we
> make use of the parent value without first checking
> that the parent is not lazy.

> -      if (!value_bits_valid (val,
> +      if (value_lazy (parent))
> +	value_fetch_lazy (parent);
> +
> +      if (!value_bits_valid (parent,

The:

> -      if (!value_bits_valid (val,
> +      if (!value_bits_valid (parent,

change gave me pause, as it wasn't mentioned in the email.
It just looked like a mistake in your patch, as one would
only expect the new value_fetch_lazy call, and nothing else.
But, looking deeper, AFAICS, that change is correct, we were
looking at the wrong value, even if the lazy issue didn't exist.
Please correct me if I'm wrong.  (I'd have preferred that bit to
have been a separate, preparatory change with its own
justification, or at least that this had been mentioned in the
email.  Don't assume what's obvious to you is obvious to others.)

> 2013-07-11  Andrew Burgess  <aburgess@broadcom.com>
>
> 	* value.c (value_fetch_lazy): Ensure parent value is not lazy
> 	before checking which bits of the parent are valid.
>
> gdb/testsuite/ChangeLog
>
> 2013-07-11  Andrew Burgess  <aburgess@broadcom.com>
>
> 	* gdb.dwarf2/pieces-optimized-out.exp: New file.
> 	* gdb.dwarf2/pieces-optimized-out.c: New file.
> 	* gdb.dwarf2/pieces-optimized-out.S: New file.

OK.

-- 
Pedro Alves



More information about the Gdb-patches mailing list