Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/subr_syscall.c
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | #endif | ||||
if (error == 0) { | if (error == 0) { | ||||
STOPEVENT(p, S_SCE, sa->narg); | STOPEVENT(p, S_SCE, sa->narg); | ||||
if (p->p_flag & P_TRACED) { | if (p->p_flag & P_TRACED) { | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
td->td_dbg_sc_code = sa->code; | td->td_dbg_sc_code = sa->code; | ||||
td->td_dbg_sc_narg = sa->narg; | td->td_dbg_sc_narg = sa->narg; | ||||
if (p->p_stops & S_PT_SCE) | if (p->p_ptevents & PTRACE_SCE) | ||||
ptracestop((td), SIGTRAP); | ptracestop((td), SIGTRAP); | ||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
} | } | ||||
if (td->td_dbgflags & TDB_USERWR) { | if (td->td_dbgflags & TDB_USERWR) { | ||||
/* | /* | ||||
* Reread syscall number and arguments if | * Reread syscall number and arguments if | ||||
* debugger modified registers or memory. | * debugger modified registers or memory. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 104 Lines • ▼ Show 20 Lines | if (traced || (td->td_dbgflags & (TDB_EXEC | TDB_FORK)) != 0) { | ||||
/* | /* | ||||
* If tracing the execed process, trap to the debugger | * If tracing the execed process, trap to the debugger | ||||
* so that breakpoints can be set before the program | * so that breakpoints can be set before the program | ||||
* executes. If debugger requested tracing of syscall | * executes. If debugger requested tracing of syscall | ||||
* returns, do it now too. | * returns, do it now too. | ||||
*/ | */ | ||||
if (traced && | if (traced && | ||||
((td->td_dbgflags & (TDB_FORK | TDB_EXEC)) != 0 || | ((td->td_dbgflags & (TDB_FORK | TDB_EXEC)) != 0 || | ||||
(p->p_stops & S_PT_SCX) != 0)) | (p->p_ptevents & PTRACE_SCX) != 0)) | ||||
ptracestop(td, SIGTRAP); | ptracestop(td, SIGTRAP); | ||||
td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); | td->td_dbgflags &= ~(TDB_SCX | TDB_EXEC | TDB_FORK); | ||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
} | } | ||||
if (td->td_pflags & TDP_RFPPWAIT) { | if (td->td_pflags & TDP_RFPPWAIT) { | ||||
/* | /* | ||||
* Preserve synchronization semantics of vfork. If | * Preserve synchronization semantics of vfork. If | ||||
Show All 27 Lines |