Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/kern_fork.c
Show First 20 Lines • Show All 1,068 Lines • ▼ Show 20 Lines | if (td->td_dbgflags & TDB_STOPATFORK) { | ||||
sx_xlock(&proctree_lock); | sx_xlock(&proctree_lock); | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
if (p->p_pptr->p_ptevents & PTRACE_FORK) { | if (p->p_pptr->p_ptevents & PTRACE_FORK) { | ||||
/* | /* | ||||
* If debugger still wants auto-attach for the | * If debugger still wants auto-attach for the | ||||
* parent's children, do it now. | * parent's children, do it now. | ||||
*/ | */ | ||||
dbg = p->p_pptr->p_pptr; | dbg = p->p_pptr->p_pptr; | ||||
proc_set_traced(p); | proc_set_traced(p, true); | ||||
CTR2(KTR_PTRACE, | CTR2(KTR_PTRACE, | ||||
"fork_return: attaching to new child pid %d: oppid %d", | "fork_return: attaching to new child pid %d: oppid %d", | ||||
p->p_pid, p->p_oppid); | p->p_pid, p->p_oppid); | ||||
proc_reparent(p, dbg); | proc_reparent(p, dbg); | ||||
sx_xunlock(&proctree_lock); | sx_xunlock(&proctree_lock); | ||||
td->td_dbgflags |= TDB_CHILD | TDB_SCX | TDB_FSTP; | td->td_dbgflags |= TDB_CHILD | TDB_SCX | TDB_FSTP; | ||||
ptracestop(td, SIGSTOP); | ptracestop(td, SIGSTOP); | ||||
td->td_dbgflags &= ~(TDB_CHILD | TDB_SCX); | td->td_dbgflags &= ~(TDB_CHILD | TDB_SCX); | ||||
Show All 31 Lines |