From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14492 invoked by alias); 18 May 2011 19:17:41 -0000 Received: (qmail 14483 invoked by uid 22791); 18 May 2011 19:17:40 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 18 May 2011 19:17:25 +0000 Received: (qmail 1903 invoked from network); 18 May 2011 19:17:24 -0000 Received: from unknown (HELO scottsdale.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 18 May 2011 19:17:24 -0000 From: Pedro Alves To: Jan Kratochvil Subject: Re: [patch] Workaround for 10970, 12702, avoid calling waitpid Date: Wed, 18 May 2011 19:17:00 -0000 User-Agent: KMail/1.13.5 (Linux/2.6.35-28-generic; KDE/4.6.2; x86_64; ; ) Cc: gdb-patches@sourceware.org, Doug Evans References: <20110517181920.7EE51246196@ruffy.mtv.corp.google.com> <201105181916.59767.pedro@codesourcery.com> <20110518185302.GA5585@host1.jankratochvil.net> In-Reply-To: <20110518185302.GA5585@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201105182017.22006.pedro@codesourcery.com> 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-05/txt/msg00406.txt.bz2 On Wednesday 18 May 2011 19:53:02, Jan Kratochvil wrote: > > The inferior exit code reported to the core/user will be the > > exit code of the last LWP that exits, instead of the > > leader's exit code. We've stepped out of C realm when > > the leader exited, so I'm not sure that matters (or how > > to make it be != 0, even). > > I do not understand this comment much. That != 0 is here for PID from waitpid > which is unrelated to the exit code (present in STATUS). I was talking about the exit code of the last cloned lwp to exit ending up as exit code of the inferior (TARGET_WAITKIND_EXITED's value.integer), not the return of that waitpid call. linux_nat_filter_event ... if (num_lwps (GET_PID (lp->ptid)) > 1) { /* If there is at least one more LWP, then the exit signal was not the end of the debugged application and should be ignored. */ exit_lwp (lp); return NULL; } ... linux_nat_wait_1 store_waitstatus (ourstatus, status); When the last lwp exits, we'll report it's exit code as the inferior exit code to infrun, instead of the leader's exit code. > > > No regressions on {x86_64,x86_64-m32,i686}-fedora15-linux-gnu. > > I will check it in if no futher comments appear. -- Pedro Alves