libclues
Linux C++ Tracing Library
Loading...
Searching...
No Matches
clues::RegisterData< REGISTER_T, _NUM_SYSCALL_PARS > Struct Template Reference

Base class for ABI specific register data. More...

#include <RegisterData.hxx>

Public Types

using register_t = REGISTER_T
 
using SystemCallPars = std::array<register_t, NUM_SYSCALL_PARS>
 This type is used to return the values of all system call parameter values in order of occurrence.
 

Static Public Attributes

static constexpr auto NUM_SYSCALL_PARS = _NUM_SYSCALL_PARS
 

Detailed Description

template<typename REGISTER_T, size_t _NUM_SYSCALL_PARS>
struct clues::RegisterData< REGISTER_T, _NUM_SYSCALL_PARS >

Base class for ABI specific register data.

This family of data structures relates to the PTRACE_GETREGSET operation. Specializations of this type exist for each supported ABI.

Regarding the different system call ABIs man(2) syscall is helpful.

The exact data structures returned from the kernel are not well documented and can be looked up in the kernel headers. We are duplicating these data structures in these classes, since we need to be able to support multiple ABIs in the same binary (e.g. I386 emulation on X86_64), and the compilation environment provides us with no way to obtain the definitions for ABIs/architectures other than our own.

REGISTER_T relates to the primitive type stored in a register. NUM_SYSCALL_PARS defines the maximum number of system call parameters that can be passed on the target ABI.

By contract each derived type needs to implement a set of functions like:

  • syscallNr(): returns the ABI specific system call number.
  • syscallRes(): returns the content of the system call return value register.
  • syscallPars(): returns a std::array containing the contents of the system call parameter registers, in order of use.
  • clear(): zeroes all register content.

Definition at line 40 of file RegisterData.hxx.

Member Typedef Documentation

◆ register_t

template<typename REGISTER_T, size_t _NUM_SYSCALL_PARS>
using clues::RegisterData< REGISTER_T, _NUM_SYSCALL_PARS >::register_t = REGISTER_T

Definition at line 47 of file RegisterData.hxx.

◆ SystemCallPars

template<typename REGISTER_T, size_t _NUM_SYSCALL_PARS>
using clues::RegisterData< REGISTER_T, _NUM_SYSCALL_PARS >::SystemCallPars = std::array<register_t, NUM_SYSCALL_PARS>

This type is used to return the values of all system call parameter values in order of occurrence.

Definition at line 49 of file RegisterData.hxx.

Member Data Documentation

◆ NUM_SYSCALL_PARS

template<typename REGISTER_T, size_t _NUM_SYSCALL_PARS>
auto clues::RegisterData< REGISTER_T, _NUM_SYSCALL_PARS >::NUM_SYSCALL_PARS = _NUM_SYSCALL_PARS
staticconstexpr

Definition at line 43 of file RegisterData.hxx.


The documentation for this struct was generated from the following file: