aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/sys_process.c
diff options
context:
space:
mode:
authorDavid Xu <davidxu@FreeBSD.org>2008-10-15 06:31:37 +0000
committerDavid Xu <davidxu@FreeBSD.org>2008-10-15 06:31:37 +0000
commit904c5ec4e3329b6df906f0ac7fb3966c82b766b8 (patch)
treeb5ea5e6ee198214fb2b60f739b585b03f37900b2 /sys/kern/sys_process.c
parentfc7a9640c7c71aca12239760b6d19ba287dbf728 (diff)
downloadsrc-904c5ec4e3329b6df906f0ac7fb3966c82b766b8.tar.gz
src-904c5ec4e3329b6df906f0ac7fb3966c82b766b8.zip
Notes
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r--sys/kern/sys_process.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index dbdd30f2d047..ceae8de8e904 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -700,15 +700,14 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
break;
case PT_SUSPEND:
+ td2->td_dbgflags |= TDB_SUSPEND;
thread_lock(td2);
- td2->td_flags |= TDF_DBSUSPEND;
+ td2->td_flags |= TDF_NEEDSUSPCHK;
thread_unlock(td2);
break;
case PT_RESUME:
- thread_lock(td2);
- td2->td_flags &= ~TDF_DBSUSPEND;
- thread_unlock(td2);
+ td2->td_dbgflags &= ~TDB_SUSPEND;
break;
case PT_STEP:
@@ -782,17 +781,13 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
p->p_xthread = NULL;
if ((p->p_flag & (P_STOPPED_SIG | P_STOPPED_TRACE)) != 0) {
/* deliver or queue signal */
- thread_lock(td2);
- td2->td_flags &= ~TDF_XSIG;
- thread_unlock(td2);
+ td2->td_dbgflags &= ~TDB_XSIG;
td2->td_xsig = data;
if (req == PT_DETACH) {
struct thread *td3;
FOREACH_THREAD_IN_PROC(p, td3) {
- thread_lock(td3);
- td3->td_flags &= ~TDF_DBSUSPEND;
- thread_unlock(td3);
+ td3->td_dbgflags &= ~TDB_SUSPEND;
}
}
/*
@@ -932,7 +927,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
}
pl = addr;
pl->pl_lwpid = td2->td_tid;
- if (td2->td_flags & TDF_XSIG)
+ if (td2->td_dbgflags & TDB_XSIG)
pl->pl_event = PL_EVENT_SIGNAL;
else
pl->pl_event = 0;