This is the mail archive of the 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]

[committed]: [PATCH] remove registers_changed from switch_to_thread

On Thursday, July 26, 2012 03:57:12 PM Pedro Alves wrote:
> On 07/26/2012 03:44 PM, Yao Qi wrote:
> > When reading the code, I find registers_changed is called from
> > switch_to_thread, which confuses me a little bit.  We have
> > regcache, and each thread has its own regcache.  Why do we have
> > to invalidate all regcaches during thread switch?
> > 
> > The line of calling registers_changed in switch_to_thread is quite
> > old, it was written in gdb 4.10 (1993).  At that time, we didn't
> > have regcache, and register state is a global state.  There is also
> > a global variable 'registers_pid' associated with the global
> > register state.  When thread switches, 'registers_pid' should be
> > updated.  That is the reason why registers_changed should
> > be called in switch_to_thread.  So we don't have to do it now.
> > This patch is to remove this line.  Regression tested on x86_64
> > native and gdbserver.  OK to apply?
> Nice!  OK.


Yao (éå)

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