diff options
author | Andrew Burgess <aburgess@broadcom.com> | 2013-07-08 10:21:33 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@broadcom.com> | 2013-07-08 10:21:33 +0000 |
commit | ad0f030310315704eeb4651460edb548fad21a02 (patch) | |
tree | 5f7d47afaf072ba282cb361eaa1cf43319a13620 | |
parent | 0cbbe1b85eef405c0ddb22389f85a65d8a8bf28c (diff) | |
download | gdb-ad0f030310315704eeb4651460edb548fad21a02.zip gdb-ad0f030310315704eeb4651460edb548fad21a02.tar.gz gdb-ad0f030310315704eeb4651460edb548fad21a02.tar.bz2 |
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.
-rw-r--r-- | gdb/ChangeLog | 7 | ||||
-rw-r--r-- | gdb/value.c | 9 |
2 files changed, 11 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 09d5aac..fad36f4 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2013-07-08 Andrew Burgess <aburgess@broadcom.com> + Pedro Alves <palves@redhat.com> + + * 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. + 2013-07-06 Eli Zaretskii <eliz@gnu.org> * top.c (print_gdb_configuration): Explain in output of 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 |