This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Checkpoint: wait the defunct process when delete it
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
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