From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18332 invoked by alias); 3 Nov 2013 05:56:03 -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 18307 invoked by uid 89); 3 Nov 2013 05:56:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,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; Sun, 03 Nov 2013 05:56:01 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1Vcqf4-00020H-2d from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Sat, 02 Nov 2013 22:55:46 -0700 Received: from SVR-ORW-FEM-02.mgc.mentorg.com ([147.34.96.206]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Sat, 2 Nov 2013 22:55:46 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-02.mgc.mentorg.com (147.34.96.168) with Microsoft SMTP Server id 14.2.247.3; Sat, 2 Nov 2013 22:55:45 -0700 From: Yao Qi To: Subject: [PATCH 02/10] Don't update target_dcache if it is not initialized Date: Sun, 03 Nov 2013 05:56:00 -0000 Message-ID: <1383458049-20893-3-git-send-email-yao@codesourcery.com> In-Reply-To: <1383458049-20893-1-git-send-email-yao@codesourcery.com> References: <1383458049-20893-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2013-11/txt/msg00034.txt.bz2 After previous patch, 'target_dcache' is initialized lazily. It is possible that 'target_dcache' is still NULL when GDB writes to memory. In this case, update to 'target_dcache' can be skipped. gdb: 2013-11-02 Yao Qi * target.c (memory_xfer_partial_1): Update 'target_dcache' if it is initialized. --- gdb/target.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/gdb/target.c b/gdb/target.c index 6403e86..1a076f3 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -1667,11 +1667,12 @@ memory_xfer_partial_1 (struct target_ops *ops, enum target_object object, if (res > 0 && inf != NULL && writebuf != NULL + && target_dcache_init_p () && !region->attrib.cache && stack_cache_enabled_p && object != TARGET_OBJECT_STACK_MEMORY) { - DCACHE *dcache = target_dcache_get_or_init (); + DCACHE *dcache = target_dcache_get (); dcache_update (dcache, memaddr, (void *) writebuf, res); } -- 1.7.7.6