From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23938 invoked by alias); 9 Aug 2012 08:37:42 -0000 Received: (qmail 23874 invoked by uid 22791); 9 Aug 2012 08:37:41 -0000 X-SWARE-Spam-Status: No, hits=-4.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_HOSTKARMA_W,RCVD_IN_HOSTKARMA_WL,TW_EG X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 09 Aug 2012 08:37:22 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1SzOF6-0004Sq-Co from Yao_Qi@mentor.com ; Thu, 09 Aug 2012 01:37:20 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Thu, 9 Aug 2012 01:37:20 -0700 Received: from qiyao.dyndns.org (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.1.289.1; Thu, 9 Aug 2012 01:37:19 -0700 From: Yao Qi To: CC: Mark Kettenis Subject: Re: [PATCH] Don't attach to 'target_changed' observer in regcache Date: Thu, 09 Aug 2012 08:37:00 -0000 Message-ID: <1488047.W4eyA0a8U4@qiyao.dyndns.org> User-Agent: KMail/4.8.3 (Linux/3.3.7-1.fc16.i686; KDE/4.8.3; i686; ; ) In-Reply-To: <201208090811.q798Bbeq000405@glazunov.sibelius.xs4all.nl> References: <1343891847-16554-1-git-send-email-yao@codesourcery.com> <5527210.MOXy64knkR@qiyao.dyndns.org> <201208090811.q798Bbeq000405@glazunov.sibelius.xs4all.nl> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" X-IsSubscribed: yes 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/msg00283.txt.bz2 On Thursday, August 09, 2012 10:11:37 AM Mark Kettenis wrote: > > 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". >=20 > 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. >=20 Mark, thanks for your explanation. I must use the wrong key words in google, and= =20 got less interesting search result than your answer here. I am thinking that we may add a new gdbarch hook function 'register_changed= =20 (int regnum)'. In default, it invalidates all regcaches, and backend can=20 override it to do something optimally. At least, we don't have to invalida= te=20 all regcache on some ports, such as x86, tic6x. > > 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. >=20 > And I'm telling you that the "troubles with Orjan's port" are more > general than you think they are. Agreed. --=20 Yao (=E9=BD=90=E5=B0=A7)