diff --git a/src/flag.rs b/src/flag.rs index 942482e..4566765 100644 --- a/src/flag.rs +++ b/src/flag.rs @@ -184,19 +184,37 @@ impl PartialAllocStrategy { bitflags! { pub struct PtraceFlags: u64 { + /// Stop before a syscall is handled. Send PTRACE_FLAG_IGNORE to not + /// handle the syscall. const PTRACE_STOP_PRE_SYSCALL = 0x0000_0000_0000_0001; + /// Stop after a syscall is handled. const PTRACE_STOP_POST_SYSCALL = 0x0000_0000_0000_0002; + /// Stop after exactly one instruction. TODO: This may not handle + /// fexec/signal boundaries. Should it? const PTRACE_STOP_SINGLESTEP = 0x0000_0000_0000_0004; + /// Stop before a signal is handled. Send PTRACE_FLAG_IGNORE to not + /// handle signal. const PTRACE_STOP_SIGNAL = 0x0000_0000_0000_0008; + /// Stop on a software breakpoint, such as the int3 instruction for + /// x86_64. const PTRACE_STOP_BREAKPOINT = 0x0000_0000_0000_0010; + /// Stop just before exiting for good. const PTRACE_STOP_EXIT = 0x0000_0000_0000_0020; - const PTRACE_STOP_EXEC = 0x0000_0000_0000_0040; + const PTRACE_STOP_MASK = 0x0000_0000_0000_00FF; + + /// Sent when a child is cloned, giving you the opportunity to trace it. + /// If you don't catch this, the child is started as normal. const PTRACE_EVENT_CLONE = 0x0000_0000_0000_0100; + const PTRACE_EVENT_MASK = 0x0000_0000_0000_0F00; + + /// Special meaning, depending on the event. Usually, when fired before + /// an action, it will skip performing that action. const PTRACE_FLAG_IGNORE = 0x0000_0000_0000_1000; + const PTRACE_FLAG_MASK = 0x0000_0000_0000_F000; } }