This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Don't attach to 'target_changed' observer in regcache


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".
> 
> 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.
> 

Mark,
thanks for your explanation.  I must use the wrong key words in google, and 
got less interesting search result than your answer here.

I am thinking that we may add a new gdbarch hook function 'register_changed 
(int regnum)'.  In default, it invalidates all regcaches, and backend can 
override it to do something optimally.  At least, we don't have to invalidate 
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.
> 
> And I'm telling you that the "troubles with Orjan's port" are more
> general than you think they are.

Agreed.

-- 
Yao (éå)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]