summaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authoraburgess <aburgess>2013-07-08 10:21:33 +0000
committeraburgess <aburgess>2013-07-08 10:21:33 +0000
commit9f5e30f7cf73a3256fbb9a265c897aa3f2c91439 (patch)
tree8ea5aa58e7cceb62c828923af48729e16332f1a6 /gdb/value.c
parent59f2be5e4349279d67dfb81a9674b3ed6bd53437 (diff)
downloadgdb-9f5e30f7cf73a3256fbb9a265c897aa3f2c91439.tar.gz
Fix bug in value_bits_valid.
http://sourceware.org/ml/gdb-patches/2013-07/msg00174.html * value.c (value_bits_valid): If the value is not lval_computed or has no check validity handler then the answer is the optimized_out flag, otherwise defer to the handler.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/gdb/value.c b/gdb/value.c
index 353f62a2caa..1be18456574 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -1082,13 +1082,12 @@ value_entirely_optimized_out (const struct value *value)
int
value_bits_valid (const struct value *value, int offset, int length)
{
- if (!value->optimized_out)
- return 1;
if (value->lval != lval_computed
|| !value->location.computed.funcs->check_validity)
- return 1;
- return value->location.computed.funcs->check_validity (value, offset,
- length);
+ return !value->optimized_out;
+ else
+ return value->location.computed.funcs->check_validity (value, offset,
+ length);
}
int