From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18467 invoked by alias); 17 May 2010 06:37:27 -0000 Received: (qmail 18458 invoked by uid 22791); 17 May 2010 06:37:26 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from mail-pz0-f198.google.com (HELO mail-pz0-f198.google.com) (209.85.222.198) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 17 May 2010 06:37:22 +0000 Received: by pzk36 with SMTP id 36so2981430pzk.24 for ; Sun, 16 May 2010 23:37:21 -0700 (PDT) Received: by 10.142.248.22 with SMTP id v22mr3025227wfh.276.1274078241170; Sun, 16 May 2010 23:37:21 -0700 (PDT) MIME-Version: 1.0 Received: by 10.143.158.5 with HTTP; Sun, 16 May 2010 23:37:01 -0700 (PDT) In-Reply-To: <201005141608.16612.pedro@codesourcery.com> References: <201005141320.09678.pedro@codesourcery.com> <201005141608.16612.pedro@codesourcery.com> From: Hui Zhu Date: Mon, 17 May 2010 06:41:00 -0000 Message-ID: Subject: Re: [RFA] Checkpoint: wait the defunct process when delete it To: Pedro Alves Cc: Michael Snyder , "gdb-patches@sourceware.org" Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg00336.txt.bz2 On Fri, May 14, 2010 at 23:08, Pedro Alves wrote: > Thanks Hui, > > On Friday 14 May 2010 15:43:23, Hui Zhu wrote: >> + =A0pptid =3D fi->parent_ptid; >> >> =A0 =A0if (from_tty) >> =A0 =A0 =A0printf_filtered (_("Killed %s\n"), target_pid_to_str (ptid)); >> @@ -507,10 +512,10 @@ Please switch to another checkpoint befo >> =A0 =A0 =A0 list, waitpid the ptid. >> =A0 =A0 =A0 If fi->parent_ptid is a part of lwp and it is stoped, waitpi= d the >> =A0 =A0 =A0 ptid. =A0*/ >> - =A0if ((!find_thread_ptid (fi->parent_ptid) && find_fork_ptid (fi->par= ent_ptid)) >> - =A0 =A0 =A0|| (find_thread_ptid (fi->parent_ptid) && is_stopped (fi->p= arent_ptid))) >> + =A0if ((!find_thread_ptid (pptid) && find_fork_ptid (pptid)) > > Sorry, but is still not correct. =A0When you end up with only one fork > in the checkpoint list, delete_fork will delete it as well. =A0For > example: > > (gdb) checkpoint > > at this point, you have two checkpoints, checkpoint 1 (the forked child), > and checkpoint 0, the inferior you were already debugging. =A0When 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. > At this time, "find_thread_ptid (pptid) && is_stopped (pptid)" this line will handle it. Thanks, Hui