diff options
author | Andreas Arnez <arnez@linux.vnet.ibm.com> | 2017-06-13 15:20:31 +0200 |
---|---|---|
committer | Andreas Arnez <arnez@linux.vnet.ibm.com> | 2017-06-13 15:20:31 +0200 |
commit | 23f945bf8cebf348154aff43782de2e1977e9230 (patch) | |
tree | f4117bc4ecbce340ec673335ca084de240bdb969 /gdb/value.h | |
parent | f236533e3c6a2693bea879b2a4d24d1229864ac9 (diff) | |
download | binutils-23f945bf8cebf348154aff43782de2e1977e9230.zip binutils-23f945bf8cebf348154aff43782de2e1977e9230.tar.gz binutils-23f945bf8cebf348154aff43782de2e1977e9230.tar.bz2 |
Fix bit-/byte-offset mismatch in parameter to read_value_memory
The function read_value_memory accepts a parameter embedded_offset and
expects it to represent the byte offset into the given value. However,
the only invocation with a possibly non-zero embedded_offset happens in
read_pieced_value, where a bit offset is passed instead.
Adjust the implementation of read_value_memory to meet the caller's
expectation. This implicitly fixes the invocation in read_pieced_value.
gdb/ChangeLog:
* valops.c (read_value_memory): Change embedded_offset to
represent a bit offset instead of a byte offset.
* value.h (read_value_memory): Adjust comment.
Diffstat (limited to 'gdb/value.h')
-rw-r--r-- | gdb/value.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/gdb/value.h b/gdb/value.h index a1d1609..fb7f13d 100644 --- a/gdb/value.h +++ b/gdb/value.h @@ -581,12 +581,11 @@ extern int value_contents_eq (const struct value *val1, LONGEST offset1, /* Read LENGTH addressable memory units starting at MEMADDR into BUFFER, which is (or will be copied to) VAL's contents buffer offset by - EMBEDDED_OFFSET (that is, to &VAL->contents[EMBEDDED_OFFSET]). - Marks value contents ranges as unavailable if the corresponding - memory is likewise unavailable. STACK indicates whether the memory - is known to be stack memory. */ + BIT_OFFSET bits. Marks value contents ranges as unavailable if + the corresponding memory is likewise unavailable. STACK indicates + whether the memory is known to be stack memory. */ -extern void read_value_memory (struct value *val, LONGEST embedded_offset, +extern void read_value_memory (struct value *val, LONGEST bit_offset, int stack, CORE_ADDR memaddr, gdb_byte *buffer, size_t length); |