aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/sys_process.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2010-05-25 21:32:37 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2010-05-25 21:32:37 +0000
commit0bfbf4d2208643ebe6b6a9f7f8374bc60a6af5c5 (patch)
tree317c531247519e78e5f02421f276bb579b042c94 /sys/kern/sys_process.c
parentf25a8a0150ba99f63ed9e689d8636d91ba7d78b0 (diff)
downloadsrc-0bfbf4d2208643ebe6b6a9f7f8374bc60a6af5c5.tar.gz
src-0bfbf4d2208643ebe6b6a9f7f8374bc60a6af5c5.zip
Notes
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r--sys/kern/sys_process.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 6decc0296785..65d9f690a135 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -899,24 +899,29 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
if (error)
goto out;
break;
+ case PT_CONTINUE:
case PT_TO_SCE:
- p->p_stops |= S_PT_SCE;
- break;
case PT_TO_SCX:
- p->p_stops |= S_PT_SCX;
- break;
case PT_SYSCALL:
- p->p_stops |= S_PT_SCE | S_PT_SCX;
- break;
- }
-
- if (addr != (void *)1) {
- error = ptrace_set_pc(td2, (u_long)(uintfptr_t)addr);
- if (error)
+ if (addr != (void *)1) {
+ error = ptrace_set_pc(td2,
+ (u_long)(uintfptr_t)addr);
+ if (error)
+ goto out;
+ }
+ switch (req) {
+ case PT_TO_SCE:
+ p->p_stops |= S_PT_SCE;
break;
- }
-
- if (req == PT_DETACH) {
+ case PT_TO_SCX:
+ p->p_stops |= S_PT_SCX;
+ break;
+ case PT_SYSCALL:
+ p->p_stops |= S_PT_SCE | S_PT_SCX;
+ break;
+ }
+ break;
+ case PT_DETACH:
/* reset process parent */
if (p->p_oppid != p->p_pptr->p_pid) {
struct proc *pp;
@@ -941,6 +946,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data)
/* should we send SIGCHLD? */
/* childproc_continued(p); */
+ break;
}
sendsig: