Choose TARGET_OBJECT_STACK_MEMORY and TARGET_OBJECT_MEMORY in read_value_memory
authorYao Qi <yao.qi@linaro.org>
Fri, 22 Apr 2016 16:18:31 +0000 (17:18 +0100)
committerYao Qi <yao.qi@linaro.org>
Fri, 22 Apr 2016 16:20:24 +0000 (17:20 +0100)
commit6d7e9d3b8dbbf46a0cd5dc4f6341c1f9eb8cd6ae
tree26c37f7af54667ac9b735c57ae8bf907063f9662
parentb3f11165aad39586cca0352ed5fe32b721699c76
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.
gdb/ChangeLog
gdb/valops.c