5#include <cosmos/formatting.hxx>
8#include <clues/format.hxx>
9#include <clues/items/time.hxx>
10#include <clues/macros.h>
11#include <clues/private/kernel/time.hxx>
12#include <clues/sysnrs/generic.hxx>
13#include <clues/Tracee.hxx>
14#include <clues/utils.hxx>
16namespace clues::item {
19 if (m_remain_semantics) {
30 if (
m_call->hasResultValue())
33 const auto error = *
m_call->error();
35 if (!error.hasErrorCode() || error.errorCode() != cosmos::Errno::INTERRUPTED) {
48 if (!
m_call->is32BitEmulationABI()) {
53 return cosmos::in_list(
m_call->callNr(), {
54 SystemCallNr::CLOCK_NANOSLEEP,
56 SystemCallNr::NANOSLEEP
60void TimeSpecParameter::fetch(
const Tracee &proc) {
62 m_timespec = timespec{};
66 struct timespec32 ts32;
72 m_timespec->tv_sec = ts32.tv_sec;
73 m_timespec->tv_nsec = ts32.tv_nsec;
74 }
else if (!proc.
readStruct(asPtr(), *m_timespec)) {
81 if (m_remain_semantics) {
83 return format::pointer(asPtr());
89 return format::timespec(*m_timespec);
94 CASE_ENUM_TO_STR(CLOCK_REALTIME);
95 CASE_ENUM_TO_STR(CLOCK_REALTIME_COARSE);
96 CASE_ENUM_TO_STR(CLOCK_TAI);
97 CASE_ENUM_TO_STR(CLOCK_MONOTONIC);
98 CASE_ENUM_TO_STR(CLOCK_MONOTONIC_RAW);
99 CASE_ENUM_TO_STR(CLOCK_MONOTONIC_COARSE);
100 CASE_ENUM_TO_STR(CLOCK_BOOTTIME);
101 CASE_ENUM_TO_STR(CLOCK_PROCESS_CPUTIME_ID);
102 CASE_ENUM_TO_STR(CLOCK_THREAD_CPUTIME_ID);
109 CASE_ENUM_TO_STR(TIMER_ABSTIME);
110 case 0:
return "<relative-time>";
const SystemCall * m_call
The system call context this item part of.
OTHER valueAs() const
Helper to cast the strongly typed Word m_val to other strong enum types.
Base class for traced processes.
bool readStruct(const ForeignPtr addr, T &out) const
Reads a system call struct from the tracee's address space into out.
std::string str() const override
Returns a human readable string representation of the item.
std::string str() const override
Returns a human readable string representation of the item.
void updateData(const Tracee &proc) override
Called upon exit of the system call to update possible out parameters.
bool needTime32Conversion() const
Checks whether the current ABI context requires conversion of 32 bit to 64 bit.
std::string str() const override
Returns a human readable string representation of the item.