diff options
author | jhb <jhb@FreeBSD.org> | 2010-06-01 19:38:46 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2010-06-01 19:38:46 +0000 |
commit | 9db837f8de5be1248146ba60620322bd3600595c (patch) | |
tree | 781d425d222e01fed89a37de93154d7961796279 /sys/kern | |
parent | 076cb874547b39739bd223700134b47cdf94d1f9 (diff) | |
download | FreeBSD-src-9db837f8de5be1248146ba60620322bd3600595c.zip FreeBSD-src-9db837f8de5be1248146ba60620322bd3600595c.tar.gz |
MFC 208555:
Ignore the 'addr' argument passed to PT_STEP (it is required to be '1'
for PT_STEP which means "ignore") and PT_DETACH.
Approved by: re (kib)
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/sys_process.c | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c index 88f4f60..f761d69 100644 --- a/sys/kern/sys_process.c +++ b/sys/kern/sys_process.c @@ -896,24 +896,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; @@ -938,6 +943,7 @@ kern_ptrace(struct thread *td, int req, pid_t pid, void *addr, int data) /* should we send SIGCHLD? */ /* childproc_continued(p); */ + break; } sendsig: |