diff options
author | Pedro Alves <palves@redhat.com> | 2014-09-04 12:12:41 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2014-09-04 12:12:41 +0100 |
commit | 4875ffdbdaf7793524464c99baea1d8eb0cb7e34 (patch) | |
tree | adeee9d2e4e464c30928f8a3b45792cdd617d3f6 /gdb/value.h | |
parent | b138b7a9ed2564a8b1420f338d9f71cc3cf28880 (diff) | |
download | gdb-4875ffdbdaf7793524464c99baea1d8eb0cb7e34.zip gdb-4875ffdbdaf7793524464c99baea1d8eb0cb7e34.tar.gz gdb-4875ffdbdaf7793524464c99baea1d8eb0cb7e34.tar.bz2 |
Regression for i686 gdb.dwarf2/pieces-optimized-out.exp
Git 9a0dc9e3 regressed gdb.dwarf2/pieces-optimized-out.exp, visible on
i686 (the test doesn't run on x86_64):
(gdb) p s
-$1 = {a = 5, b = <optimized out>, c = <optimized out>, d = <optimized out>}
+$1 = {a = 5, b = <optimized out>, c = 0, d = 0}
-(gdb) PASS: gdb.dwarf2/pieces-optimized-out.exp: print s
+(gdb) FAIL: gdb.dwarf2/pieces-optimized-out.exp: print s
The regression was caused by this removal in cp-valprint.c:
@@ -293,12 +293,6 @@ cp_print_value_fields (struct type *type, struct type *real_type,
{
fputs_filtered (_("<synthetic pointer>"), stream);
}
- else if (!value_bits_valid (val,
- TYPE_FIELD_BITPOS (type, i),
- TYPE_FIELD_BITSIZE (type, i)))
- {
- val_print_optimized_out (val, stream);
- }
else
{
struct value_print_options opts = *options;
The idea was that we'd just fallback to calling value_field_bitfield,
which handles unavailable values (in unpack_value_bits_as_long_1) so
should be able to handle optimized out values too. Alas, it doesn't.
This is currently a bit too messy. Instead of teaching
unpack_value_bits_as_long_1 about optimized out bits, let's bite the
bullet and teach the value code to handle partially optimized out
bitfield, by having it unpack a bitfield and then propagate the range
metadata. Turns out the resulting code looks simpler and clearer.
Tested on x86_64 Fedora 20, -m64/-m32.
gdb/ChangeLog:
* value.c (value_ranges_copy_adjusted): New function, factored out
from ...
(value_contents_copy_raw): ... here.
(unpack_value_bits_as_long_1): Rename back to ...
(unpack_bits_as_long): ... this. Remove 'original_value' and
'result' parameters. Change return type to LONGEST.
(unpack_value_bits_as_long): Delete.
(unpack_value_field_as_long_1): Delete.
(unpack_value_field_as_long, unpack_field_as_long): Reimplement.
(unpack_value_bitfield): New function.
(value_field_bitfield): Reimplement using unpack_value_bitfield.
(value_fetch_lazy): Use unpack_value_bitfield.
* value.h (unpack_value_bits_as_long): Delete declaration.
Diffstat (limited to 'gdb/value.h')
-rw-r--r-- | gdb/value.h | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/gdb/value.h b/gdb/value.h index 5d4949c..4cdbf21 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -606,13 +606,6 @@ extern DOUBLEST unpack_double (struct type *type, const gdb_byte *valaddr, int *invp); extern CORE_ADDR unpack_pointer (struct type *type, const gdb_byte *valaddr); -extern int unpack_value_bits_as_long (struct type *field_type, - const gdb_byte *valaddr, - int embedded_offset, int bitpos, - int bitsize, - const struct value *original_value, - LONGEST *result); - extern LONGEST unpack_field_as_long (struct type *type, const gdb_byte *valaddr, int fieldno); |