diff options
author | Andrew Burgess <aburgess@broadcom.com> | 2013-07-30 15:36:18 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@broadcom.com> | 2013-07-30 15:36:18 +0000 |
commit | 11b4b7cc1fdcc85aeeb79d7bb1cac64542404cd5 (patch) | |
tree | 42d25c4ed0f79de5b0a208133d6aee8903601ce5 /gdb | |
parent | b0c54aa509c4f909648c59837a4877ec27b64135 (diff) | |
download | gdb-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')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp | 5 | ||||
-rw-r--r-- | gdb/value.c | 5 |
4 files changed, 16 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index fd02aa4..33e7c98 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2013-07-30 Andrew Burgess <aburgess@broadcom.com> + * value.c (value_fetch_lazy): Mark optimized out values as such + rather than raising an error. + +2013-07-30 Andrew Burgess <aburgess@broadcom.com> + * value.c (value_fetch_lazy): Ensure parent value is not lazy before checking which bits of the parent, not the child, value are valid. diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 666d083..58c2dd7 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2013-07-30 Andrew Burgess <aburgess@broadcom.com> + * 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. + +2013-07-30 Andrew Burgess <aburgess@broadcom.com> + * gdb.dwarf2/pieces-optimized-out.exp: New file. * gdb.dwarf2/pieces-optimized-out.c: New file. * gdb.dwarf2/pieces-optimized-out.S: New file. diff --git a/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp b/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp index 2e4d028..4effb30 100644 --- a/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp +++ b/gdb/testsuite/gdb.dwarf2/pieces-optimized-out.exp @@ -44,6 +44,7 @@ gdb_test "p s" \ "print s" gdb_test "p s.a" " = 5" "print s.a" gdb_test "p s.b" " = <optimized out>" "print s.b" -gdb_test "p s.c" "value has been optimized out" "print s.c" -gdb_test "p s.d" "value has been optimized out" "print s.d" +gdb_test "p s.c" " = <optimized out>" "print s.c" +gdb_test "p s.d" " = <optimized out>" "print s.d" +gdb_test "p s.d + 1" "value has been optimized out" "print s.d + 1" 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), |