4#include <cosmos/BitMask.hxx>
5#include <cosmos/proc/process.hxx>
6#include <cosmos/string.hxx>
9#include <clues/types.hxx>
51 using StatusFlags = cosmos::BitMask<StatusFlag>;
144 virtual void signaled(Tracee &tracee,
const cosmos::SigInfo &info) {
172 virtual void exited(Tracee &tracee,
const cosmos::WaitStatus status,
const StatusFlags flags) {
196 virtual void disappeared(Tracee &tracee,
const cosmos::ChildState &data) {
232 const std::string &old_executable,
233 const cosmos::StringVector &old_cmdline,
234 const std::optional<cosmos::ProcessID> old_pid) {
237 (void)old_executable;
263 const cosmos::ptrace::Event event,
264 const StatusFlags flags) {
Callback interface for consumers of tracing events.
virtual void newExecutionContext(Tracee &tracee, const std::string &old_executable, const cosmos::StringVector &old_cmdline, const std::optional< cosmos::ProcessID > old_pid)
A new program is executed in the tracee.
virtual void syscallExit(Tracee &tracee, const SystemCall &sc, const StatusFlags flags)
A system call has been finished.
virtual void newChildProcess(Tracee &parent, Tracee &child, const cosmos::ptrace::Event event, const StatusFlags flags)
A new child process has been created.
virtual void signaled(Tracee &tracee, const cosmos::SigInfo &info)
The tracee has received a signal.
virtual void attached(Tracee &tracee)
The tracee is now properly attached to.
virtual void stopped(Tracee &tracee)
The tracee entered group-stop due to a stopping signal.
virtual void vforkComplete(Tracee &parent, TraceePtr child)
A vfork() in parent for child completed.
virtual void resumed(Tracee &tracee)
The tracee resumed due to SIGCONT.
virtual void exited(Tracee &tracee, const cosmos::WaitStatus status, const StatusFlags flags)
The tracee is about to end execution.
virtual void syscallEntry(Tracee &tracee, const SystemCall &sc, const StatusFlags flags)
A system call is about to be executed in the Tracee.
StatusFlag
Different status flags that can appear in callbacks.
@ ABI_CHANGED
The system call ABI changed since the last observed system call.
@ INTERRUPTED
A system call was interrupted (only appears during syscallExit()).
@ LOST_TO_MT_EXIT
An exit occurs because another thread called execve() or exit() (only appears in exited()).
@ RESUMED
A previously interrupted system call is resumed (only appears during syscallEntry()).
@ CLONED_THREAD
used in newChildProcess() to indicate that a new thread has been created.
virtual void disappeared(Tracee &tracee, const cosmos::ChildState &data)
The tracee disappeared for unclear reasons.
Access to System Call Data.
Base class for traced processes.