From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18366 invoked by alias); 27 Jul 2012 01:54:13 -0000 Received: (qmail 18358 invoked by uid 22791); 27 Jul 2012 01:54:12 -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; Fri, 27 Jul 2012 01:53:58 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1SuZkb-0006bv-DB from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 26 Jul 2012 18:53:57 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Thu, 26 Jul 2012 18:53:57 -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, 26 Jul 2012 18:53:55 -0700 From: Yao Qi To: Subject: [committed]: [PATCH] remove registers_changed from switch_to_thread Date: Fri, 27 Jul 2012 01:54:00 -0000 Message-ID: <1512118.LdSz0IWHAe@qiyao.dyndns.org> User-Agent: KMail/4.8.3 (Linux/3.3.7-1.fc16.i686; KDE/4.8.3; i686; ; ) In-Reply-To: <50115AC8.3060003@redhat.com> References: <1343313892-30424-1-git-send-email-yao@codesourcery.com> <50115AC8.3060003@redhat.com> 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-07/txt/msg00653.txt.bz2 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? > >=20 > > 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? >=20 > Nice! OK. Committed. --=20 Yao (=E9=BD=90=E5=B0=A7)