From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17136 invoked by alias); 31 Oct 2017 18:04:52 -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 17087 invoked by uid 89); 31 Oct 2017 18:04:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 31 Oct 2017 18:04:51 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id v9VI4hQT009566 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 31 Oct 2017 14:04:48 -0400 Received: by simark.ca (Postfix, from userid 112) id DA7011E526; Tue, 31 Oct 2017 14:04:43 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 68EF51E4F2; Tue, 31 Oct 2017 14:04:23 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 31 Oct 2017 18:04:00 -0000 From: Simon Marchi To: Yao Qi Cc: Simon Marchi , gdb-patches@sourceware.org Subject: Re: [PATCH 8/8] Construct readonly regcache without address space In-Reply-To: References: <1509096702-12202-1-git-send-email-yao.qi@linaro.org> <1509096702-12202-9-git-send-email-yao.qi@linaro.org> <0f36f5e2-f935-fa7e-7fe0-5603b4218ff5@ericsson.com> Message-ID: <754eec4adad38c0df65b017db2900985@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.0 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Tue, 31 Oct 2017 18:04:44 +0000 X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00932.txt.bz2 On 2017-10-31 13:44, Yao Qi wrote: > On Tue, Oct 31, 2017 at 2:35 PM, Simon Marchi > wrote: >> On 2017-10-27 05:31 AM, Yao Qi wrote: >>> The address space is useless to readonly regcache, so this patch >>> removes >>> the parameter to construct readonly regcache. >> >> Can you expand on why the aspace is useless for readonly regcaches? >> The >> comment of m_aspace says: >> >> /* The address space of this register cache (for registers where it >> makes sense, like PC or SP). */ >> > > This comment was there because address_space was added for read-write > regcache. Nowadays, address_space in regcache is used for various > breakpoint/watchpoint checkings, and these regcache are not read-only > regcache. > > Additionally, regcache itself doesn't use address_space at all, so > various > breakpoint/watchpoint checking code should get address_space from > thread > ptid rather than regcache. > >> Registers like PC or SP are present even in a readonly regcache, so I >> would think that it makes sense to have the address space there as >> well. >> So, is it that it's really useless (as in it doesn't make sense to >> have >> it there) or that we just don't happen to use the address space right >> now >> with readonly regcaches? > > It doesn't make sense to have address_space in read-only regcache, at > least. Since we don't have a type/class for read-only regcache, we > still > have to keep address_space in regcache. However, I don't see how > address_space can be used by regcache, we can remove it from regcache > completely, but that is a separate thing. Ok thanks, that explanation helps to understand. Simon