Combined mmap() arguments for the old variant of mmap() on 32-bit ABIs like I386.
More...
#include <mmap.hxx>
|
| bool | valid () const |
| |
| ForeignPtr | addr () const |
| |
| size_t | length () const |
| |
| size_t | offset () const |
| |
| cosmos::mem::MapType | type () const |
| |
| cosmos::mem::MapFlags | flags () const |
| |
| cosmos::mem::AccessFlags | prot () const |
| |
| cosmos::FileNum | fd () const |
| |
| | PointerInValue (const std::string_view short_name, const std::string_view long_name={}) |
| |
| | PointerValue (const ItemType type, const std::string_view short_name, const std::string_view long_name) |
| |
| | SystemCallItem (const ItemType type, const std::string_view short_name={}, const std::string_view long_name={}) |
| | Constructs a new SystemCallItem.
|
| |
| auto | type () const |
| |
| bool | isIn () const |
| |
| bool | isOut () const |
| |
| bool | isInOut () const |
| |
| bool | isReturnValue () const |
| |
| void | fill (const Tracee &proc, const Word word) |
| | Fills the item from the given register data.
|
| |
| bool | needsUpdate () const |
| | Returns whether the item needs to be updated after the system call is finished.
|
| |
| std::string_view | shortName () const |
| | Returns the friendly short name for this item.
|
| |
| std::string_view | longName () const |
| | Returns the friendly long name for this item, if available, else the short name.
|
| |
| auto | hasLongName () const |
| |
| bool | isZero () const |
| | Returns whether the parameter is set to 0 / NULL.
|
| |
| Word | value () const |
| | Returns the currently stored raw value of the item.
|
| |
| template<typename OTHER> |
| OTHER | valueAs () const |
| | Helper to cast the strongly typed Word m_val to other strong enum types.
|
| |
| ForeignPtr | asPtr () const |
| |
| Flags | flags () const |
| |
| bool | deferFill () const |
| |
|
| void | processValue (const Tracee &) override |
| | Processes the value stored in m_val acc. to the actual item type.
|
| |
| std::string | str () const override |
| | Returns a human readable string representation of the item.
|
| |
| virtual void | updateData (const Tracee &t) |
| | Called upon exit of the system call to update possible out parameters.
|
| |
| void | setSystemCall (const SystemCall &sc) |
| | Sets the system call context this item is a part of.
|
| |
Combined mmap() arguments for the old variant of mmap() on 32-bit ABIs like I386.
Definition at line 75 of file mmap.hxx.
◆ OldMmapArgs()
| clues::item::OldMmapArgs::OldMmapArgs |
( |
| ) |
|
|
inlineexplicit |
Definition at line 79 of file mmap.hxx.
79 :
80 PointerInValue{"args"} {
81 }
◆ addr()
| ForeignPtr clues::item::OldMmapArgs::addr |
( |
| ) |
const |
|
inline |
Definition at line 87 of file mmap.hxx.
87 {
88 return m_addr;
89 }
◆ fd()
| cosmos::FileNum clues::item::OldMmapArgs::fd |
( |
| ) |
const |
|
inline |
Definition at line 111 of file mmap.hxx.
111 {
112 return m_fd;
113 }
◆ flags()
| cosmos::mem::MapFlags clues::item::OldMmapArgs::flags |
( |
| ) |
const |
|
inline |
Definition at line 103 of file mmap.hxx.
103 {
104 return m_flags;
105 }
◆ length()
| size_t clues::item::OldMmapArgs::length |
( |
| ) |
const |
|
inline |
Definition at line 91 of file mmap.hxx.
91 {
92 return m_length;
93 }
◆ offset()
| size_t clues::item::OldMmapArgs::offset |
( |
| ) |
const |
|
inline |
Definition at line 95 of file mmap.hxx.
95 {
96 return m_offset;
97 }
◆ processValue()
| void clues::item::OldMmapArgs::processValue |
( |
const Tracee & | | ) |
|
|
overrideprotectedvirtual |
Processes the value stored in m_val acc. to the actual item type.
This function is called for all parameter types upon entry to a system call, and for ItemType::RETVAL upon exit from a system call.
For parameters of ItemType::PARAM_OUT this callback can be used to reset any stored data to be filled in later when updateData() is called.
Reimplemented from clues::SystemCallItem.
Definition at line 73 of file mmap.cxx.
73 {
74 struct mmap_arg_struct args;
75
76 if (!proc.readStruct(asPtr(), args)) {
77 m_valid = false;
78 return;
79 }
80
81 m_addr =
ForeignPtr{
static_cast<uintptr_t
>(args.addr)};
82 m_length = args.len;
83 m_offset = args.offset;
84 m_prot = cosmos::mem::AccessFlags{static_cast<int>(args.prot)};
85 m_fd = cosmos::FileNum{static_cast<int>(args.fd)};
86 const auto raw_flags = static_cast<int>(args.flags);
87 m_flags = cosmos::mem::MapFlags{raw_flags & ~0x3};
88 m_type = cosmos::mem::MapType{raw_flags & 0x3};
89
90 m_valid = true;
91}
ForeignPtr
Strongly typed opaque pointer to tracee memory.
◆ prot()
| cosmos::mem::AccessFlags clues::item::OldMmapArgs::prot |
( |
| ) |
const |
|
inline |
Definition at line 107 of file mmap.hxx.
107 {
108 return m_prot;
109 }
◆ str()
| std::string clues::item::OldMmapArgs::str |
( |
| ) |
const |
|
overrideprotectedvirtual |
Returns a human readable string representation of the item.
This member function should be specialized in derived classes to output the item's data in a fashion suitable for the concrete item type.
Reimplemented from clues::SystemCallItem.
Definition at line 93 of file mmap.cxx.
93 {
94 auto &mmap_call = dynamic_cast<const MmapSystemCall&>(*m_call);
95
96 std::stringstream ss;
97 ss << "{hint=" << mmap_call.hint.str()
98 << ", length=" << mmap_call.length.str()
99 << ", prot=" << mmap_call.protection.str()
100 << ", flags=" << mmap_call.flags.str()
101 << ", fd=" << mmap_call.fd.str()
102 << ", offset=" << mmap_call.offset.str()
103 << "}";
104
105 return ss.str();
106}
◆ type()
| cosmos::mem::MapType clues::item::OldMmapArgs::type |
( |
| ) |
const |
|
inline |
Definition at line 99 of file mmap.hxx.
99 {
100 return m_type;
101 }
◆ valid()
| bool clues::item::OldMmapArgs::valid |
( |
| ) |
const |
|
inline |
Definition at line 83 of file mmap.hxx.
83 {
84 return m_valid;
85 }
◆ m_addr
| ForeignPtr clues::item::OldMmapArgs::m_addr = ForeignPtr::NO_POINTER |
|
protected |
◆ m_fd
| cosmos::FileNum clues::item::OldMmapArgs::m_fd |
|
protected |
◆ m_flags
| cosmos::mem::MapFlags clues::item::OldMmapArgs::m_flags |
|
protected |
◆ m_length
| size_t clues::item::OldMmapArgs::m_length = 0 |
|
protected |
◆ m_offset
| size_t clues::item::OldMmapArgs::m_offset = 0 |
|
protected |
◆ m_prot
| cosmos::mem::AccessFlags clues::item::OldMmapArgs::m_prot |
|
protected |
◆ m_type
| cosmos::mem::MapType clues::item::OldMmapArgs::m_type {0} |
|
protected |
◆ m_valid
| bool clues::item::OldMmapArgs::m_valid = false |
|
protected |
The documentation for this class was generated from the following files: