From bdf22206150b19e4903e9cbc520de2c49b2a2b7f Mon Sep 17 00:00:00 2001 From: Andrew Burgess Date: Tue, 17 Dec 2013 17:18:44 +0000 Subject: Convert the unavailable vector to be bit, not byte, based. https://sourceware.org/ml/gdb-patches/2013-12/msg00144.html The vector of unavailable parts of a value is currently byte based. Given that we can model a value down to the bit level, we can potentially loose information with the current implementation. After this patch we model the unavailable information in bits. gdb/ChangeLog * dwarf2loc.c (read_pieced_value): Mark bits, not bytes unavailable, use correct bit length. * value.c (struct value): Extend comment on unavailable to indicate that it is bit based. (value_bits_available): New function. (value_bytes_available): Call value_bits_available. (value_entirely_available): Check against the bit length, not byte length. (mark_value_bits_unavailable): New function. (mark_value_bytes_unavailable): Move contents to mark_value_bits_unavailable, call to same. (memcmp_with_bit_offsets): New function. (value_available_contents_bits_eq): New function, takes the functionality from value_available_contents_eq but uses memcmp_with_bit_offsets now, and is bit not byte based. (value_available_contents_eq): Move implementation into value_available_contents_bits_eq, call to same. (value_contents_copy_raw): Work on bits, not bytes. (unpack_value_bits_as_long_1): Check availability in bits, not bytes. * value.h (value_bits_available): Declare new function. (mark_value_bits_unavailable): Declare new function. gdb/testsuite/ChangeLog * gdb.trace/unavailable-dwarf-piece.c: New file. * gdb.trace/unavailable-dwarf-piece.exp: New file. --- gdb/dwarf2loc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gdb/dwarf2loc.c') diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c index 2b1f323..7b911b1 100644 --- a/gdb/dwarf2loc.c +++ b/gdb/dwarf2loc.c @@ -1709,7 +1709,7 @@ read_pieced_value (struct value *v) if (optim) set_value_optimized_out (v, 1); if (unavail) - mark_value_bytes_unavailable (v, offset, this_size); + mark_value_bits_unavailable (v, offset, this_size_bits); } } else -- cgit v1.1