Re: [PATCH] Delegate to target_ops->beneath to read cache lines

Yao Qi
2013-12-02T06:07:23Z

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 &current_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