with LENGTH bits of VAL2's contents starting at OFFSET2 bits.
Return true if the available bits match. */
-static int
+static bool
value_contents_bits_eq (const struct value *val1, int offset1,
const struct value *val2, int offset2,
int length)
if (!find_first_range_overlap_and_match (&rp1[i], &rp2[i],
offset1, offset2, length,
&l_tmp, &h_tmp))
- return 0;
+ return false;
/* We're interested in the lowest/first range found. */
if (i == 0 || l_tmp < l)
/* Compare the available/valid contents. */
if (memcmp_with_bit_offsets (val1->contents, offset1,
val2->contents, offset2, l) != 0)
- return 0;
+ return false;
length -= h;
offset1 += h;
offset2 += h;
}
- return 1;
+ return true;
}
-int
+bool
value_contents_eq (const struct value *val1, LONGEST offset1,
const struct value *val2, LONGEST offset2,
LONGEST length)
then:
- value_contents_eq(val, 0, val, 8, 6) => 1
- value_contents_eq(val, 0, val, 4, 4) => 0
- value_contents_eq(val, 0, val, 8, 8) => 0
- value_contents_eq(val, 4, val, 12, 2) => 1
- value_contents_eq(val, 4, val, 12, 4) => 0
- value_contents_eq(val, 3, val, 4, 4) => 0
+ value_contents_eq(val, 0, val, 8, 6) => true
+ value_contents_eq(val, 0, val, 4, 4) => false
+ value_contents_eq(val, 0, val, 8, 8) => false
+ value_contents_eq(val, 4, val, 12, 2) => true
+ value_contents_eq(val, 4, val, 12, 4) => true
+ value_contents_eq(val, 3, val, 4, 4) => true
If 'x's represent an unavailable byte, 'o' represents an optimized
out byte, in a value with length 8:
then:
- value_contents_eq(val, 0, val, 2, 2) => 1
- value_contents_eq(val, 4, val, 6, 2) => 1
- value_contents_eq(val, 0, val, 4, 4) => 0
+ value_contents_eq(val, 0, val, 2, 2) => true
+ value_contents_eq(val, 4, val, 6, 2) => true
+ value_contents_eq(val, 0, val, 4, 4) => true
We only know whether a value chunk is unavailable or optimized out
if we've tried to read it. As this routine is used by printing
after the inferior is gone, it works with const values. Therefore,
this routine must not be called with lazy values. */
-extern int value_contents_eq (const struct value *val1, LONGEST offset1,
- const struct value *val2, LONGEST offset2,
- LONGEST length);
+extern bool value_contents_eq (const struct value *val1, LONGEST offset1,
+ const struct value *val2, LONGEST offset2,
+ LONGEST length);
/* Read LENGTH addressable memory units starting at MEMADDR into BUFFER,
which is (or will be copied to) VAL's contents buffer offset by