6413a1acf0
Add interface in ptrace(2) to track thread (LWP) events: - birth, - termination. The purpose of this thread is to keep track of the current thread state in a tracee and apply e.g. per-thread designed hardware assisted watchpoints. This interface reuses the EVENT_MASK and PROCESS_STATE interface, and shares it with PTRACE_FORK, PTRACE_VFORK and PTRACE_VFORK_DONE. Change the following structure: typedef struct ptrace_state { int pe_report_event; pid_t pe_other_pid; } ptrace_state_t; to typedef struct ptrace_state { int pe_report_event; union { pid_t _pe_other_pid; lwpid_t _pe_lwp; } _option; } ptrace_state_t; #define pe_other_pid _option._pe_other_pid #define pe_lwp _option._pe_lwp This keeps size of ptrace_state_t unchanged as both pid_t and lwpid_t are defined as int32_t-like integer. This change does not break existing prebuilt software and has minimal effect on necessity for source-code changes. In summary, this change should be binary compatible and shouldn't break build of existing software. Introduce new siginfo(5) type for LWP events under the SIGTRAP signal: TRAP_LWP. This change will help debuggers to distinguish exact source of SIGTRAP. Add two basic t_ptrace_wait* tests: lwp_create1: Verify that 1 LWP creation is intercepted by ptrace(2) with EVENT_MASK set to PTRACE_LWP_CREATE lwp_exit1: Verify that 1 LWP creation is intercepted by ptrace(2) with EVENT_MASK set to PTRACE_LWP_EXIT All tests are passing. Surfing the previous kernel ABI bump to 7.99.59 for PTRACE_VFORK{,_DONE}. Sponsored by <The NetBSD Foundation> |
||
---|---|---|
.. | ||
bin | ||
crypto | ||
dev | ||
fs | ||
games | ||
include | ||
ipf | ||
kernel | ||
lib | ||
libexec | ||
modules | ||
net | ||
rump | ||
sbin | ||
share | ||
sys | ||
usr.bin | ||
usr.sbin | ||
h_macros.h | ||
Makefile | ||
Makefile.inc | ||
README |
$NetBSD: README,v 1.4 2012/05/18 15:36:21 jruoho Exp $ When adding new tests, please try to follow the following conventions. 1. For library routines, including system calls, the directory structure of the tests should follow the directory structure of the real source tree. For instance, interfaces available via the C library should follow: src/lib/libc/gen -> src/tests/lib/libc/gen src/lib/libc/sys -> src/tests/lib/libc/sys ... 2. Equivalently, all tests for userland utilities should try to follow their location in the source tree. If this can not be satisfied, the tests for a utility should be located under the directory to which the utility is installed. Thus, a test for env(1) should go to src/tests/usr.bin/env. Likewise, a test for tcpdump(8) should be in src/tests/usr.sbin/tcpdump, even though the source code for the program is located under src/external. 3. Otherwise use your own discretion.