Make it something like: static inline void set_stop_code(struct ptrace_context *ctx, int event) { ctx->stop_code = (event << 8) | SIGTRAP | (event >= PTRACE_EVENT_SYSCALL_ENTRY && (ctx->options & PTRACE_O_TRACESYSGOOD) ? 0x80 : 0); }
and pick PTRACE_EVENT_* numbers so SYSCALL_{ENTRY,EXIT} are highest, or something along those lines. Thanks, Roland