aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@broadcom.com>2013-07-30 15:36:18 +0000
committerAndrew Burgess <aburgess@broadcom.com>2013-07-30 15:36:18 +0000
commit11b4b7cc1fdcc85aeeb79d7bb1cac64542404cd5 (patch)
tree42d25c4ed0f79de5b0a208133d6aee8903601ce5 /gdb/value.c
parentb0c54aa509c4f909648c59837a4877ec27b64135 (diff)
downloadgdb-11b4b7cc1fdcc85aeeb79d7bb1cac64542404cd5.zip
gdb-11b4b7cc1fdcc85aeeb79d7bb1cac64542404cd5.tar.gz
gdb-11b4b7cc1fdcc85aeeb79d7bb1cac64542404cd5.tar.bz2
Don't raise an error for optimized out sub-fields.
http://sourceware.org/ml/gdb-patches/2013-07/msg00317.html gdb/ChangeLog * value.c (value_fetch_lazy): Mark optimized out values as such rather than raising an error. gdb/testsuite/ChangeLog * gdb.dwarf2/pieces-optimized-out.exp: Expect "<optimized out>" when printing an optimized out value. Expect an error when using an optimized out value in an expression.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/value.c b/gdb/value.c
index 8e0f8c4..8d635c7 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -3439,9 +3439,8 @@ value_fetch_lazy (struct value *val)
if (!value_bits_valid (parent,
TARGET_CHAR_BIT * offset + value_bitpos (val),
value_bitsize (val)))
- error (_("value has been optimized out"));
-
- if (!unpack_value_bits_as_long (value_type (val),
+ set_value_optimized_out (val, 1);
+ else if (!unpack_value_bits_as_long (value_type (val),
value_contents_for_printing (parent),
offset,
value_bitpos (val),