Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@vmware.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	 Hui Zhu <teawater@gmail.com>
Subject: Re: [RFA] Checkpoint: wait the defunct process when delete it
Date: Tue, 11 May 2010 22:28:00 -0000	[thread overview]
Message-ID: <4BE9D9E9.5020806@vmware.com> (raw)
In-Reply-To: <4BE9D122.1090803@vmware.com>

[-- Attachment #1: Type: text/plain, Size: 702 bytes --]

Michael Snyder wrote:
> Pedro Alves wrote:
>> On Sunday 09 May 2010 07:23:15, Hui Zhu wrote:
>>
>>> I found that when we delete the checkpoint process, it keep defunct.
>>> This is because the parent process is still running and didn't wait
>>> it.
>>> So I add a wait_ptid function after ptrace kill.
>> You're assuming inferior_ptid is the parent process
>> of the checkpoint fork, but I don't believe that is always
>> true.  
> 
> Correct.  Maybe we should add a "parent ID" field to the
> internal checkpoint table?


Hui,

Here's a small change that saves the parent PTID.

Can you combine this with your change, to make sure that
waitpid is called by the correct process?

Good luck,
Michael




[-- Attachment #2: fork.txt --]
[-- Type: text/plain, Size: 756 bytes --]

Index: linux-fork.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-fork.c,v
retrieving revision 1.32
diff -u -p -r1.32 linux-fork.c
--- linux-fork.c	5 May 2010 20:37:23 -0000	1.32
+++ linux-fork.c	11 May 2010 22:26:08 -0000
@@ -47,6 +47,7 @@ struct fork_info
 {
   struct fork_info *next;
   ptid_t ptid;
+  ptid_t parent_ptid;
   int num;			/* Convenient handle (GDB fork id) */
   struct regcache *savedregs;	/* Convenient for info fork, saves
 				   having to actually switch contexts.  */
@@ -596,6 +597,7 @@ checkpoint_command (char *args, int from
   if (!fp)
     error (_("Failed to find new fork"));
   fork_save_infrun_state (fp, 1);
+  fp->parent_ptid = last_target_ptid;
 }
 
 static void

  reply	other threads:[~2010-05-11 22:28 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 [this message]
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
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=4BE9D9E9.5020806@vmware.com \
    --to=msnyder@vmware.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@codesourcery.com \
    --cc=teawater@gmail.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