Fix bug in value_bits_valid.
authorAndrew Burgess <aburgess@broadcom.com>
Mon, 8 Jul 2013 10:21:33 +0000 (10:21 +0000)
committerAndrew Burgess <aburgess@broadcom.com>
Mon, 8 Jul 2013 10:21:33 +0000 (10:21 +0000)
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/ChangeLog
gdb/value.c

index 09d5aac2f9ebc138de6d18863fc0a7f809cc0a46..fad36f455178d53f5582c52ae3e77eedab9947b4 100644 (file)
@@ -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
index 353f62a2caac5bcd1d53cf1bf28ff0ebb09d08f6..1be1845657445bd8b32a42099959685e7efe9e41 100644 (file)
@@ -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
This page took 0.02846 seconds and 4 git commands to generate.