2#include <cosmos/error/ApiError.hxx>
3#include <cosmos/io/ILogger.hxx>
4#include <cosmos/proc/process.hxx>
7#include <clues/ForeignTracee.hxx>
8#include <clues/logger.hxx>
14 Tracee{engine, consumer, sibling} {
45ForeignTracee::~ForeignTracee() {
48 }
catch (
const cosmos::CosmosError &ce) {
49 LOG_DEBUG(
"Couldn't detach from PID " << cosmos::to_integral(
m_ptrace.pid()) <<
":\n\n" << ce.what());
Callback interface for consumers of tracing events.
void configure(const cosmos::ProcessID tracee)
Sets the given process ID as the process to be traced.
ForeignTracee(Engine &engine, EventConsumer &consumer, TraceePtr sibling=nullptr)
Create a traced process object by attaching to the given process ID.
void setPID(const cosmos::ProcessID tracee)
Sets the tracee PID.
bool detach()
Attempt to detach the Tracee.
Tracee(Engine &engine, EventConsumer &consumer, TraceePtr sibling=nullptr)
cosmos::Tracee m_ptrace
libcosmos API for the Tracee.