libclues
Linux C++ Tracing Library
Loading...
Searching...
No Matches
clues::item::IntValueT< INT > Class Template Reference

A simple scalar in/out/return value parameter. More...

#include <items.hxx>

+ Inheritance diagram for clues::item::IntValueT< INT >:

Public Member Functions

 IntValueT (const std::string_view short_name, const std::string_view long_name={}, const ItemType type=ItemType::PARAM_IN)
 
INT value () const
 
std::string str () const override
 Returns a human readable string representation of the item.
 
void setBase (const Base base)
 
- Public Member Functions inherited from clues::item::ValueParameter
 ValueParameter (const ItemType type, const std::string_view short_name, const std::string_view long_name={})
 
- Public Member Functions inherited from clues::SystemCallItem
 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
 

Protected Member Functions

void processValue (const Tracee &) override
 Processes the value stored in m_val acc. to the actual item type.
 
- Protected Member Functions inherited from clues::SystemCallItem
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.
 

Protected Attributes

INT m_value = 0
 
Base m_base = Base::DEC
 
- Protected Attributes inherited from clues::SystemCallItem
const SystemCallm_call = nullptr
 The system call context this item part of.
 
const ItemType m_type
 The type of item.
 
std::string_view m_short_name
 A human readable short name for the item, should be one word only.
 
std::string_view m_long_name
 A human readable longer name for the item.
 
Word m_val
 The raw register value for the item.
 
Flags m_flags
 Flags influencing the processing of the item.
 

Additional Inherited Members

- Public Types inherited from clues::SystemCallItem
enum class  Flag { DEFER_FILL = 1 << 0 }
 
using Flags = cosmos::BitMask<Flag>
 

Detailed Description

template<typename INT>
class clues::item::IntValueT< INT >

A simple scalar in/out/return value parameter.

Definition at line 264 of file items.hxx.

Constructor & Destructor Documentation

◆ IntValueT()

template<typename INT>
clues::item::IntValueT< INT >::IntValueT ( const std::string_view short_name,
const std::string_view long_name = {},
const ItemType type = ItemType::PARAM_IN )
inlineexplicit

Definition at line 268 of file items.hxx.

270 {},
271 const ItemType type = ItemType::PARAM_IN) :
272 ValueParameter{type, short_name, long_name} {
273 }
A simple scalar in/out/return value parameter.
Definition items.hxx:265

Member Function Documentation

◆ processValue()

template<typename INT>
void clues::item::IntValueT< INT >::processValue ( const Tracee & )
inlineoverrideprotectedvirtual

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 287 of file items.hxx.

287 {
288 m_value = valueAs<INT>();
289 }
OTHER valueAs() const
Helper to cast the strongly typed Word m_val to other strong enum types.

◆ setBase()

template<typename INT>
void clues::item::IntValueT< INT >::setBase ( const Base base)
inline

Definition at line 281 of file items.hxx.

281 {
282 m_base = base;
283 }

◆ str()

template<typename INT>
std::string clues::item::IntValueT< INT >::str ( ) const
overridevirtual

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 45 of file items.cxx.

45 {
46 return format_number(m_value, m_base);
47}

◆ value()

template<typename INT>
INT clues::item::IntValueT< INT >::value ( ) const
inline

Definition at line 275 of file items.hxx.

275 {
276 return m_value;
277 }

Member Data Documentation

◆ m_base

template<typename INT>
Base clues::item::IntValueT< INT >::m_base = Base::DEC
protected

Definition at line 294 of file items.hxx.

◆ m_value

template<typename INT>
INT clues::item::IntValueT< INT >::m_value = 0
protected

Definition at line 293 of file items.hxx.


The documentation for this class was generated from the following files: