src/sys/kern/sys_process.c
/*
 * Stop a process because of a debugging event;
 * stay stopped until p->p_step is cleared
 * (cleared by PIOCCONT in procfs).
 */
Stop a process because of a debugging event;
stay stopped until p->p_step is cleared
(cleared by PIOCCONT in procfs).
Stop a process because of a debugging event ; stay stopped until p - > p_step is cleared ( cleared by PIOCCONT in procfs ) .
void
stopevent(struct proc *p, unsigned int event, unsigned int val)
{
	PROC_LOCK_ASSERT(p, MA_OWNED);
	p->p_step = 1;
	CTR3(KTR_PTRACE, "stopevent: pid %d event %u val %u", p->p_pid, event,
	    val);
	do {
		if (event != S_EXIT)
			p->p_xsig = val;
		p->p_xthread = NULL;
		p->p_stype = event;	
		wakeup(&p->p_stype);	
		msleep(&p->p_step, &p->p_mtx, PWAIT, "stopevent", 0);
	} while (p->p_step);
}
void stopevent ( struct proc * p , unsigned int event , unsigned int val ) { PROC_LOCK_ASSERT ( p , MA_OWNED ) ; p -> p_step = 1 ; CTR3 ( KTR_PTRACE , " " , p -> p_pid , event , val ) ; do { if ( event != S_EXIT ) p -> p_xsig = val ; p -> p_xthread = NULL ; p -> p_stype = event ; wakeup ( & p -> p_stype ) ; msleep ( & p -> p_step , & p -> p_mtx , PWAIT , " " , 0 ) ; } while ( p -> p_step ) ; }
Stop a process because of a debugging event;
 stay stopped until p->p_step is cleared
 (cleared by PIOCCONT in procfs).
Stop a process because of a debugging event ; stay stopped until p - > p_step is cleared ( cleared by PIOCCONT in procfs ) .
/* Which event caused the stop? */ /* Wake up any PIOCWAIT'ing procs */