libclues
Linux C++ Tracing Library
Loading...
Searching...
No Matches
i386.hxx
1#pragma once
2
3// clues
4#include <clues/regs/RegisterData.hxx>
5#include <clues/sysnrs/i386.hxx>
6
7namespace clues {
8
10
15 public RegisterData<uint32_t, 6> {
16public: // constants
17
18 static constexpr auto NUM_REGS = 17;
19
20public: // functions
21
22 SystemCallNrI386 syscallNr() const {
23 return SystemCallNrI386{orig_eax};
24 }
25
26 auto syscallRes() const {
27 return eax;
28 }
29
30 SystemCallPars syscallPars() const {
31 return SystemCallPars{
32 ebx, ecx, edx, esi, edi, ebp
33 };
34 }
35
36 void clear() {
37 cosmos::zero_object(*this);
38 }
39
41 static auto registerNames() {
42 return std::array<const char*, NUM_REGS>({
43 "ebx", "ecx", "edx", "esi", "edi", "ebp", "eax",
44 "xds", "xes", "xfs", "xgs", "orig_eax", "eip", "xcs",
45 "eflags", "esp", "xss"
46 });
47 }
48
50 auto array() const {
51 return std::array<register_t, NUM_REGS>({
52 ebx, ecx, edx, esi, edi, ebp, eax, xds,
53 xes, xfs, xgs, orig_eax, eip, xcs, eflags,
54 esp, xss
55 });
56 }
57
58public: // data
59
60 register_t ebx;
61 register_t ecx;
62 register_t edx;
63 register_t esi;
64 register_t edi;
65 register_t ebp;
66 register_t eax;
67 register_t xds;
68 register_t xes;
69 register_t xfs;
70 register_t xgs;
71 register_t orig_eax;
72 register_t eip;
73 register_t xcs;
74 register_t eflags;
75 register_t esp;
76 register_t xss;
77};
78
79} // end ns
SystemCallNrI386
Native system call numbers as used by Linux on the i386 ABI.
Definition i386.hxx:32
Native register data for the I386 32-bit X86 ABI.
Definition i386.hxx:15
auto array() const
Returns a std::array offering index-based access to registers.
Definition i386.hxx:50
static auto registerNames()
Returns the human-readable names for the registers in the order found in array()
Definition i386.hxx:41
Base class for ABI specific register data.
std::array< register_t, NUM_SYSCALL_PARS > SystemCallPars