value_bits_valid: Fix latent bug.
Doing something else, I factored out the bits of the value_bits_valid function that actually handle the check_validity hook, and surprisingly found out that the result was misbehaving. Turns out value_bits_valid has a latent bug. If the value is not lval_computed, or doesn't have a check_validity hook, then we should assume the value is entirely valid, not invalid. This is currently masked by the value->optimized_out check -- I ran the testsuite with a gdb_assert(0) inserted in place of that return being touched by the patch, and it never triggers. Tested on x86_64 Fedora 17. gdb/ 2013-07-04 Pedro Alves <palves@redhat.com> * value.c (value_bits_valid): If the value is not lval_computed, or doesn't have a check_validity hook, assume the value is entirely valid.
This commit is contained in:
parent
691a26f5dd
commit
58722cac5a
@ -1,3 +1,9 @@
|
||||
2013-07-04 Pedro Alves <palves@redhat.com>
|
||||
|
||||
* value.c (value_bits_valid): If the value is not lval_computed,
|
||||
or doesn't have a check_validity hook, assume the value is entirely
|
||||
valid.
|
||||
|
||||
2013-07-04 Andrew Burgess <aburgess@broadcom.com>
|
||||
|
||||
* stack.c (read_frame_arg): No longer fetch lazy values.
|
||||
|
@ -1086,7 +1086,7 @@ value_bits_valid (const struct value *value, int offset, int length)
|
||||
return 1;
|
||||
if (value->lval != lval_computed
|
||||
|| !value->location.computed.funcs->check_validity)
|
||||
return 0;
|
||||
return 1;
|
||||
return value->location.computed.funcs->check_validity (value, offset,
|
||||
length);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user