NetBSD/sys
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
..
altq PR 51553 David Binderman: don't bother counting up backlogged classes 2016-11-21 07:15:36 +00:00
arch fix types. 2017-01-14 00:35:37 +00:00
coda Remove now obsolete operation vcache_remove(). 2016-08-20 12:37:06 +00:00
compat fix typo 2017-01-13 22:46:43 +00:00
conf Disable a couple of warnings until further investigation. 2017-01-11 12:19:43 +00:00
crypto Add XTS mode. 2016-12-11 00:28:44 +00:00
ddb Add ddb command to find a vnode by the address of its lock. 2017-01-11 12:17:34 +00:00
dev Remove more dead code 2017-01-13 14:48:18 +00:00
dist/pf pfil(9) improvements to handle address changes: 2016-12-26 23:21:49 +00:00
external Don't play with the linked list while holding only a read lock! 2017-01-13 15:17:00 +00:00
fs Remove RO check in tmpfs_putpages for now, the syncer doesn't like the 2017-01-11 12:12:32 +00:00
gdbscripts Move vnode members "v_freelisthd" and "v_freelist" from "struct vnode" 2016-12-14 15:48:54 +00:00
ipkdb
kern Introduce PTRACE_LWP_{CREATE,EXIT} in ptrace(2) and TRAP_LWP in siginfo(5) 2017-01-14 06:36:52 +00:00
lib Explain how all that mess works, without actually fixing it yet. 2017-01-06 09:14:36 +00:00
miscfs Move vnode member v_lock as vi_lock to vnode_impl.h. 2017-01-11 09:08:58 +00:00
modules Don't define PT_{S,G}ETREGS on the command line. Yes, it can make things 2017-01-13 06:04:48 +00:00
net Fix a bug that the parent interface's callback wasn't called when the vlan 2017-01-13 06:11:56 +00:00
net80211 Export some 802.11 IE manipulate functions. 2017-01-04 03:05:24 +00:00
netatalk Add rtcache_unref to release points of rtentry stemming from rtcache 2016-12-08 05:16:33 +00:00
netbt acknowleg -> acknowledg, proceedure -> procedure. 2016-12-12 15:58:44 +00:00
netinet Get rid of unnecessary header inclusions 2017-01-11 13:08:29 +00:00
netinet6 Tweak icmp6_input; always use off, not *offp 2017-01-13 10:38:37 +00:00
netipsec Add rtcache_unref to release points of rtentry stemming from rtcache 2016-12-08 05:16:33 +00:00
netisdn Annotate bpf_mtap still running in Rx hardware interrupt with "XXX not in softint" 2016-12-15 09:35:24 +00:00
netkey
netmpls Assert size for sockaddr_mpls, but don't require it to be packed. 2016-10-08 20:19:37 +00:00
netnatm Fix race condition on ifqueue used by traditional netisr 2016-10-03 11:06:06 +00:00
netsmb Uninitialized vars, found by brainy 2016-08-15 08:17:35 +00:00
nfs Memory leak, found by Mootja. 2016-11-20 09:28:43 +00:00
opencrypto From Alexander Nasonov: 2016-09-26 14:50:54 +00:00
rump regen 2017-01-13 06:18:31 +00:00
secmodel
stand
sys Introduce PTRACE_LWP_{CREATE,EXIT} in ptrace(2) and TRAP_LWP in siginfo(5) 2017-01-14 06:36:52 +00:00
ufs Fix unsigned 2017-01-13 18:04:36 +00:00
uvm add missing forward struct decl 2017-01-13 04:43:16 +00:00
Makefile