summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2002-03-12 11:57:13 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2002-03-12 11:57:13 +0000
commit1f81b3a4471284b779fdf18bad08ed80babb2cd9 (patch)
tree977d9f3e63029d9e9fdadd491fcda95cf1da3ca8 /sys
parent66ef7e2661207ebe912448cf7759aa54ced97ffd (diff)
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')
-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;