Do not limit lwpinfo reporting of syscall number and args to SCE/SCX events. When td_sa holds the values, we can report them. Clear td_sa.code in TDA_SIG ast handler: this handler is run when the process is traced, and it is run with the last ptracestop() points before the return to userspace. This allows debugger to infer the interrupted syscall immediately after PT_ATTACH without the need to loose control to the debuggee' thread. It should work even when the debuggee is stopped in AST.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
sys/kern/kern_sig.c | ||
---|---|---|
347 | I think this line needs a comment explaining the interaction with ptrace. |
Comment Actions
IMO it would be nice to add a test case to tests/sys/kern/ptrace_test.c for this.
sys/kern/kern_sig.c | ||
---|---|---|
350 | A bit clearer (esp. for someone not so familiar with how ptrace works) might be something like: Clear td_sa.code: signal to ptrace that syscall arguments are unavailable after this point. This AST handler is the last chance for ptracestop() to signal the tracer before the tracee returns to userspace. | |
sys/kern/sys_process.c | ||
1519 | We don't want to clear pl_syscall_narg if td_sa.code == 0? |
sys/kern/sys_process.c | ||
---|---|---|
1519 | I think it does not matter, but ok. |