From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29087 invoked by alias); 12 May 2010 00:27:35 -0000 Received: (qmail 29079 invoked by uid 22791); 12 May 2010 00:27:34 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp-outbound-2.vmware.com (HELO smtp-outbound-2.vmware.com) (65.115.85.73) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 12 May 2010 00:27:29 +0000 Received: from mailhost4.vmware.com (mailhost4.vmware.com [10.16.67.124]) by smtp-outbound-2.vmware.com (Postfix) with ESMTP id 64E4F5A008; Tue, 11 May 2010 17:27:27 -0700 (PDT) Received: from msnyder-server.eng.vmware.com (promd-2s-dhcp138.eng.vmware.com [10.20.124.138]) by mailhost4.vmware.com (Postfix) with ESMTP id 5B3D2C9AC1; Tue, 11 May 2010 17:27:27 -0700 (PDT) Message-ID: <4BE9F5EF.2050405@vmware.com> Date: Wed, 12 May 2010 00:27:00 -0000 From: Michael Snyder User-Agent: Thunderbird 2.0.0.22 (X11/20090609) MIME-Version: 1.0 To: Pedro Alves CC: "gdb-patches@sourceware.org" , Hui Zhu Subject: Re: [RFA] Checkpoint: wait the defunct process when delete it References: <4BE9DD78.6070209@vmware.com> <201005120105.40194.pedro@codesourcery.com> In-Reply-To: <201005120105.40194.pedro@codesourcery.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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-05/txt/msg00255.txt.bz2 Pedro Alves wrote: > On Tuesday 11 May 2010 23:43:04, Michael Snyder wrote: > > >> old_cleanup = save_inferior_ptid (); >> inferior_ptid = fd->parent_ptid; >> >> Something like this? Then the original inferior_ptid will be >> restored when you do >> >>> + if (call_function_by_hand (waitpid_fn, 3, argv) == 0) >>> + return -1; >> do_cleanups(); >> >>> + return 0; >>> +} > > That won't work. You will hit an assertion somewhere: either because > inferior_ptid is not found in the linux-nat.c lwp list, or because > inferior_ptid is not found in gdb's thread list. I believe you'll > need to do a full linux_nat_switch_fork and back. > There you go. ;-)