11#include <cosmos/compiler.hxx>
12#include <cosmos/error/errno.hxx>
13#include <cosmos/fs/types.hxx>
14#include <cosmos/proc/ptrace.hxx>
17#include <clues/fwd.hxx>
18#include <clues/sysnrs/fwd.hxx>
19#include <clues/types.hxx>
42std::vector<FDInfo>
get_fd_infos(
const cosmos::ProcessID pid);
46 const std::string_view name);
60 if (cosmos::arch::X32)
62 else if (cosmos::arch::X86_64)
64 else if (cosmos::arch::I386)
66 else if (cosmos::arch::AARCH64)
73constexpr inline size_t SUPPORTED_ABIS = 3;
74#elif defined(COSMOS_I386)
75constexpr inline size_t SUPPORTED_ABIS = 1;
76#elif defined(COSMOS_AARCH64)
77constexpr inline size_t SUPPORTED_ABIS = 1;
79#error "no configuration yet for this platform"
82CLUES_API
const char* get_abi_label(
const ABI abi);
107void CLUES_API
parse_proc_file(
const cosmos::ProcessID pid,
const std::string_view subpath, std::function<
bool(
const std::string&)> parser);
113void CLUES_API
parse_proc_file(
const Tracee &tracee,
const std::string_view subpath, std::function<
bool(
const std::string&)> parser);
KernelErrno
Errno values that can appear in tracing context.
const char * get_ptrace_event_str(const cosmos::ptrace::Event event)
Returns a string label for the given event.
constexpr ABI get_default_abi()
Returns the default ABI for this system.
@ X32
X86_64 with 32-bit pointers.
std::vector< FDInfo > get_fd_infos(const cosmos::ProcessID pid)
Obtain detailed information about currently open file descriptors according to /proc/<pid>/fd.
std::array< ABI, SUPPORTED_ABIS > get_supported_abis()
Returns a list of ABIs supported on the current platform.
std::optional< SystemCallNr > lookup_system_call(const std::string_view name)
Returns the SystemCallNr for the given system call name, if it exists.
const char * get_errno_label(const cosmos::Errno err)
Returns a short errno label like ENOENT for the given errno integer.
const char * get_kernel_errno_label(const KernelErrno err)
Returns a short errno label for extended KernelErrno codes.
bool is_supported_abi(const ABI abi)
Returns whether the given ABI is supported on the current platform.
std::set< cosmos::FileNum > get_currently_open_fds(const cosmos::ProcessID pid)
Returns the currently open file descriptors according to /proc/<pid>/fd.
void parse_proc_file(const cosmos::ProcessID pid, const std::string_view subpath, std::function< bool(const std::string &)> parser)
Parse a proc file of the given process using the given functor.
bool is_default_abi(const ABI abi)
Returns whether the given ABI is default ABI for this system.