Go to file
kamil 6413a1acf0 Introduce PTRACE_LWP_{CREATE,EXIT} in ptrace(2) and TRAP_LWP in siginfo(5)
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>
2017-01-14 06:36:52 +00:00
bin need <time.h> for time(3) 2017-01-10 20:44:05 +00:00
common fix standalone 2017-01-14 04:54:42 +00:00
compat Don't mix abis in any CRUNCHEDPROG 2017-01-05 21:28:42 +00:00
crypto Add missing <sys/stat.h> for open(2) flags. 2017-01-13 08:41:46 +00:00
dist/pf PR 50709 David Binderman: memory leak 2016-05-30 17:21:07 +00:00
distrib add new test file 2017-01-14 01:44:13 +00:00
doc Update TODO.ptrace 2017-01-14 01:36:28 +00:00
etc Update Clang header directory. 2017-01-11 12:10:48 +00:00
external need <sys/param.h> 2017-01-13 19:11:16 +00:00
extsrc
games need time.h for time(), got side-loaded before from <fcntl.h> via <sys/stat.h> 2017-01-10 20:41:40 +00:00
gnu has moved to external/gpl3 2016-01-16 18:41:12 +00:00
include Welcome to the constant age! 2017-01-12 18:42:53 +00:00
lib Document PTRACE_VFORK and PTRACE_VFORK_DONE in ptrace(2) 2017-01-14 00:02:40 +00:00
libexec need <sys/stat.h> 2017-01-10 21:08:48 +00:00
regress need <sys/stat.h> 2017-01-10 22:37:44 +00:00
rescue vnconfig(8) was renamed to vndconfig(8) some time ago, and most places 2016-08-04 03:50:55 +00:00
sbin Disable a couple of warnings until further investigation. 2017-01-11 12:19:43 +00:00
share enable again system header warnings now amd64 builds. 2017-01-13 14:34:58 +00:00
sys Introduce PTRACE_LWP_{CREATE,EXIT} in ptrace(2) and TRAP_LWP in siginfo(5) 2017-01-14 06:36:52 +00:00
tests Introduce PTRACE_LWP_{CREATE,EXIT} in ptrace(2) and TRAP_LWP in siginfo(5) 2017-01-14 06:36:52 +00:00
tools Sync tools build glue with LLVM pre-4.0.0. 2017-01-11 12:08:34 +00:00
usr.bin don't do _KERNEL; hides bswap stuff. 2017-01-14 01:01:48 +00:00
usr.sbin another buffer overflow. 2017-01-13 05:49:27 +00:00
build.sh add a trailing / to force symlink resolution. 2016-12-18 19:39:05 +00:00
BUILDING Document MKREPRO_TIMESTAMP. 2016-01-29 13:51:13 +00:00
Makefile fix direct reference to texinfo, bleh 2016-01-14 02:51:25 +00:00
Makefile.inc
UPDATING xinput update build hint 2017-01-05 05:40:46 +00:00