From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7511 invoked by alias); 9 Aug 2012 08:12:01 -0000 Received: (qmail 7499 invoked by uid 22791); 9 Aug 2012 08:11:59 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,TW_EG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from sibelius.xs4all.nl (HELO glazunov.sibelius.xs4all.nl) (83.163.83.176) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Aug 2012 08:11:46 +0000 Received: from glazunov.sibelius.xs4all.nl (kettenis@localhost [127.0.0.1]) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3) with ESMTP id q798BdZd026048; Thu, 9 Aug 2012 10:11:39 +0200 (CEST) Received: (from kettenis@localhost) by glazunov.sibelius.xs4all.nl (8.14.5/8.14.3/Submit) id q798Bbeq000405; Thu, 9 Aug 2012 10:11:37 +0200 (CEST) Date: Thu, 09 Aug 2012 08:12:00 -0000 Message-Id: <201208090811.q798Bbeq000405@glazunov.sibelius.xs4all.nl> From: Mark Kettenis To: yao@codesourcery.com CC: gdb-patches@sourceware.org, mark.kettenis@xs4all.nl In-reply-to: <5527210.MOXy64knkR@qiyao.dyndns.org> (message from Yao Qi on Thu, 9 Aug 2012 11:10:16 +0800) Subject: Re: [PATCH] Don't attach to 'target_changed' observer in regcache References: <1343891847-16554-1-git-send-email-yao@codesourcery.com> <201208081753.q78Hre36003861@glazunov.sibelius.xs4all.nl> <5527210.MOXy64knkR@qiyao.dyndns.org> 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 X-SW-Source: 2012-08/txt/msg00281.txt.bz2 > From: Yao Qi > Date: Thu, 9 Aug 2012 11:10:16 +0800 > > On Wednesday, August 08, 2012 07:53:40 PM Mark Kettenis wrote: > > > The author (Orjan) tried to support "changing the bank select register > > > changes the contents (and meaning) for a whole set of other registers." > > > The requirement is quite specific to Orjan's own port, so the better > > > solution is to attach a function which invalidates all regcache in > > > Orjan's backend, instead of doing it in target-independent part. > > > > Banked registers aren't really that exotic. Especially if you realise > > that register windows (SPARC, IA-64) are essentially banked registers. > > > > Banked register doesn't matter here. "Changing one special register > changes the whole set of registers", which is exotic, matters. Are > they (banked registers) switched by modifying a certain register? > Per my few knowledge on SPARC and IA-64, the answer is "No". Banked registers are by defenition switched by modifying a certain register I'd say. And yes, for SPARC by changing %cwp will change the visible register window and therefore the contents of the %i0-7, %l0-7 and %o0-7 registers. And changing some bits in the %pstate register will switch between sets of alternate global registers (%g0-7). It's been a while since I last looked at IA-64, but I'm pretty sure it has some similar mechanisms. Thinking about this a bit more, PA-RISC is another architecture that has such a mechanism. Some of its registers are shadowed and you can switch between the shadowed and non-shadowed by modifying a bit in the %psw register. > The issues of this patch are 1) modifying read-only bits in writable > register (as Dan pointed out), 2) troubles to Orjan's port. I can't > see any other issues of this patch. And I'm telling you that the "troubles with Orjan's port" are more general than you think they are.