aboutsummaryrefslogtreecommitdiff
path: root/gdb/value.h
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2011-02-16 10:13:53 +0000
committerPedro Alves <palves@redhat.com>2011-02-16 10:13:53 +0000
commitcd24cfaa4f49cd34f25ef0bd97f8e52fc885b0b1 (patch)
tree261236416ac55f3439886ffa245d4652f3092740 /gdb/value.h
parent60bbf3380ac7d9e1f24e3497b2cea852731a6654 (diff)
downloadgdb-cd24cfaa4f49cd34f25ef0bd97f8e52fc885b0b1.zip
gdb-cd24cfaa4f49cd34f25ef0bd97f8e52fc885b0b1.tar.gz
gdb-cd24cfaa4f49cd34f25ef0bd97f8e52fc885b0b1.tar.bz2
* value.c (value_available_contents_eq): Remove redundant local
variables. Fix available contents comparision. * value.h (value_available_contents_eq): Extend describing comment.
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