Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <yao@codesourcery.com>
To: <gdb-patches@sourceware.org>
Subject: [committed]: [PATCH] remove registers_changed from switch_to_thread
Date: Fri, 27 Jul 2012 01:54:00 -0000	[thread overview]
Message-ID: <1512118.LdSz0IWHAe@qiyao.dyndns.org> (raw)
In-Reply-To: <50115AC8.3060003@redhat.com>

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.

Committed.

-- 
Yao (齐尧)


      reply	other threads:[~2012-07-27  1:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-26 14:45 Yao Qi
2012-07-26 14:57 ` Pedro Alves
2012-07-27  1:54   ` Yao Qi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1512118.LdSz0IWHAe@qiyao.dyndns.org \
    --to=yao@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox