From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9032 invoked by alias); 14 Apr 2004 14:46:09 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 9023 invoked from network); 14 Apr 2004 14:46:08 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 14 Apr 2004 14:46:08 -0000 Received: from drow by nevyn.them.org with local (Exim 4.31 #1 (Debian)) id 1BDleR-0001zh-K7; Wed, 14 Apr 2004 10:46:07 -0400 Date: Wed, 14 Apr 2004 14:46:00 -0000 From: Daniel Jacobowitz To: Orjan Friberg Cc: gdb-patches@sources.redhat.com Subject: Re: Multiplexed registers and invalidating the register cache Message-ID: <20040414144607.GA5700@nevyn.them.org> Mail-Followup-To: Orjan Friberg , gdb-patches@sources.redhat.com References: <407D242B.109@axis.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <407D242B.109@axis.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-04/txt/msg00283.txt.bz2 On Wed, Apr 14, 2004 at 01:44:43PM +0200, Orjan Friberg wrote: > Hi all, > > I'm working on support for a CPU where some of the registers are in a > bank selected by another register, meaning that changing the bank select > register changes the contents (and meaning) for a whole set of other > registers. > > The target is a remote stub, and the way I've pictured this in my head a > change to the bank select register (via a 'P' packet) invalidates the > register cache, causing the whole register contents to be fetched again > (with a 'g' packet). (The remote stub needs to re-read the affected > registers upon the write of the bank select register, of course.) > > Is there some sort of "write register" hook I could use to indicate that > the registers should be fetched again if the bank select register is > written to? I followed what happens when doing a "set $register", but I > couldn't find any such hook in that path. I think you should make this change unconditionally - and flush the entire frame cache. I'm not sure whether it should be in the generic code that writes a register or the user-level code triggered by set $reg = val, though. I've been meaning to do this for a long time. For instance, there is a writeable register on PowerPC targets which has some read-only bits. Right now, if you set it to an arbitrary value and then print it you'll get the value GDB wrote - not the value that was actually accepted into the register. Andrew convinced me that the performance cost associated with this would be small in practice. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer