From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16426 invoked by alias); 25 Oct 2013 14:35:43 -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 16412 invoked by uid 89); 25 Oct 2013 14:35:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.3 required=5.0 tests=AWL,BAYES_00,GARBLED_BODY autolearn=no version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 25 Oct 2013 14:35:41 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1VZiUE-0003X6-7m from Yao_Qi@mentor.com ; Fri, 25 Oct 2013 07:35:38 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Fri, 25 Oct 2013 07:35:37 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Fri, 25 Oct 2013 07:35:37 -0700 Message-ID: <526A8164.7040509@codesourcery.com> Date: Fri, 25 Oct 2013 14:35: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: gdb-patches Subject: Re: [PATCH 3/5] set/show code-cache References: <1382516855-32218-1-git-send-email-yao@codesourcery.com> <1382516855-32218-4-git-send-email-yao@codesourcery.com> In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00799.txt.bz2 On 10/25/2013 03:47 PM, Doug Evans wrote: > While perhaps it usually won't be a problem (*1), it's odd to have two caches. At the very beginning, I use single dcache for both stack access and code access. However, it is odd that command "set stack-cache off" invalidates code caches, so I decide to add a new cache dedicated to code access. > If I do x/10x $addr and then x/10i $addr will both caches get populated? No, "x/10i $addr" gets code cache populated, while "x/10x $addr" doesn't get "general" or "stack" cache populated, unless I set memory attribute cache for this area. > [Will there be latent bugs due to "storing the same thing twice"? > (which has been a source of bugs in gdb) Plus there's the extra > complexity of keeping both in sync.] "Storing the same thing twice" may introduce bugs, but "store two things together" is not good either :). The code keeping caches in sync is localized, and probably we can move them into a new file target-cache.c. I don't see too much complexity here and the disassembly is sped up, so it is worth doing it, IMO. -- Yao (齐尧)