From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4999 invoked by alias); 14 May 2010 15:08:37 -0000 Received: (qmail 4990 invoked by uid 22791); 14 May 2010 15:08:36 -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 mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 14 May 2010 15:08:30 +0000 Received: (qmail 31099 invoked from network); 14 May 2010 15:08:28 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 14 May 2010 15:08:28 -0000 From: Pedro Alves To: Hui Zhu Subject: Re: [RFA] Checkpoint: wait the defunct process when delete it Date: Fri, 14 May 2010 16:19:00 -0000 User-Agent: KMail/1.12.2 (Linux/2.6.31-21-generic; KDE/4.3.2; x86_64; ; ) Cc: Michael Snyder , "gdb-patches@sourceware.org" References: <201005141320.09678.pedro@codesourcery.com> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201005141608.16612.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/msg00301.txt.bz2 Thanks Hui, On Friday 14 May 2010 15:43:23, Hui Zhu wrote: > + pptid = fi->parent_ptid; > > if (from_tty) > printf_filtered (_("Killed %s\n"), target_pid_to_str (ptid)); > @@ -507,10 +512,10 @@ Please switch to another checkpoint befo > list, waitpid the ptid. > If fi->parent_ptid is a part of lwp and it is stoped, waitpid the > ptid. */ > - if ((!find_thread_ptid (fi->parent_ptid) && find_fork_ptid (fi->parent_ptid)) > - || (find_thread_ptid (fi->parent_ptid) && is_stopped (fi->parent_ptid))) > + if ((!find_thread_ptid (pptid) && find_fork_ptid (pptid)) Sorry, but is still not correct. When you end up with only one fork in the checkpoint list, delete_fork will delete it as well. For example: (gdb) checkpoint at this point, you have two checkpoints, checkpoint 1 (the forked child), and checkpoint 0, the inferior you were already debugging. When you delete the new checkpoint 1, with: (gdb) delete checkpoint 1 delete_fork will also delete checkpoint 0, the parent of checkpoint 1. (see the "Special case:" comment in delete_fork), so your find_fork_ptid(pptid) here will be too late. -- Pedro Alves