|
libclues
Linux C++ Tracing Library
|
Type for mmap() / mmap2() system calls. More...
#include <memory.hxx>
Inheritance diagram for clues::MmapSystemCall:Public Member Functions | |
| MmapSystemCall (const SystemCallNr nr) | |
| bool | isOldMmap () const |
Public Member Functions inherited from clues::SystemCall | |
| SystemCall (const SystemCallNr nr) | |
| Instantiates a new SystemCall object with given properties. | |
| SystemCall (const SystemCall &other)=delete | |
| SystemCall & | operator= (const SystemCall &other)=delete |
| void | setEntryInfo (const Tracee &proc, const SystemCallInfo &info) |
| Update the stored parameter values from the given tracee. | |
| void | setExitInfo (const Tracee &proc, const SystemCallInfo &info) |
| Update possible out and return parameter values from the given tracee. | |
| std::string_view | name () const |
| Returns the system call's human readable name. | |
| size_t | numPars () const |
| Returns the number of parameters for this system call. | |
| SystemCallNr | callNr () const |
| Returns the system call table number for this system call. | |
| const ParameterVector & | parameters () const |
| Access to the parameters associated with this system call. | |
| SystemCallItemPtr | result () const |
| Access to the return value parameter associated with this system call. | |
| std::optional< ErrnoResult > | error () const |
| Access to the errno result seen for this system call. | |
| bool | hasOutParameter () const |
| bool | hasResultValue () const |
| bool | hasErrorCode () const |
| ABI | abi () const |
| Returns the system call ABi seen during system call entry. | |
| bool | is32BitEmulationABI () const |
| const SystemCallInfo * | currentInfo () const |
| Access the current SystemCallInfo if currently processing syscall entry/exit. | |
Protected Member Functions | |
| void | prepareNewSystemCall () override |
| Perform any necessary actions before processing a new system call entry event. | |
| bool | implementsOldMmap () const |
| bool | check2ndPass (const Tracee &) override |
| Check whether a second pass needs to be made processing parameters. | |
Protected Member Functions inherited from clues::SystemCall | |
| void | fillParameters (const Tracee &proc, const SystemCallInfo &info) |
| void | setReturnItem (SystemCallItem &ret) |
| Sets the return value system call item. | |
| void | addParameters () |
| template<typename T, typename... Targs> | |
| void | addParameters (T &par, Targs &...rest) |
| template<typename... Targs> | |
| void | setParameters (Targs &...args) |
| virtual void | updateFDTracking (const Tracee &proc) |
| Update file descriptor tracking. | |
| void | dropFD (const Tracee &proc, const cosmos::FileNum num) |
| void | trackFD (const Tracee &proc, FDInfo &&info) |
Additional Inherited Members | |
Public Types inherited from clues::SystemCall | |
| using | ParameterVector = std::vector<SystemCallItemPtr> |
| Vector of the parameters required for a system call. | |
Static Public Member Functions inherited from clues::SystemCall | |
| static const char * | name (const SystemCallNr nr) |
| Returns the name of the given system call or "<unknown>" if unknown. | |
| static bool | validNr (const SystemCallNr nr) |
| Returns whether the given system call number is in a valid range. | |
Protected Attributes inherited from clues::SystemCall | |
| SystemCallNr | m_nr |
| The raw system call number of the system call. | |
| const std::string_view | m_name |
| The basic name of the system call. | |
| const SystemCallInfo * | m_info = nullptr |
| Current system call info during entry/exit processing, nullptr otherwise. | |
| SystemCallItemPtr | m_return |
| The return value of the system call. | |
| std::optional< ErrnoResult > | m_error |
| If the system call fails, this is the error code. | |
| ParameterVector | m_pars |
| The array of system call parameters, if any. | |
| ABI | m_abi = ABI::UNKNOWN |
| The current system call ABI which is in effect. | |
Type for mmap() / mmap2() system calls.
SYS_mmap and SYS_mmap2 are unfortunate with regards to tracing. SYS_mmap can refer to two different variants of mmap() depending on ABI.
The well-known modern mmap() call taking six parameters is found in SYS_mmap on modern systems and in SYS_mmap2 on older ABIs.
SYS_mmap on older ABIs like I386 takes a single struct mmap_args parameter. Thus when SYS_mmap occurs during tracing, in an abstract application not considering the ABI, it can be either the modern mmap() or the legacy mmap(). To ease handling these differences, this type covers both SYS_mmap and SYS_mmap2 on all ABIs. Even on older ABIs the six members corresponding to the modern mmap() system call will be filled. This way applications can process both types of mmap system calls in a unified way.
For completeness, in case of the legacy SYS_mmap() the isOldMmap() member function will return true and the original data structure passed to the kernel is available in old_args.
Definition at line 48 of file memory.hxx.
|
inlineexplicit |
Definition at line 53 of file memory.hxx.
|
overrideprotectedvirtual |
Check whether a second pass needs to be made processing parameters.
This function can be overridden by the actual system call implementation to perform context-sensitive evaluation of system call parameters (e.g. for ioctl() style system calls) upon system call entry.
The implementation of this function is allowed to modify the amount and types of system call parameters and return parameter. In this case true must be returned to let the base class implementation reevaluate all system call parameters.
Reimplemented from clues::SystemCall.
Definition at line 26 of file memory.cxx.
|
protected |
Definition at line 6 of file memory.cxx.
|
inline |
Definition at line 62 of file memory.hxx.
|
overrideprotectedvirtual |
Perform any necessary actions before processing a new system call entry event.
Reimplemented from clues::SystemCall.
Definition at line 13 of file memory.cxx.
| item::GenericPointerValue clues::MmapSystemCall::addr |
Definition at line 88 of file memory.hxx.
| item::FileDescriptor clues::MmapSystemCall::fd |
Definition at line 81 of file memory.hxx.
| item::MapFlagsParameter clues::MmapSystemCall::flags |
Definition at line 80 of file memory.hxx.
| item::GenericPointerValue clues::MmapSystemCall::hint |
Definition at line 77 of file memory.hxx.
| item::SizeValue clues::MmapSystemCall::length |
Definition at line 78 of file memory.hxx.
| item::OffsetValue clues::MmapSystemCall::offset |
Definition at line 82 of file memory.hxx.
| std::optional<item::OldMmapArgs> clues::MmapSystemCall::old_args |
Definition at line 85 of file memory.hxx.
| item::MemoryProtectionParameter clues::MmapSystemCall::protection |
Definition at line 79 of file memory.hxx.