From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2684 invoked by alias); 28 Oct 2013 18:33:19 -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 2670 invoked by uid 89); 28 Oct 2013 18:33:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-ve0-f169.google.com Received: from mail-ve0-f169.google.com (HELO mail-ve0-f169.google.com) (209.85.128.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Mon, 28 Oct 2013 18:33:17 +0000 Received: by mail-ve0-f169.google.com with SMTP id c14so3877183vea.0 for ; Mon, 28 Oct 2013 11:33:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=8+YoAN5PtCI91N1BiPKnsZ/jmtWHd8F2un/5ycRGlZY=; b=EWFDMwAuZZK8SrB2aYauPZFWTt55jEhB5BFwzmB1GDQ6H4unrZx8w5QZ8v/usGP2VY mfqwy6/jgA5tQJUAoYo0hjbopNBn7VUJ7RwHNKKGLe3Gm11CEDY7eUvoYXf6n+9q0MFg +zYuVxwuVncr2JInox+xyRA3dHQX6MdaXlzphTVtnwx4dW/Kjwsrog4xXhvPgiCdbhXw pNN7Op5t0Bz3pW5m+cQNof5adBGyGAn+O3eQsGD4zlp1aVO6uveSuLfPsjiFo6DHMQ3+ 30mb9MnWGIOZRv75+I+omz+GAIGFBhOUeZD5eGFMlPvcPxvI32/nlEm9MFSbKHE5daAG BF3g== X-Gm-Message-State: ALoCoQnBMIYG9qKC/97E3VVmMsp4QClPUU1Z0Nf2LNQg4r66vLcq5pitxsesm24Ym0iOLtukRDBf+9T5D4DtKPdQCId5AjMP0hbPQ2fT+3Bh7E4DeEaNTJEBTasjNWXUjiVKwhcJqqNvp9riKGbzyko0tfV+adbnsnrVivUbl3CWbEg4C6G9FCEyqPID68dofiw9JST+lH+EoWVJZ6m4F5RDdJU6BXmRfg== MIME-Version: 1.0 X-Received: by 10.58.255.71 with SMTP id ao7mr14434271ved.16.1382985195311; Mon, 28 Oct 2013 11:33:15 -0700 (PDT) Received: by 10.52.237.232 with HTTP; Mon, 28 Oct 2013 11:33:15 -0700 (PDT) In-Reply-To: <526BC220.80702@codesourcery.com> References: <1382516855-32218-1-git-send-email-yao@codesourcery.com> <1382516855-32218-4-git-send-email-yao@codesourcery.com> <526A8164.7040509@codesourcery.com> <526BC220.80702@codesourcery.com> Date: Mon, 28 Oct 2013 18:33:00 -0000 Message-ID: Subject: Re: [PATCH 3/5] set/show code-cache From: Doug Evans To: Yao Qi Cc: gdb-patches Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes X-SW-Source: 2013-10/txt/msg00873.txt.bz2 [sorry for the resend, I didn't catch that gmail had switched to rich text mode] On Sat, Oct 26, 2013 at 6:22 AM, Yao Qi wrote: > On 10/25/2013 11:57 PM, Doug Evans wrote: >>> >>> 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 it's just that "set stack-cache off" flushed the cache (as opposed >> to disabling/breaking all future use) I think that's ok. How often >> will it get turned on and off? >> > > It is confusing if command "set stack-cache off" flushes both stack cache > and code cache. I'd like to have separate stack cache and code cache, so > that GDB can control them independently. GDB invalidates stack cache when > GDB resumes inferior, but GDB doesn't have to invalidate code cache, unless > the program is self-modified. I guess the confusing part is having named the option "set stack-cache on,off". Sorry about that. The dcache as it is today is a global cache, used by everything. It's not intended to be called "the stack cache". As you know, it's also used when a range of memory is marked cacheable by the memory attributes. Note that GDB can't tell if the program has self-modifying code, and GDB still has to handle the case of munmap (perhaps followed by an mmap that happens to put different code at the same location). Besides, won't better trust-readonly support handle the majority of desired cases anyway? > If we obsolete command "set stack-cache" and replace it with command "set > target-cache", I agree that we can use single cache for stack and code. > WDYT? "set stack-cache on|off" is an escape hatch in case the optimization we do to speed up backtraces on remote targets doesn't work in some situation - the user has a knob to turn it off. Maybe we could rename it to "set stack-cache-optimization on|off" or some such.