From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2738 invoked by alias); 26 Jul 2012 14:57:43 -0000 Received: (qmail 2728 invoked by uid 22791); 26 Jul 2012 14:57:42 -0000 X-SWARE-Spam-Status: No, hits=-7.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,TW_EG,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Jul 2012 14:57:18 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6QEvFA7004731 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 26 Jul 2012 10:57:15 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q6QEvD3F008388; Thu, 26 Jul 2012 10:57:13 -0400 Message-ID: <50115AC8.3060003@redhat.com> Date: Thu, 26 Jul 2012 14:57:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Yao Qi CC: gdb-patches@sourceware.org Subject: Re: [PATCH] remove registers_changed from switch_to_thread References: <1343313892-30424-1-git-send-email-yao@codesourcery.com> In-Reply-To: <1343313892-30424-1-git-send-email-yao@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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/msg00617.txt.bz2 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. -- Pedro Alves