When I want to inspect tracee syscall I use PTRACE_ATTACH
, then PTRACE_SYSCALL
in loop , and finally PTRACE_DETACH
.
The problem is that if the tracee registered to SIGTRAP or SIGCONT it can change his behaviour while I use PTRACE_SYSCALL or PTRACE_DETACH and I don't want to do it.
When I attach to tracee with PTRACE_ATTACH
tracee got SIGSTOP
but it can't register/reaction to this signal, so that it fine.
What is the solution that the tracee could not catch SIGTRAP when I use PTRACE_SYSCALL
or SIGCONT when I used PTRACE_CONT