This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Delegate to target_ops->beneath to read cache lines
- From: Yao Qi <yao at codesourcery dot com>
- To: Doug Evans <xdje42 at gmail dot com>
- Cc: Pedro Alves <palves at redhat dot com>, <gdb-patches at sourceware dot org>
- Date: Mon, 2 Dec 2013 14:05:30 +0800
- Subject: Re: [PATCH] Delegate to target_ops->beneath to read cache lines
- Authentication-results: sourceware.org; auth=none
- References: <1385554824-7159-1-git-send-email-yao at codesourcery dot com> <5295F877 dot 3060004 at redhat dot com> <52980180 dot 1050000 at codesourcery dot com> <CAP9bCMTpcUJ_Okp8XwBhCQefsKrfkUo4iKcrv8B_Xip4Hc+h8w at mail dot gmail dot com>
On 11/30/2013 03:42 AM, Doug Evans wrote:
> I think a comment is required here explaining why things are the way they are.
> i.e., why we use current_target.beneath instead of ¤t_target.
I find the comments in target_read_memory can do some explanations,
so I copy that paragraph here. Is it clear to you?
--
Yao (éå)
gdb:
2013-12-02 Yao Qi <yao@codesourcery.com>
* dcache.c (dcache_read_line): Add comments.
---
gdb/dcache.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/gdb/dcache.c b/gdb/dcache.c
index 12d1a4b..0707cdf 100644
--- a/gdb/dcache.c
+++ b/gdb/dcache.c
@@ -337,6 +337,9 @@ dcache_read_line (DCACHE *dcache, struct dcache_block *db)
continue;
}
+ /* Dispatch to the topmost target, not the flattened current_target.
+ Memory accesses check target->to_has_(all_)memory, and the
+ flattened target doesn't inherit those. */
res = target_read (current_target.beneath, TARGET_OBJECT_RAW_MEMORY,
NULL, myaddr, memaddr, reg_len);
if (res < reg_len)
--
1.7.7.6