From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] Choose TARGET_OBJECT_STACK_MEMORY and TARGET_OBJECT_MEMORY in read_value_memory
Date: Tue, 19 Apr 2016 09:54:00 -0000 [thread overview]
Message-ID: <1461059620-27870-1-git-send-email-yao.qi@linaro.org> (raw)
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-19 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/valops.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gdb/valops.c b/gdb/valops.c
index 5a244a9..03d7cac 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,
--
1.9.1
next reply other threads:[~2016-04-19 9:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-19 9:54 Yao Qi [this message]
2016-04-22 15:54 ` Pedro Alves
2016-04-22 16:21 ` Yao Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1461059620-27870-1-git-send-email-yao.qi@linaro.org \
--to=qiyaoltc@gmail.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox