Yes, it is not a really good idea to add something to struct user. That willTypo with<->without?
affect the dump format and debugging tools. So it would be an additional ptrace
command like PTRACE_SETTRAP/PTRACE_GETTRAP. The only other solution I can think
of is to be more specific about what the debugger can indicate to the debuggee
what needs to be done after the first syscall_trace invocation. At the moment
it is either
1) a valid system call number, execute the new syscall, or
2) an invalid system call number, skip the system call but don't change
regs->traps and do system call restarting if another signal is pending
If we use more specific error codes instead of just any invalid syscall number
we could have e.g. this:
1) a vaild system call number, execute the new syscall,
2) -Exxx, skip the system call, store -1 to regs->trap and then continue
with restarting system calls if another system call is pending.
3) -Eyyy, skip the system call but leave regs->trap intact so that a pendingNot only -Eyyy, but all values unequal to "special magic number" could leave
signal will restart the system call.
It's easier for s390-kernel, but from UML's point of view, the magic number
But we really have to be very careful not to break either strace or gdb if
we do this change. Probably it is much easier to introduce PTRACE_SET/GET_TRAP.