From 5467c6c807fb015675b2f1b7c2e012893b998d7c Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 14 Feb 2011 11:25:59 +0000 Subject: gdb/ * value.h (unpack_bits_as_long): Delete declaration. (unpack_value_bits_as_long): Declare. (unpack_value_field_as_long): Declare. (value_field_bitfield): Declare. * value.c (unpack_bits_as_long): Rename to... (unpack_value_bits_as_long_1): ... this. Add embedded_offset and value parameters. Return the extracted result in a new output parameter. If the value contents are unavailable, return false, otherwise return true. (unpack_value_bits_as_long): New. (unpack_field_as_long): Rename to... (unpack_value_field_as_long_1): ... this. Add embedded_offset and Add embedded_offset and value parameters. Return the extracted result in a new output parameter. If the value contents are unavailable, return false, otherwise return true. (unpack_value_field_as_long): New. (unpack_field_as_long_1): New. (unpack_field_as_long): Reimplement as wrapper around unpack_value_field_as_long_1. (value_field_bitfield): New function. * valops.c (value_fetch_lazy): When fetching a bitfield, use unpack_value_bits_as_long. Mark the value as unavailable, if it is unavailable. * jv-valprint.c (java_print_value_fields): Use value_field_bitfield. * p-valprint.c (pascal_object_print_value_fields): Use value_field_bitfield. * cp-valprint.c (cp_print_value_fields): Use value_field_bitfield. --- gdb/p-valprint.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'gdb/p-valprint.c') diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c index 8e79070..7031a77 100644 --- a/gdb/p-valprint.c +++ b/gdb/p-valprint.c @@ -810,9 +810,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, { struct value_print_options opts = *options; - v = value_from_longest (TYPE_FIELD_TYPE (type, i), - unpack_field_as_long (type, - valaddr + offset, i)); + v = value_field_bitfield (type, i, valaddr, offset, val); opts.deref_ref = 0; common_val_print (v, stream, recurse + 1, &opts, @@ -831,9 +829,7 @@ pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, v4.17 specific. */ struct value *v; - v = value_from_longest - (TYPE_FIELD_TYPE (type, i), - unpack_field_as_long (type, valaddr + offset, i)); + v = value_field_bitfield (type, i, valaddr, offset, val); if (v == NULL) val_print_optimized_out (stream); -- cgit v1.1