This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Don't attach to 'target_changed' observer in regcache
> From: Yao Qi <yao@codesourcery.com>
> 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.