From: Hui Zhu <teawater@gmail.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: Michael Snyder <msnyder@vmware.com>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [RFA] Checkpoint: wait the defunct process when delete it
Date: Mon, 17 May 2010 06:41:00 -0000 [thread overview]
Message-ID: <AANLkTilVdqNi7gZemvP_sgCJTgx4CBLh_nFY_IWx43iW@mail.gmail.com> (raw)
In-Reply-To: <201005141608.16612.pedro@codesourcery.com>
On Fri, May 14, 2010 at 23:08, Pedro Alves <pedro@codesourcery.com> wrote:
> 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.
>
At this time, "find_thread_ptid (pptid) && is_stopped (pptid)" this
line will handle it.
Thanks,
Hui
next prev parent reply other threads:[~2010-05-17 6:37 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-09 6:23 Hui Zhu
2010-05-10 19:31 ` Michael Snyder
2010-05-10 23:30 ` Pedro Alves
2010-05-11 21:50 ` Michael Snyder
2010-05-11 22:28 ` Michael Snyder
2010-05-12 0:02 ` Pedro Alves
2010-05-11 22:43 ` Michael Snyder
2010-05-12 0:05 ` Pedro Alves
2010-05-12 0:27 ` Michael Snyder
2010-05-12 4:19 ` Hui Zhu
2010-05-12 18:39 ` Pedro Alves
2010-05-12 18:57 ` Pedro Alves
2010-05-13 9:11 ` Hui Zhu
2010-05-13 11:50 ` Pedro Alves
2010-05-14 11:05 ` Hui Zhu
2010-05-14 14:43 ` Pedro Alves
2010-05-14 15:08 ` Hui Zhu
2010-05-14 16:19 ` Pedro Alves
2010-05-17 6:41 ` Hui Zhu [this message]
2010-05-17 10:45 ` Pedro Alves
2010-05-18 17:18 ` Hui Zhu
2010-05-14 19:29 ` Michael Snyder
2010-05-17 8:11 ` Hui Zhu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=AANLkTilVdqNi7gZemvP_sgCJTgx4CBLh_nFY_IWx43iW@mail.gmail.com \
--to=teawater@gmail.com \
--cc=gdb-patches@sourceware.org \
--cc=msnyder@vmware.com \
--cc=pedro@codesourcery.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox