aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@broadcom.com>2013-07-30 15:05:01 +0000
committerAndrew Burgess <aburgess@broadcom.com>2013-07-30 15:05:01 +0000
commitb0c54aa509c4f909648c59837a4877ec27b64135 (patch)
treeb00e275b58a0b200e895cb0e6d5992a0ad8c0fad /gdb/value.c
parent97c85fc673064bcd05bbdf1dd7a76eb7a9e6a1d2 (diff)
downloadgdb-b0c54aa509c4f909648c59837a4877ec27b64135.zip
gdb-b0c54aa509c4f909648c59837a4877ec27b64135.tar.gz
gdb-b0c54aa509c4f909648c59837a4877ec27b64135.tar.bz2
value_fetch_lazy, ensure parent is not lazy and check parent for validity.
http://sourceware.org/ml/gdb-patches/2013-07/msg00316.html gdb/ChangeLog * value.c (value_fetch_lazy): Ensure parent value is not lazy before checking which bits of the parent, not the child, value are valid. gdb/testsuite/ChangeLog * gdb.dwarf2/pieces-optimized-out.exp: New file. * gdb.dwarf2/pieces-optimized-out.c: New file. * gdb.dwarf2/pieces-optimized-out.S: New file.
Diffstat (limited to 'gdb/value.c')
-rw-r--r--gdb/value.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/value.c b/gdb/value.c
index 04f325f..8e0f8c4 100644
--- a/gdb/value.c
+++ b/gdb/value.c
@@ -3433,7 +3433,10 @@ value_fetch_lazy (struct value *val)
LONGEST offset = value_offset (val);
LONGEST num;
- if (!value_bits_valid (val,
+ if (value_lazy (parent))
+ value_fetch_lazy (parent);
+
+ if (!value_bits_valid (parent,
TARGET_CHAR_BIT * offset + value_bitpos (val),
value_bitsize (val)))
error (_("value has been optimized out"));