On Sat, Jul 11, 2009 at 11:07:51AM +0300, Shachar Shemesh wrote: > The problem is that, as a debugger, I need to be able to > differentiate between a SIGTRAP supposedly delivered to the debuggee > because I asked to trace the system calls, and a SIGTRAP actually > delivered to the debuggee. If I don't, my count is going to be off, > and I will totally mis-interpret the debugee's state. > > The best way, as far as I can tell, to do that on Linux is to use the > PTRACE_GETSIGINFO command. This provides me with a field, si_code, > that can distinguish between a signal and a system call. This is > important to make sure that I don't get confused over which is which.
Have you seen PTRACE_SETOPTIONS and PTRACE_O_TRACESYSGOOD? -- Daniel Jacobowitz CodeSourcery