LLDB  mainline
Public Types | Public Member Functions | Static Public Member Functions | Protected Attributes | List of all members
lldb_private::RegisterValue Class Reference

#include <RegisterValue.h>

Collaboration diagram for lldb_private::RegisterValue:
Collaboration graph
[legend]

Public Types

enum  { kMaxRegisterByteSize = 64u }
 
enum  Type {
  eTypeInvalid, eTypeUInt8, eTypeUInt16, eTypeUInt32,
  eTypeUInt64, eTypeUInt128, eTypeFloat, eTypeDouble,
  eTypeLongDouble, eTypeBytes
}
 

Public Member Functions

 RegisterValue ()
 
 RegisterValue (uint8_t inst)
 
 RegisterValue (uint16_t inst)
 
 RegisterValue (uint32_t inst)
 
 RegisterValue (uint64_t inst)
 
 RegisterValue (llvm::APInt inst)
 
 RegisterValue (float value)
 
 RegisterValue (double value)
 
 RegisterValue (long double value)
 
 RegisterValue (uint8_t *bytes, size_t length, lldb::ByteOrder byte_order)
 
RegisterValue::Type GetType () const
 
bool CopyValue (const RegisterValue &rhs)
 
void SetType (RegisterValue::Type type)
 
RegisterValue::Type SetType (const RegisterInfo *reg_info)
 
bool GetData (DataExtractor &data) const
 
uint32_t GetAsMemoryData (const RegisterInfo *reg_info, void *dst, uint32_t dst_len, lldb::ByteOrder dst_byte_order, Status &error) const
 
uint32_t SetFromMemoryData (const RegisterInfo *reg_info, const void *src, uint32_t src_len, lldb::ByteOrder src_byte_order, Status &error)
 
bool GetScalarValue (Scalar &scalar) const
 
uint8_t GetAsUInt8 (uint8_t fail_value=UINT8_MAX, bool *success_ptr=nullptr) const
 
uint16_t GetAsUInt16 (uint16_t fail_value=UINT16_MAX, bool *success_ptr=nullptr) const
 
uint32_t GetAsUInt32 (uint32_t fail_value=UINT32_MAX, bool *success_ptr=nullptr) const
 
uint64_t GetAsUInt64 (uint64_t fail_value=UINT64_MAX, bool *success_ptr=nullptr) const
 
llvm::APInt GetAsUInt128 (const llvm::APInt &fail_value, bool *success_ptr=nullptr) const
 
float GetAsFloat (float fail_value=0.0f, bool *success_ptr=nullptr) const
 
double GetAsDouble (double fail_value=0.0, bool *success_ptr=nullptr) const
 
long double GetAsLongDouble (long double fail_value=0.0, bool *success_ptr=nullptr) const
 
void SetValueToInvalid ()
 
bool ClearBit (uint32_t bit)
 
bool SetBit (uint32_t bit)
 
bool operator== (const RegisterValue &rhs) const
 
bool operator!= (const RegisterValue &rhs) const
 
void operator= (uint8_t uint)
 
void operator= (uint16_t uint)
 
void operator= (uint32_t uint)
 
void operator= (uint64_t uint)
 
void operator= (llvm::APInt uint)
 
void operator= (float f)
 
void operator= (double f)
 
void operator= (long double f)
 
void SetUInt8 (uint8_t uint)
 
void SetUInt16 (uint16_t uint)
 
void SetUInt32 (uint32_t uint, Type t=eTypeUInt32)
 
void SetUInt64 (uint64_t uint, Type t=eTypeUInt64)
 
void SetUInt128 (llvm::APInt uint)
 
bool SetUInt (uint64_t uint, uint32_t byte_size)
 
void SetFloat (float f)
 
void SetDouble (double f)
 
void SetLongDouble (long double f)
 
void SetBytes (const void *bytes, size_t length, lldb::ByteOrder byte_order)
 
bool SignExtend (uint32_t sign_bitpos)
 
Status SetValueFromString (const RegisterInfo *reg_info, llvm::StringRef value_str)
 
Status SetValueFromString (const RegisterInfo *reg_info, const char *value_str)=delete
 
Status SetValueFromData (const RegisterInfo *reg_info, DataExtractor &data, lldb::offset_t offset, bool partial_data_ok)
 
const void * GetBytes () const
 
lldb::ByteOrder GetByteOrder () const
 
uint32_t GetByteSize () const
 
void Clear ()
 

Static Public Member Functions

static uint32_t GetMaxByteSize ()
 

Protected Attributes

RegisterValue::Type m_type
 
Scalar m_scalar
 
struct {
   uint8_t   bytes [kMaxRegisterByteSize]
 
   uint8_t   length
 
   lldb::ByteOrder   byte_order
 
buffer
 

Detailed Description

Definition at line 27 of file RegisterValue.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kMaxRegisterByteSize 

Definition at line 29 of file RegisterValue.h.

◆ Type

Enumerator
eTypeInvalid 
eTypeUInt8 
eTypeUInt16 
eTypeUInt32 
eTypeUInt64 
eTypeUInt128 
eTypeFloat 
eTypeDouble 
eTypeLongDouble 
eTypeBytes 

Definition at line 31 of file RegisterValue.h.

Constructor & Destructor Documentation

◆ RegisterValue() [1/10]

lldb_private::RegisterValue::RegisterValue ( )
inline

Definition at line 44 of file RegisterValue.h.

◆ RegisterValue() [2/10]

lldb_private::RegisterValue::RegisterValue ( uint8_t  inst)
inlineexplicit

Definition at line 46 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [3/10]

lldb_private::RegisterValue::RegisterValue ( uint16_t  inst)
inlineexplicit

Definition at line 48 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [4/10]

lldb_private::RegisterValue::RegisterValue ( uint32_t  inst)
inlineexplicit

Definition at line 52 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [5/10]

lldb_private::RegisterValue::RegisterValue ( uint64_t  inst)
inlineexplicit

Definition at line 56 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [6/10]

lldb_private::RegisterValue::RegisterValue ( llvm::APInt  inst)
inlineexplicit

Definition at line 60 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [7/10]

lldb_private::RegisterValue::RegisterValue ( float  value)
inlineexplicit

Definition at line 64 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [8/10]

lldb_private::RegisterValue::RegisterValue ( double  value)
inlineexplicit

Definition at line 66 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [9/10]

lldb_private::RegisterValue::RegisterValue ( long double  value)
inlineexplicit

Definition at line 70 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [10/10]

lldb_private::RegisterValue::RegisterValue ( uint8_t *  bytes,
size_t  length,
lldb::ByteOrder  byte_order 
)
inlineexplicit

Definition at line 74 of file RegisterValue.h.

References SetBytes().

Member Function Documentation

◆ Clear()

void RegisterValue::Clear ( )

Definition at line 186 of file RegisterValue.cpp.

Referenced by GetMaxByteSize().

◆ ClearBit()

bool RegisterValue::ClearBit ( uint32_t  bit)

Definition at line 799 of file RegisterValue.cpp.

References lldb::eByteOrderBig, and lldb::eByteOrderLittle.

Referenced by SetValueToInvalid().

◆ CopyValue()

bool RegisterValue::CopyValue ( const RegisterValue rhs)

Definition at line 476 of file RegisterValue.cpp.

References buffer, byte_order, bytes, length, m_scalar, and m_type.

Referenced by GetType(), and SetType().

◆ GetAsDouble()

double RegisterValue::GetAsDouble ( double  fail_value = 0.0,
bool *  success_ptr = nullptr 
) const

Definition at line 649 of file RegisterValue.cpp.

Referenced by GetAsUInt8(), and ABISysV_arm::GetReturnValueObjectImpl().

◆ GetAsFloat()

float RegisterValue::GetAsFloat ( float  fail_value = 0.0f,
bool *  success_ptr = nullptr 
) const

Definition at line 630 of file RegisterValue.cpp.

Referenced by GetAsUInt8(), and ABISysV_arm::GetReturnValueObjectImpl().

◆ GetAsLongDouble()

long double RegisterValue::GetAsLongDouble ( long double  fail_value = 0.0,
bool *  success_ptr = nullptr 
) const

Definition at line 669 of file RegisterValue.cpp.

Referenced by GetAsUInt8().

◆ GetAsMemoryData()

uint32_t RegisterValue::GetAsMemoryData ( const RegisterInfo *  reg_info,
void *  dst,
uint32_t  dst_len,
lldb::ByteOrder  dst_byte_order,
Status error 
) const

◆ GetAsUInt128()

llvm::APInt RegisterValue::GetAsUInt128 ( const llvm::APInt &  fail_value,
bool *  success_ptr = nullptr 
) const

◆ GetAsUInt16()

uint16_t RegisterValue::GetAsUInt16 ( uint16_t  fail_value = UINT16_MAX,
bool *  success_ptr = nullptr 
) const

◆ GetAsUInt32()

uint32_t RegisterValue::GetAsUInt32 ( uint32_t  fail_value = UINT32_MAX,
bool *  success_ptr = nullptr 
) const

◆ GetAsUInt64()

uint64_t RegisterValue::GetAsUInt64 ( uint64_t  fail_value = UINT64_MAX,
bool *  success_ptr = nullptr 
) const

◆ GetAsUInt8()

uint8_t lldb_private::RegisterValue::GetAsUInt8 ( uint8_t  fail_value = UINT8_MAX,
bool *  success_ptr = nullptr 
) const
inline

◆ GetByteOrder()

lldb::ByteOrder lldb_private::RegisterValue::GetByteOrder ( ) const
inline

◆ GetBytes()

const void * RegisterValue::GetBytes ( ) const

◆ GetByteSize()

uint32_t RegisterValue::GetByteSize ( ) const

◆ GetData()

bool RegisterValue::GetData ( DataExtractor data) const

◆ GetMaxByteSize()

static uint32_t lldb_private::RegisterValue::GetMaxByteSize ( )
inlinestatic

Definition at line 252 of file RegisterValue.h.

References Clear(), and kMaxRegisterByteSize.

◆ GetScalarValue()

bool RegisterValue::GetScalarValue ( Scalar scalar) const

◆ GetType()

RegisterValue::Type lldb_private::RegisterValue::GetType ( ) const
inline

◆ operator!=()

bool RegisterValue::operator!= ( const RegisterValue rhs) const

Definition at line 795 of file RegisterValue.cpp.

Referenced by SetValueToInvalid().

◆ operator=() [1/8]

void lldb_private::RegisterValue::operator= ( uint8_t  uint)
inline

Definition at line 148 of file RegisterValue.h.

References eTypeUInt8, m_scalar, and m_type.

◆ operator=() [2/8]

void lldb_private::RegisterValue::operator= ( uint16_t  uint)
inline

Definition at line 153 of file RegisterValue.h.

References eTypeUInt16, m_scalar, and m_type.

◆ operator=() [3/8]

void lldb_private::RegisterValue::operator= ( uint32_t  uint)
inline

Definition at line 158 of file RegisterValue.h.

References eTypeUInt32, m_scalar, and m_type.

◆ operator=() [4/8]

void lldb_private::RegisterValue::operator= ( uint64_t  uint)
inline

Definition at line 163 of file RegisterValue.h.

References eTypeUInt64, m_scalar, and m_type.

◆ operator=() [5/8]

void lldb_private::RegisterValue::operator= ( llvm::APInt  uint)
inline

Definition at line 168 of file RegisterValue.h.

References eTypeUInt128, m_scalar, and m_type.

◆ operator=() [6/8]

void lldb_private::RegisterValue::operator= ( float  f)
inline

Definition at line 173 of file RegisterValue.h.

References eTypeFloat, m_scalar, and m_type.

◆ operator=() [7/8]

void lldb_private::RegisterValue::operator= ( double  f)
inline

Definition at line 178 of file RegisterValue.h.

References eTypeDouble, m_scalar, and m_type.

◆ operator=() [8/8]

void lldb_private::RegisterValue::operator= ( long double  f)
inline

Definition at line 183 of file RegisterValue.h.

References eTypeLongDouble, m_scalar, and m_type.

◆ operator==()

bool RegisterValue::operator== ( const RegisterValue rhs) const

Definition at line 766 of file RegisterValue.cpp.

References buffer, bytes, length, m_scalar, and m_type.

Referenced by SetValueToInvalid().

◆ SetBit()

bool RegisterValue::SetBit ( uint32_t  bit)

Definition at line 839 of file RegisterValue.cpp.

References lldb::eByteOrderBig, and lldb::eByteOrderLittle.

Referenced by SetValueToInvalid().

◆ SetBytes()

void RegisterValue::SetBytes ( const void *  bytes,
size_t  length,
lldb::ByteOrder  byte_order 
)

◆ SetDouble()

void lldb_private::RegisterValue::SetDouble ( double  f)
inline

Definition at line 220 of file RegisterValue.h.

References eTypeDouble, m_scalar, and m_type.

Referenced by RegisterContextDarwin_arm64::ReadRegister().

◆ SetFloat()

void lldb_private::RegisterValue::SetFloat ( float  f)
inline

Definition at line 215 of file RegisterValue.h.

References eTypeFloat, m_scalar, and m_type.

Referenced by RegisterContextDarwin_arm64::ReadRegister().

◆ SetFromMemoryData()

uint32_t RegisterValue::SetFromMemoryData ( const RegisterInfo *  reg_info,
const void *  src,
uint32_t  src_len,
lldb::ByteOrder  src_byte_order,
Status error 
)

◆ SetLongDouble()

void lldb_private::RegisterValue::SetLongDouble ( long double  f)
inline

◆ SetType() [1/2]

void lldb_private::RegisterValue::SetType ( RegisterValue::Type  type)
inline

◆ SetType() [2/2]

RegisterValue::Type RegisterValue::SetType ( const RegisterInfo *  reg_info)

Definition at line 188 of file RegisterValue.cpp.

References CopyValue(), and GetData().

◆ SetUInt()

bool RegisterValue::SetUInt ( uint64_t  uint,
uint32_t  byte_size 
)

◆ SetUInt128()

void lldb_private::RegisterValue::SetUInt128 ( llvm::APInt  uint)
inline

Definition at line 208 of file RegisterValue.h.

References eTypeUInt128, m_scalar, m_type, and SetUInt().

◆ SetUInt16()

void lldb_private::RegisterValue::SetUInt16 ( uint16_t  uint)
inline

◆ SetUInt32()

void lldb_private::RegisterValue::SetUInt32 ( uint32_t  uint,
Type  t = eTypeUInt32 
)
inline

◆ SetUInt64()

void lldb_private::RegisterValue::SetUInt64 ( uint64_t  uint,
Type  t = eTypeUInt64 
)
inline

◆ SetUInt8()

void lldb_private::RegisterValue::SetUInt8 ( uint8_t  uint)
inline

Definition at line 188 of file RegisterValue.h.

References eTypeUInt8, m_scalar, and m_type.

Referenced by RegisterContextPOSIXProcessMonitor_x86_64::WriteRegister().

◆ SetValueFromData()

Status RegisterValue::SetValueFromData ( const RegisterInfo *  reg_info,
DataExtractor data,
lldb::offset_t  offset,
bool  partial_data_ok 
)

◆ SetValueFromString() [1/2]

Status RegisterValue::SetValueFromString ( const RegisterInfo *  reg_info,
llvm::StringRef  value_str 
)

◆ SetValueFromString() [2/2]

Status lldb_private::RegisterValue::SetValueFromString ( const RegisterInfo *  reg_info,
const char *  value_str 
)
delete

◆ SetValueToInvalid()

void lldb_private::RegisterValue::SetValueToInvalid ( )
inline

◆ SignExtend()

bool RegisterValue::SignExtend ( uint32_t  sign_bitpos)

Member Data Documentation

◆ buffer

struct { ... } lldb_private::RegisterValue::buffer

Referenced by CopyValue(), GetByteOrder(), and operator==().

◆ byte_order

lldb::ByteOrder lldb_private::RegisterValue::byte_order

Definition at line 264 of file RegisterValue.h.

Referenced by CopyValue(), and SetLongDouble().

◆ bytes

uint8_t lldb_private::RegisterValue::bytes[kMaxRegisterByteSize]

Definition at line 261 of file RegisterValue.h.

Referenced by CopyValue(), operator==(), and SetLongDouble().

◆ length

uint8_t lldb_private::RegisterValue::length

Definition at line 263 of file RegisterValue.h.

Referenced by CopyValue(), operator==(), and SetLongDouble().

◆ m_scalar

Scalar lldb_private::RegisterValue::m_scalar
protected

◆ m_type

RegisterValue::Type lldb_private::RegisterValue::m_type
protected

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