summaryrefslogtreecommitdiff
path: root/gdb/value.h
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@broadcom.com>2013-12-17 17:18:44 +0000
committerAndrew Burgess <aburgess@broadcom.com>2013-12-17 17:24:15 +0000
commitbdf22206150b19e4903e9cbc520de2c49b2a2b7f (patch)
tree2e00051459ac6b8c2cf911b0a2497fb18a0ee29d /gdb/value.h
parent4a357820add595557dcd08d275288a4bcf43cbcb (diff)
downloadbinutils-gdb-bdf22206150b19e4903e9cbc520de2c49b2a2b7f.tar.gz
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.
Diffstat (limited to 'gdb/value.h')
-rw-r--r--gdb/value.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/value.h b/gdb/value.h
index db964e36e83..6b158df1933 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -436,6 +436,14 @@ extern int value_bits_synthetic_pointer (const struct value *value,
extern int value_bytes_available (const struct value *value,
int offset, int length);
+/* Given a value, determine whether the contents bits starting at
+ OFFSET and extending for LENGTH bits are available. This returns
+ nonzero if all bits in the given range are available, zero if any
+ bit is unavailable. */
+
+extern int value_bits_available (const struct value *value,
+ int offset, int length);
+
/* Like value_bytes_available, but return false if any byte in the
whole object is unavailable. */
extern int value_entirely_available (struct value *value);
@@ -450,6 +458,12 @@ extern int value_entirely_unavailable (struct value *value);
extern void mark_value_bytes_unavailable (struct value *value,
int offset, int length);
+/* Mark VALUE's content bits starting at OFFSET and extending for
+ LENGTH bits as unavailable. */
+
+extern void mark_value_bits_unavailable (struct value *value,
+ int offset, int length);
+
/* Compare LENGTH bytes of VAL1's contents starting at OFFSET1 with
LENGTH bytes of VAL2's contents starting at OFFSET2.