summaryrefslogtreecommitdiffstats
path: root/sys/kern/sys_process.c
diff options
context:
space:
mode:
authorart <art@openbsd.org>2002-03-12 11:57:12 +0000
committerart <art@openbsd.org>2002-03-12 11:57:12 +0000
commitf73842caab23a12641aa4ada37fb2ee4bd4e9f89 (patch)
tree849823ab44a432da9d8d5c7a46ad0247192a247e /sys/kern/sys_process.c
parentAdd PT_IO to ptrace ops. (diff)
downloadwireguard-openbsd-f73842caab23a12641aa4ada37fb2ee4bd4e9f89.tar.xz
wireguard-openbsd-f73842caab23a12641aa4ada37fb2ee4bd4e9f89.zip
In the PT_STEP case, first set the new pc, then arrange
for the single-step. This can slightly break the error handling when setting the sstep fails, but allows us to emulate single stepping in software on arch that don't have support for that in hardware.
Diffstat (limited to 'sys/kern/sys_process.c')
-rw-r--r--sys/kern/sys_process.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
index 55d3f6e7077..7f695677ae8 100644
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_process.c,v 1.19 2002/03/11 15:39:27 art Exp $ */
+/* $OpenBSD: sys_process.c,v 1.20 2002/03/12 11:57:12 art Exp $ */
/* $NetBSD: sys_process.c,v 1.55 1996/05/15 06:17:47 tls Exp $ */
/*-
@@ -283,6 +283,11 @@ sys_ptrace(p, v, retval)
return (EINVAL);
PHOLD(t);
+ /* If the address paramter is not (int *)1, set the pc. */
+ if ((int *)SCARG(uap, addr) != (int *)1)
+ if ((error = process_set_pc(t, SCARG(uap, addr))) != 0)
+ goto relebad;
+
#ifdef PT_STEP
/*
* Arrange for a single-step, if that's requested and possible.
@@ -291,11 +296,6 @@ sys_ptrace(p, v, retval)
if (error)
goto relebad;
#endif
-
- /* If the address paramter is not (int *)1, set the pc. */
- if ((int *)SCARG(uap, addr) != (int *)1)
- if ((error = process_set_pc(t, SCARG(uap, addr))) != 0)
- goto relebad;
PRELE(t);
goto sendsig;