From b0c54aa509c4f909648c59837a4877ec27b64135 Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Tue, 30 Jul 2013 15:05:01 +0000 Subject: 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. --- gdb/value.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'gdb/value.c') 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")); -- cgit v1.1