aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/value.h')
-rw-r--r--gdb/value.h21
1 files changed, 15 insertions, 6 deletions
diff --git a/gdb/value.h b/gdb/value.h
index b8ce97b..e019e56 100644
--- a/gdb/value.h
+++ b/gdb/value.h
@@ -379,12 +379,21 @@ extern void mark_value_bytes_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. Returns true
- iff the set of available contents match. Unavailable contents
- compare equal with unavailable contents, and different with any
- available byte. For example, if 'x's represent an unavailable
- byte, and 'V' and 'Z' represent different available bytes, in a
- value with length 16:
+ LENGTH bytes of VAL2's contents starting at OFFSET2.
+
+ Note that "contents" refers to the whole value's contents
+ (value_contents_all), without any embedded offset adjustment. For
+ example, to compare a complete object value with itself, including
+ its enclosing type chunk, you'd do:
+
+ int len = TYPE_LENGTH (check_typedef (value_enclosing_type (val)));
+ value_available_contents (val, 0, val, 0, len);
+
+ Returns true iff the set of available contents match. Unavailable
+ contents compare equal with unavailable contents, and different
+ with any available byte. For example, if 'x's represent an
+ unavailable byte, and 'V' and 'Z' represent different available
+ bytes, in a value with length 16:
offset: 0 4 8 12 16
contents: xxxxVVVVxxxxVVZZ