libclues
Linux C++ Tracing Library
Loading...
Searching...
No Matches
format.hxx
1#pragma once
2
3// C++
4#include <cstdint>
5
6// cosmos
7#include <cosmos/io/types.hxx>
8#include <cosmos/proc/SigInfo.hxx>
9#include <cosmos/proc/SigSet.hxx>
10#include <cosmos/proc/types.hxx>
11#include <cosmos/fwd.hxx>
12
13// clues
14#include <clues/dso_export.h>
15#include <clues/fwd.hxx>
16
17struct timespec;
18
19namespace cosmos {
20 class SigInfo;
21}
22
23namespace clues {
24 enum class ForeignPtr : uintptr_t;
25}
26
27namespace clues::format {
28
30
34CLUES_API std::string signal(const cosmos::SignalNr signal, const bool verbose=true);
35
37CLUES_API std::string signal_set(const cosmos::SigSet &set);
38
40CLUES_API std::string saflags(const int flags);
41
43CLUES_API std::string limit(const uint64_t lim);
44
46CLUES_API std::string si_code(const cosmos::SigInfo::Source src);
47
49CLUES_API std::string si_reason(const cosmos::SigInfo::SysData::Reason reason);
50
52CLUES_API std::string si_reason(const cosmos::SigInfo::PollData::Reason reason);
53
55CLUES_API std::string si_reason(const cosmos::SigInfo::IllData::Reason reason);
56
58CLUES_API std::string si_reason(const cosmos::SigInfo::FPEData::Reason reason);
59
61CLUES_API std::string si_reason(const cosmos::SigInfo::SegfaultData::Reason reason);
62
64CLUES_API std::string si_reason(const cosmos::SigInfo::BusData::Reason reason);
65
67CLUES_API std::string ptrace_arch(const cosmos::ptrace::Arch arch);
68
70CLUES_API std::string child_event(const cosmos::SigInfo::ChildData::Event event);
71
73CLUES_API std::string poll_event(const cosmos::PollEvent event);
74
76CLUES_API std::string poll_events(const cosmos::PollEvents events);
77
79CLUES_API std::string sig_info(const cosmos::SigInfo &info);
80
82CLUES_API std::string_view file_type(const cosmos::FileType type);
83
85CLUES_API std::string file_mode_numeric(const cosmos::FileModeBits mode);
86
88CLUES_API std::string file_mode_symbolic(const cosmos::FileModeBits mode);
89
91CLUES_API std::string device_id(const cosmos::DeviceID id);
92
94CLUES_API std::string timespec(const struct timespec &ts, const bool only_secs = false);
95
97CLUES_API std::string timeval(const struct timeval &tv, const bool only_secs = false);
98
100CLUES_API std::string buffer(const uint8_t *buffer, const size_t len);
101
103CLUES_API std::string control_char(const char ch);
104
106CLUES_API std::string pointer(const ForeignPtr ptr);
107
109CLUES_API std::string pointer(const ForeignPtr ptr, const std::string_view data);
110
112CLUES_API std::string_view fd_type(const FDInfo &info);
113
115CLUES_API std::string fd_info(const FDInfo &info);
116
118std::string event(const cosmos::ChildState &state);
119
120} // end ns
ForeignPtr
Strongly typed opaque pointer to tracee memory.
Definition types.hxx:140