diff options
author | Yao Qi <yao.qi@linaro.org> | 2016-04-22 17:18:31 +0100 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2016-04-22 17:20:24 +0100 |
commit | 6d7e9d3b8dbbf46a0cd5dc4f6341c1f9eb8cd6ae (patch) | |
tree | 26c37f7af54667ac9b735c57ae8bf907063f9662 | |
parent | b3f11165aad39586cca0352ed5fe32b721699c76 (diff) | |
download | gdb-6d7e9d3b8dbbf46a0cd5dc4f6341c1f9eb8cd6ae.zip gdb-6d7e9d3b8dbbf46a0cd5dc4f6341c1f9eb8cd6ae.tar.gz gdb-6d7e9d3b8dbbf46a0cd5dc4f6341c1f9eb8cd6ae.tar.bz2 |
Choose TARGET_OBJECT_STACK_MEMORY and TARGET_OBJECT_MEMORY in read_value_memory
Before this patch
https://sourceware.org/ml/gdb-patches/2014-02/msg00709.html
read_value_memory checks parameter 'stack', and call read_stack or
read_memory respectively. However, 'stack' is not checked and
TARGET_OBJECT_MEMORY is always used in target_xfer_partial, which is
a mistake in the patch above.
This patch checks parameter 'stack', and choose TARGET_OBJECT_MEMORY
or TARGET_OBJECT_STACK_MEMORY accordingly.
gdb:
2016-04-22 Yao Qi <yao.qi@linaro.org>
* valops.c (read_value_memory): New local variable 'stack'.
Set it to either TARGET_OBJECT_STACK_MEMORY or
TARGET_OBJECT_MEMORY.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/valops.c | 5 |
2 files changed, 10 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 512344c..56f9644 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2016-04-22 Yao Qi <yao.qi@linaro.org> + + * valops.c (read_value_memory): New local variable 'stack'. + Set it to either TARGET_OBJECT_STACK_MEMORY or + TARGET_OBJECT_MEMORY. + 2016-04-22 Pedro Alves <palves@redhat.com> * ada-exp.y: Remove all yy symbol remappings. diff --git a/gdb/valops.c b/gdb/valops.c index 8a555f3..bbbbd00 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -961,6 +961,9 @@ read_value_memory (struct value *val, int embedded_offset, ULONGEST xfered_total = 0; struct gdbarch *arch = get_value_arch (val); int unit_size = gdbarch_addressable_memory_unit_size (arch); + enum target_object object; + + object = stack ? TARGET_OBJECT_STACK_MEMORY : TARGET_OBJECT_MEMORY; while (xfered_total < length) { @@ -968,7 +971,7 @@ read_value_memory (struct value *val, int embedded_offset, ULONGEST xfered_partial; status = target_xfer_partial (current_target.beneath, - TARGET_OBJECT_MEMORY, NULL, + object, NULL, buffer + xfered_total * unit_size, NULL, memaddr + xfered_total, length - xfered_total, |