NetBSD/tests/kernel
kamil f9b2093d06 Introduce new ptrace(2) API to allow/prevent exection of LWP
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>
2017-02-22 23:43:43 +00:00
..
arch Add kernel/arch/x86 ATF tests for CPU Debug Registers for amd64 and i386 2017-02-22 01:07:13 +00:00
kqueue Don't play with "../.." in includes for h_macros.h; deal with it centrally. 2017-01-13 21:30:39 +00:00
tty Define _KERNTYPES for things that need it. 2016-01-23 21:22:45 +00:00
gen_t_subr_prf Merge tls-earlyentropy branch into HEAD. 2014-08-10 16:44:32 +00:00
h_ps_strings1.c
h_ps_strings2.c
Makefile Define -D_KERNTYPES in CPPFLAGS unconditionally to fix MKRUMP=no build 2016-12-14 06:19:59 +00:00
Makefile.inc
msg.h - abstract the pipe calls into routines. 2016-12-05 20:10:10 +00:00
t_extattrctl.c
t_extent.c Don't play with "../.." in includes for h_macros.h; deal with it centrally. 2017-01-13 21:30:39 +00:00
t_filedesc.c Don't play with "../.." in includes for h_macros.h; deal with it centrally. 2017-01-13 21:30:39 +00:00
t_kauth_pr_47598.c Skip the curtain test case if curtain is not enabled and we would not 2014-04-28 08:34:16 +00:00
t_lock.c Don't play with "../.." in includes for h_macros.h; deal with it centrally. 2017-01-13 21:30:39 +00:00
t_lockf.c fix unused variable warnings 2013-10-19 17:45:00 +00:00
t_mqueue.c PR/51871: Ngie Cooper: add fcntl.h for O_* fcntl/open constants 2017-01-14 20:57:24 +00:00
t_ps_strings.sh
t_ptrace_wait3.c Add new tests for combination of wait(2) interfaces with ptrace(2) 2016-11-07 21:09:03 +00:00
t_ptrace_wait4.c Add new tests for combination of wait(2) interfaces with ptrace(2) 2016-11-07 21:09:03 +00:00
t_ptrace_wait6.c Add new tests for combination of wait(2) interfaces with ptrace(2) 2016-11-07 21:09:03 +00:00
t_ptrace_wait.c Introduce new ptrace(2) API to allow/prevent exection of LWP 2017-02-22 23:43:43 +00:00
t_ptrace_wait.h Switch back arch/amd64/t_ptrace_wait.c to r1.6 and restore original DBREGS 2017-02-16 15:57:45 +00:00
t_ptrace_waitid.c Add new tests for combination of wait(2) interfaces with ptrace(2) 2016-11-07 21:09:03 +00:00
t_ptrace_waitpid.c Add new tests for combination of wait(2) interfaces with ptrace(2) 2016-11-07 21:09:03 +00:00
t_ptrace.c Don't play with "../.." in includes for h_macros.h; deal with it centrally. 2017-01-13 21:30:39 +00:00
t_pty.c Don't play with "../.." in includes for h_macros.h; deal with it centrally. 2017-01-13 21:30:39 +00:00
t_rnd.c Don't play with "../.." in includes for h_macros.h; deal with it centrally. 2017-01-13 21:30:39 +00:00
t_sysctl.c Test that reading a CTLTYPE_INT sysctl variable into a buffer that is 2014-08-09 07:04:03 +00:00
t_sysv.c Make cleanup routines actually work. 2014-03-02 20:13:12 +00:00
t_umount.sh
t_umountstress.sh Don't rely on "kill -0" to check whether a background shell command 2013-05-31 14:40:48 +00:00