-
Notifications
You must be signed in to change notification settings - Fork 716
Description
The ptrace(2) docs say:
PTRACE_EVENT stops are observed by the tracer as waitpid(2) returning
with WIFSTOPPED(status), and WSTOPSIG(status) returns SIGTRAP. An
additional bit is set in the higher byte of the status word: the
value status>>8 will be
(SIGTRAP | PTRACE_EVENT_foo << 8).
Currently waitpid decodes the signal with status::stop_signal, but loses this info. Maybe WaitStatus::Stopped could have an extra Option<PtraceEvent> field, where PtraceEvent could be an enum for the PTRACE_EVENT_* values?
I did some cursory investigation on how ptrace works on non-Linux platforms and couldn't find any equivalent usage here, so I guess this wouldn't be relevant elsewhere. I don't know what the convention is for situations like this--would we just have a unit PtraceEvent struct there?