From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4974 invoked by alias); 7 Sep 2011 00:45:57 -0000 Received: (qmail 4957 invoked by uid 22791); 7 Sep 2011 00:45:56 -0000 X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (74.125.121.67) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 07 Sep 2011 00:45:40 +0000 Received: from hpaq6.eem.corp.google.com (hpaq6.eem.corp.google.com [172.25.149.6]) by smtp-out.google.com with ESMTP id p870jcHA006917 for ; Tue, 6 Sep 2011 17:45:38 -0700 Received: from yie13 (yie13.prod.google.com [10.243.66.13]) by hpaq6.eem.corp.google.com with ESMTP id p870j76G019255 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=NOT) for ; Tue, 6 Sep 2011 17:45:37 -0700 Received: by yie13 with SMTP id 13so7114621yie.25 for ; Tue, 06 Sep 2011 17:45:37 -0700 (PDT) Received: by 10.91.73.30 with SMTP id a30mr4269608agl.18.1315356336880; Tue, 06 Sep 2011 17:45:36 -0700 (PDT) MIME-Version: 1.0 Received: by 10.91.73.30 with SMTP id a30mr4269602agl.18.1315356336665; Tue, 06 Sep 2011 17:45:36 -0700 (PDT) Received: by 10.90.84.9 with HTTP; Tue, 6 Sep 2011 17:45:36 -0700 (PDT) In-Reply-To: <201109051656.53563.pedro@codesourcery.com> References: <201109051656.53563.pedro@codesourcery.com> Date: Wed, 07 Sep 2011 01:29:00 -0000 Message-ID: Subject: Re: PR cli/13110 From: Doug Evans To: Pedro Alves Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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: 2011-09/txt/msg00101.txt.bz2 On Mon, Sep 5, 2011 at 8:56 AM, Pedro Alves wrote: > > > Tested on x86_64-linux and applied. > > Repeating what I said on gdb@, I'm now wondering if we actually ever > need the registers_changed call here or in wait_for_inferior > nowadays --- we flush threads' register caches when we resume > them (target_resume). > > -- > Pedro Alves > > 2011-09-05 =A0Pedro Alves =A0 > > =A0 =A0 =A0 =A0PR cli/13110 > > =A0 =A0 =A0 =A0gdb/ > =A0 =A0 =A0 =A0* infrun.c (fetch_inferior_event): Check if there's a sele= cted > =A0 =A0 =A0 =A0thread before checking if the selected thread is executing. > > --- > =A0gdb/infrun.c | =A0 =A04 +++- > =A01 file changed, 3 insertions(+), 1 deletion(-) > > Index: src/gdb/infrun.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- src.orig/gdb/infrun.c =A0 =A0 =A0 2011-09-05 15:50:49.000000000 +0100 > +++ src/gdb/infrun.c =A0 =A02011-09-05 15:57:10.693964411 +0100 > @@ -2749,7 +2749,9 @@ fetch_inferior_event (void *client_data) > =A0 =A0 =A0switches threads anyway). =A0If we didn't do this, a spurious > =A0 =A0 =A0delayed event in all-stop mode would make the user lose the > =A0 =A0 =A0selected frame. =A0*/ > - =A0if (non_stop || is_executing (inferior_ptid)) > + =A0if (non_stop > + =A0 =A0 =A0|| (!ptid_equal (inferior_ptid, null_ptid) > + =A0 =A0 =A0 =A0 && is_executing (inferior_ptid))) > =A0 =A0 registers_changed (); > > =A0 make_cleanup_restore_integer (&execution_direction); > The code may be to additionally check if there's a selected thread, but when I read it I think "When is null_ptid ever executing?". Comment in the code is required IMO.