On Wed, 07 Oct 2009 15:33:49 +0200, Oleg Nesterov wrote: > On 10/06, Jan Kratochvil wrote: > > It should work also for PTRACE_SINGLESTEP. > > Heh. Yes, but with one exception. > > - the tracee has a hanlder for, say, SIGHUP > > - the tracee deques SIGHUP, reports to the tracer, > and stops. > > - the tracer does ptrace(SINGLESTEP, SIGHUP) > > // it could use another signr, this works. > // but the tracer must have a handler or > // everething is OK. > > - the tracee delivers SIGHUP to itself, handle_signal() > notices TIF_SINGLESTEP and calls ptrace_notify(). > > Now, the tracee reports SIGTRAP, but the next time the tracer does > ptrace(WHATEVER, SIGNR) SIGNR will be ignored.
OK, this is really a border case I did not mean. In such case the SIGHUP handler still is not fully execting and as the non-realtime signals do not nest (count) it is OK it gets activated only once. I did mean some more normal case of: ptrace (PTRACE_SIGNALSTEP, 0) = 0 waitpid() = SIGTRAP ptrace (PTRACE_SIGNALSTEP, 0) = 0 waitpid() = SIGTRAP PTRACE (PTRACE_DETACH, SIGSTOP) = 0 which I assume it will work. Thanks, Jan