From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24169 invoked by alias); 29 Nov 2013 19:42:15 -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 24155 invoked by uid 89); 29 Nov 2013 19:42:14 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=2.9 required=5.0 tests=AWL,BAYES_50,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RDNS_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no version=3.3.2 X-HELO: mail-wi0-f172.google.com Received: from Unknown (HELO mail-wi0-f172.google.com) (209.85.212.172) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 29 Nov 2013 19:42:13 +0000 Received: by mail-wi0-f172.google.com with SMTP id en1so2461816wid.11 for ; Fri, 29 Nov 2013 11:42:04 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.180.189.80 with SMTP id gg16mr8194426wic.32.1385754124090; Fri, 29 Nov 2013 11:42:04 -0800 (PST) Received: by 10.194.37.73 with HTTP; Fri, 29 Nov 2013 11:42:04 -0800 (PST) In-Reply-To: <52980180.1050000@codesourcery.com> References: <1385554824-7159-1-git-send-email-yao@codesourcery.com> <5295F877.3060004@redhat.com> <52980180.1050000@codesourcery.com> Date: Fri, 29 Nov 2013 20:06:00 -0000 Message-ID: Subject: Re: [PATCH] Delegate to target_ops->beneath to read cache lines From: Doug Evans To: Yao Qi Cc: Pedro Alves , gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00942.txt.bz2 On Thu, Nov 28, 2013 at 6:52 PM, Yao Qi wrote: > [...] > 2013-11-29 Yao Qi > Pedro Alves > > * dcache.c (dcache_read_line): Use current_target.beneath > instead of ¤t_target. > * target.c (memory_xfer_partial_1): Factor code out to ... > (raw_memory_xfer_partial): ... it. New function. > (target_xfer_partial): Call raw_memory_xfer_partial if OBJECT > is TARGET_OBJECT_RAW_MEMORY. > --- > gdb/dcache.c | 4 +- > gdb/target.c | 67 ++++++++++++++++++++++++++++++++-------------------------- > 2 files changed, 39 insertions(+), 32 deletions(-) > > diff --git a/gdb/dcache.c b/gdb/dcache.c > index ea2b732..12d1a4b 100644 > --- a/gdb/dcache.c > +++ b/gdb/dcache.c > @@ -336,8 +336,8 @@ dcache_read_line (DCACHE *dcache, struct dcache_block *db) > len -= reg_len; > continue; > } > - > - res = target_read (¤t_target, TARGET_OBJECT_RAW_MEMORY, > + > + res = target_read (current_target.beneath, TARGET_OBJECT_RAW_MEMORY, > NULL, myaddr, memaddr, reg_len); > if (res < reg_len) > return 0; > [...] 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.