Re: [RFC] Proposal for ptrace improvements

From: Tejun Heo
Date: Wed Mar 02 2011 - 10:31:14 EST


Hey,

On Wed, Mar 02, 2011 at 04:16:50PM +0100, Denys Vlasenko wrote:
> Assuming the program is run under simple debugger which
> resumes execution using PTRACE_CONT(sig) on signal delivery stops,
> with PTRACE_CONT(0) on ptrace stops,
> and doesn't do any PTRACE_CONT on job control stops,
> with your proposal the debugger will see and perform
> the following actions:
>
> waitpid...
> <------ kill -STOP 16382
> waitpid returns WSTOPPED, WSTOPSIG = SIGSTOP
> ptrace(PTRACE_GETSIGINFO) doesn't fail (=> it's signal delivery)
> ptrace(PTRACE_CONT, SIGSTOP)
> waitpid returns WSTOPPED, WSTOPSIG = SIGSTOP
> ptrace(PTRACE_GETSIGINFO) fails (=> it's job control stop)
> waitpid...
> <------ kill -ABRT 16382
> ...debugger doesn't wake up...
> <------ kill -WINCH 16382
> ...debugger doesn't wake up...
> <------ kill -CONT 16382
> waitpid returns WSTOPPED, WSTOPSIG = SIGTRAP (it's a ptrace-stop)
> ptrace(PTRACE_CONT, 0)
> waitpid returns WSTOPPED, WSTOPSIG = SIGWINCH
> ptrace(PTRACE_CONT, SIGWINCH)
> waitpid returns WSTOPPED, WSTOPSIG = SIGCONT
> ptrace(PTRACE_CONT, SIGCONT)
> waitpid returns WSTOPPED, WSTOPSIG = SIGABRT
> ptrace(PTRACE_CONT, SIGABRT)
>
> Correct?

Yeah, seems correct to me.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/