From 1f81b3a4471284b779fdf18bad08ed80babb2cd9 Mon Sep 17 00:00:00 2001 From: Artur Grabowski Date: Tue, 12 Mar 2002 11:57:13 +0000 Subject: 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. --- sys/kern/sys_process.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'sys') 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; -- cgit v1.2.3