From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 117959 invoked by alias); 18 Jul 2017 12:41:44 -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 117907 invoked by uid 89); 18 Jul 2017 12:41:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy=interest X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 18 Jul 2017 12:41:39 +0000 Received: from HHMAIL01.hh.imgtec.org (unknown [10.100.10.19]) by Forcepoint Email with ESMTPS id 1A0AFD01B22B7; Tue, 18 Jul 2017 13:41:34 +0100 (IST) Received: from [10.20.78.183] (10.20.78.183) by HHMAIL01.hh.imgtec.org (10.100.10.21) with Microsoft SMTP Server id 14.3.294.0; Tue, 18 Jul 2017 13:41:36 +0100 Date: Tue, 18 Jul 2017 12:41:00 -0000 From: "Maciej W. Rozycki" To: Yao Qi CC: Alan Hayward , "gdb-patches@sourceware.org" , nd Subject: Re: [RFC] Replace regcache readonly flag with detached flag In-Reply-To: <8637a0r9mq.fsf@gmail.com> Message-ID: References: <8637a0r9mq.fsf@gmail.com> User-Agent: Alpine 2.00 (DEB 1167 2008-08-23) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2017-07/txt/msg00252.txt.bz2 On Thu, 13 Jul 2017, Yao Qi wrote: > > Therefore I'd like to propose removing m_readonly_p and replacing it with: > > > > /* Is this a detached cache? A detached cache is not attached to a target. > > It is used for saving the target's register state (e.g, across an inferior > > function call or just before forcing a function return). A detached cache > > can be written to and read from, however the values will not be passed > > through to a target. > > Using the copy constructor or regcache_dup on a regcache will always > > create a detached regcache. */ > > bool m_detached_p; > > > > In most cases this is a 1:1 substitution of m_readonly_p for m_detached_p, > > except it for the write functions, where we now allow writing to the > > regcache buffers. > > I am not sure this replacement is reasonable. The regcache can be > detached from target, and read-only or read-write. The regcache can be > attached to target, and read-write. I can't think of a case that > regcache is attached to target and read-only. As a matter of interest: what if the target is `core'? Maciej