The new test ptrace-tests/tests/step-from-clone.c fails. I didn't know that PTRACE_SINGLESTEP is not "user-mode only". I thought that the next stop should happen only after return to user-mode.
However, the current behaviour is that PTRACE_SINGLESTEP acts like PTRACE_SYSCALL (but see below), if the tracee is not going to return to user-mode yet. Say, PTRACE_EVENT_VFORK. step-from-clone still fails because PTRACE_O_TRACESYSGOOD adds 0x80 to ->ex_code even after PTRACE_SINGLESTEP, see the next patch. --- kernel/ptrace.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- PU/kernel/ptrace.c~54_STEP_IMPLIES_O_SYSCALL 2009-09-23 20:51:47.000000000 +0200 +++ PU/kernel/ptrace.c 2009-09-23 21:52:46.000000000 +0200 @@ -947,7 +947,7 @@ static void do_ptrace_resume(struct utra { struct ptrace_context *context = ptrace_context(engine); - if (request == PTRACE_SYSCALL) + if (request == PTRACE_SYSCALL || action != UTRACE_RESUME) context->options |= PTRACE_O_TRACE_SYSCALL; else context->options &= ~PTRACE_O_TRACE_SYSCALL;