From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16707 invoked by alias); 12 May 2010 00:05:48 -0000 Received: (qmail 16618 invoked by uid 22791); 12 May 2010 00:05:47 -0000 X-SWARE-Spam-Status: No, hits=-2.2 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, 12 May 2010 00:05:43 +0000 Received: (qmail 25741 invoked from network); 12 May 2010 00:05:42 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 12 May 2010 00:05:42 -0000 From: Pedro Alves To: gdb-patches@sourceware.org Subject: Re: [RFA] Checkpoint: wait the defunct process when delete it Date: Wed, 12 May 2010 00:05:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-20-generic; KDE/4.3.2; x86_64; ; ) Cc: Michael Snyder , Hui Zhu References: <4BE9DD78.6070209@vmware.com> In-Reply-To: <4BE9DD78.6070209@vmware.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201005120105.40194.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: 2010-05/txt/msg00254.txt.bz2 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. -- Pedro Alves