From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24834 invoked by alias); 20 Jul 2010 12:35:25 -0000 Received: (qmail 24826 invoked by uid 22791); 20 Jul 2010 12:35:24 -0000 X-SWARE-Spam-Status: No, hits=-5.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,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; Tue, 20 Jul 2010 12:35:19 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o6KCZ9lT003105 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 20 Jul 2010 08:35:09 -0400 Received: from host1.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o6KCZ6uM021552 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 20 Jul 2010 08:35:08 -0400 Received: from host1.dyn.jankratochvil.net (localhost [127.0.0.1]) by host1.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o6KCZ5Gh010807; Tue, 20 Jul 2010 14:35:05 +0200 Received: (from jkratoch@localhost) by host1.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o6KCZ4JE010806; Tue, 20 Jul 2010 14:35:04 +0200 Date: Tue, 20 Jul 2010 12:35:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: [patch] Fix linux-nat.c {,lp->}status typo Message-ID: <20100720123504.GA9827@host1.dyn.jankratochvil.net> References: <20100718145110.GA16697@host1.dyn.jankratochvil.net> <201007201322.28556.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201007201322.28556.pedro@codesourcery.com> User-Agent: Mutt/1.5.20 (2009-12-10) 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: 2010-07/txt/msg00295.txt.bz2 On Tue, 20 Jul 2010 14:22:28 +0200, Pedro Alves wrote: > On Sunday 18 July 2010 15:51:12, Jan Kratochvil wrote: > In practice, status == lp->status at this point for !WIFSTOPPED, > so there should be no impact. You are right as I see now. OK, marked ChangeLog entry only as "Code cleanup". > Okay, thanks. Checked-in. Thanks, Jan http://sourceware.org/ml/gdb-cvs/2010-07/msg00112.html --- src/gdb/ChangeLog 2010/07/20 05:58:52 1.12000 +++ src/gdb/ChangeLog 2010/07/20 12:33:29 1.12001 @@ -1,3 +1,9 @@ +2010-07-20 Jan Kratochvil + + Code cleanup. + * linux-nat.c (linux_nat_wait_1): Reset STATUS after calling + linux_nat_wait_1. Use always LP->STATUS afterwards. + 2010-07-20 Hui Zhu * inf-ptrace.c (inf_ptrace_create_inferior): Initialize back_to. --- src/gdb/linux-nat.c 2010/07/18 21:21:53 1.174 +++ src/gdb/linux-nat.c 2010/07/20 12:33:30 1.175 @@ -3367,6 +3367,9 @@ lp = linux_nat_filter_event (lwpid, status, options); + /* STATUS is now no longer valid, use LP->STATUS instead. */ + status = 0; + if (lp && ptid_is_pid (ptid) && ptid_get_pid (lp->ptid) != ptid_get_pid (ptid)) @@ -3375,7 +3378,7 @@ if (debug_linux_nat) fprintf (stderr, "LWP %ld got an event %06x, leaving pending.\n", - ptid_get_lwp (lp->ptid), status); + ptid_get_lwp (lp->ptid), lp->status); if (WIFSTOPPED (lp->status)) { @@ -3412,7 +3415,7 @@ lp->signalled = 0; } } - else if (WIFEXITED (status) || WIFSIGNALED (status)) + else if (WIFEXITED (lp->status) || WIFSIGNALED (lp->status)) { if (debug_linux_nat) fprintf (stderr, "Process %ld exited while stopping LWPs\n",