Revert recent changes to value_bits_valid.
authorAndrew Burgess <aburgess@broadcom.com>
Tue, 9 Jul 2013 14:11:53 +0000 (14:11 +0000)
committerAndrew Burgess <aburgess@broadcom.com>
Tue, 9 Jul 2013 14:11:53 +0000 (14:11 +0000)
  http://sourceware.org/ml/gdb-patches/2013-07/msg00243.html

  * value.c (value_bits_valid): Revert previous change, and change
  by Pedro on 2013-07-04, due to regressions in
  gdb.dwarf2/implptr.exp and gdb.dwarf2/pieces.exp.

gdb/ChangeLog
gdb/value.c

index fad36f455178d53f5582c52ae3e77eedab9947b4..f31edc51f5a59ef96d27abe7182fe17814da841c 100644 (file)
@@ -1,3 +1,9 @@
+2013-07-09  Andrew Burgess  <aburgess@broadcom.com>
+
+       * value.c (value_bits_valid): Revert previous change, and change
+       by Pedro on 2013-07-04, due to regressions in
+       gdb.dwarf2/implptr.exp and gdb.dwarf2/pieces.exp.
+
 2013-07-08  Andrew Burgess  <aburgess@broadcom.com>
             Pedro Alves  <palves@redhat.com>
 
index 1be1845657445bd8b32a42099959685e7efe9e41..ce4b13a17a2a74f0a70963cfe34d80b8d2b9f3ea 100644 (file)
@@ -1082,12 +1082,13 @@ 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 !value->optimized_out;
-  else
-    return value->location.computed.funcs->check_validity (value, offset,
-                                                          length);
+    return 0;
+  return value->location.computed.funcs->check_validity (value, offset,
+                                                        length);
 }
 
 int