From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32587 invoked by alias); 2 Dec 2013 06:07:23 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 32575 invoked by uid 89); 2 Dec 2013 06:07:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.2 required=5.0 tests=AWL,BAYES_50,GARBLED_BODY,RDNS_NONE,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from Unknown (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 02 Dec 2013 06:07:20 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1VnMeu-0004Bi-Nz from Yao_Qi@mentor.com ; Sun, 01 Dec 2013 22:07:04 -0800 Received: from SVR-ORW-FEM-04.mgc.mentorg.com ([147.34.97.41]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Sun, 1 Dec 2013 22:07:04 -0800 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-04.mgc.mentorg.com (147.34.97.41) with Microsoft SMTP Server id 14.2.247.3; Sun, 1 Dec 2013 22:07:03 -0800 Message-ID: <529C232A.7080900@codesourcery.com> Date: Mon, 02 Dec 2013 06:07:00 -0000 From: Yao Qi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2 MIME-Version: 1.0 To: Doug Evans CC: Pedro Alves , Subject: Re: [PATCH] Delegate to target_ops->beneath to read cache lines References: <1385554824-7159-1-git-send-email-yao@codesourcery.com> <5295F877.3060004@redhat.com> <52980180.1050000@codesourcery.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2013-12/txt/msg00013.txt.bz2 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 * 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