From bfe47eb1dfe2cde280e0f7b11cb1484279fbaebb Mon Sep 17 00:00:00 2001 From: kib Date: Thu, 23 Feb 2012 11:50:23 +0000 Subject: Allow the parent to gather the exit status of the children reparented to the debugger. When reparenting for debugging, keep the child in the new orphan list of old parent. When looping over the children in kern_wait(), iterate over both children list and orphan list to search for the process by pid. Submitted by: Dmitry Mikulin MFC after: 2 weeks --- sys/kern/sys_process.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'sys/kern/sys_process.c') diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 2060efe..9c6c204 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -841,8 +841,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) p->p_flag |= P_TRACED; p->p_oppid = p->p_pptr->p_pid; if (p->p_pptr != td->td_proc) { - /* Remember that a child is being debugged(traced). */ - p->p_pptr->p_dbg_child++; proc_reparent(p, td->td_proc); } data = SIGSTOP; @@ -931,7 +929,6 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) PROC_UNLOCK(pp); PROC_LOCK(p); proc_reparent(p, pp); - p->p_pptr->p_dbg_child--; if (pp == initproc) p->p_sigparent = SIGCHLD; } -- cgit v1.1