diff options
author | 2012-04-13 16:37:50 +0000 | |
---|---|---|
committer | 2012-04-13 16:37:50 +0000 | |
commit | 4ec195400d023537d947ee6557938900b7cc7161 (patch) | |
tree | ae5a44c0389aa411ffbe8060c039ba000dad12a8 /sys/kern/kern_fork.c | |
parent | Don't try to mmap a 0-length file. (diff) | |
download | wireguard-openbsd-4ec195400d023537d947ee6557938900b7cc7161.tar.xz wireguard-openbsd-4ec195400d023537d947ee6557938900b7cc7161.zip |
First stab at making ptrace(2) usable for debugging multi-threaded programs.
It implements a full-stop model where all threads are stopped before handing
over control to the debugger. Events are reported as before through wait(2);
you will have to call ptrace(PT_GET_PROCESS_STATE, ...) to find out which
thread hit the event. Since this changes the size of struct ptrace_state,
you will have to recompile gdb.
ok guenther@
Diffstat (limited to 'sys/kern/kern_fork.c')
-rw-r--r-- | sys/kern/kern_fork.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index 62ed83d6e0f..e2771d04022 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_fork.c,v 1.138 2012/04/12 12:33:03 deraadt Exp $ */ +/* $OpenBSD: kern_fork.c,v 1.139 2012/04/13 16:37:51 kettenis Exp $ */ /* $NetBSD: kern_fork.c,v 1.29 1996/02/09 18:59:34 christos Exp $ */ /* @@ -288,6 +288,7 @@ fork1(struct proc *curp, int exitsig, int flags, void *stack, pid_t *tidptr, p->p_stat = SIDL; /* protect against others */ p->p_exitsig = exitsig; p->p_flag = 0; + p->p_xstat = 0; if (flags & FORK_THREAD) { atomic_setbits_int(&p->p_flag, P_THREAD); |