f9b2093d06
Introduce new API for debuggers to allow/prevent execution of the specified thread. New ptrace(2) operations: PT_RESUME Allow execution of a specified thread, change its state from suspended to continued. The addr argument is unused. The data argument specifies the LWP ID. This call is equivalent to _lwp_continue(2) called by a traced process. This call does not change the general process state from stopped to continued. PT_SUSPEND Prevent execution of a specified thread, change its state from continued to suspended. The addr argument is unused. The data argument specifies the requested LWP ID. This call is equivalent to _lwp_suspend(2) called by a traced process. This call does not change the general process state from continued to stopped. This interface is modeled after FreeBSD, however with NetBSD specific arguments passed to ptrace(2) -- FreeBSD passes only thread id, NetBSD passes process and thread id. Extend PT_LWPINFO operation in ptrace(2) to report suspended threads. In the ptrace_lwpinfo structure in pl_event next to PL_EVENT_NONE and PL_EVENT_SIGNAL add new value PL_EVENT_SUSPENDED. Add new errno(2) value EDEADLK that might be returned by ptrace(2). It prevents dead-locking in a scenario of resuming a process or thread that is prevented from execution. This fixes bug that old API was vulnerable to this scenario. Kernel bump delayed till introduction of PT_GETDBREGS/PT_SETDBREGS soon. Add new ATF tests: - resume1 Verify that a thread can be suspended by a debugger and later resumed by the debugger - suspend1 Verify that a thread can be suspended by a debugger and later resumed by a tracee - suspend2 Verify that the while the only thread within a process is suspended, the whole process cannot be unstopped Sponsored by <The NetBSD Foundation> |
||
---|---|---|
.. | ||
arch | ||
kqueue | ||
tty | ||
gen_t_subr_prf | ||
h_ps_strings1.c | ||
h_ps_strings2.c | ||
Makefile | ||
Makefile.inc | ||
msg.h | ||
t_extattrctl.c | ||
t_extent.c | ||
t_filedesc.c | ||
t_kauth_pr_47598.c | ||
t_lock.c | ||
t_lockf.c | ||
t_mqueue.c | ||
t_ps_strings.sh | ||
t_ptrace_wait3.c | ||
t_ptrace_wait4.c | ||
t_ptrace_wait6.c | ||
t_ptrace_wait.c | ||
t_ptrace_wait.h | ||
t_ptrace_waitid.c | ||
t_ptrace_waitpid.c | ||
t_ptrace.c | ||
t_pty.c | ||
t_rnd.c | ||
t_sysctl.c | ||
t_sysv.c | ||
t_umount.sh | ||
t_umountstress.sh |