From ad0f030310315704eeb4651460edb548fad21a02 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Mon, 8 Jul 2013 10:21:33 +0000 Subject: 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. --- gdb/value.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'gdb/value.c') diff --git a/gdb/value.c b/gdb/value.c index 353f62a..1be1845 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 -- cgit v1.1