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

#include <RegisterValue.h>

Classes

struct  RegisterValueBuffer
 

Public Types

enum  { kTypicalRegisterByteSize = 256u , kMaxRegisterByteSize = 256u * 256u }
 
enum  Type {
  eTypeInvalid , eTypeUInt8 , eTypeUInt16 , eTypeUInt32 ,
  eTypeUInt64 , eTypeUInt128 , eTypeFloat , eTypeDouble ,
  eTypeLongDouble , eTypeBytes
}
 
typedef llvm::SmallVector< uint8_t, kTypicalRegisterByteSizeBytesContainer
 

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 (llvm::ArrayRef< uint8_t > bytes, 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 ()
 

Protected Attributes

RegisterValue::Type m_type = eTypeInvalid
 
Scalar m_scalar
 
struct lldb_private::RegisterValue::RegisterValueBuffer buffer
 

Detailed Description

Definition at line 29 of file RegisterValue.h.

Member Typedef Documentation

◆ BytesContainer

Definition at line 41 of file RegisterValue.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
kTypicalRegisterByteSize 
kMaxRegisterByteSize 

Definition at line 31 of file RegisterValue.h.

◆ Type

Enumerator
eTypeInvalid 
eTypeUInt8 
eTypeUInt16 
eTypeUInt32 
eTypeUInt64 
eTypeUInt128 
eTypeFloat 
eTypeDouble 
eTypeLongDouble 
eTypeBytes 

Definition at line 43 of file RegisterValue.h.

Constructor & Destructor Documentation

◆ RegisterValue() [1/10]

lldb_private::RegisterValue::RegisterValue ( )
inline

Definition at line 56 of file RegisterValue.h.

◆ RegisterValue() [2/10]

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

Definition at line 58 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [3/10]

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

Definition at line 60 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [4/10]

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

Definition at line 64 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [5/10]

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

Definition at line 68 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [6/10]

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

Definition at line 72 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [7/10]

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

Definition at line 76 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [8/10]

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

Definition at line 78 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [9/10]

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

Definition at line 82 of file RegisterValue.h.

References m_scalar.

◆ RegisterValue() [10/10]

lldb_private::RegisterValue::RegisterValue ( llvm::ArrayRef< uint8_t >  bytes,
lldb::ByteOrder  byte_order 
)
inlineexplicit

Definition at line 86 of file RegisterValue.h.

References SetBytes().

Member Function Documentation

◆ Clear()

void RegisterValue::Clear ( )

Definition at line 140 of file RegisterValue.cpp.

References eTypeInvalid, and m_type.

Referenced by lldb_private::ValueObjectRegister::UpdateValue().

◆ ClearBit()

bool RegisterValue::ClearBit ( uint32_t  bit)

◆ CopyValue()

bool RegisterValue::CopyValue ( const RegisterValue rhs)

◆ GetAsDouble()

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

◆ GetAsFloat()

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

◆ GetAsLongDouble()

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

◆ 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

Definition at line 537 of file RegisterValue.cpp.

References buffer, lldb_private::RegisterValue::RegisterValueBuffer::bytes, eTypeBytes, eTypeDouble, eTypeFloat, eTypeLongDouble, eTypeUInt16, eTypeUInt32, eTypeUInt64, eTypeUInt8, m_scalar, m_type, and lldb_private::Scalar::ULongLong().

Referenced by ThreadMachCore::CalculateStopInfo(), lldb_private::NativeRegisterContextDBReg_x86::ClearAllHardwareWatchpoints(), lldb_private::NativeRegisterContextDBReg_x86::ClearHardwareWatchpoint(), lldb_private::NativeRegisterContextDBReg_x86::ClearWatchpointHit(), lldb_private::StopInfoMachException::DeterminePtrauthFailure(), lldb_private::OptionArgParser::DoToAddress(), lldb_private::process_linux::NativeRegisterContextLinux::DoWriteRegisterValue(), CommandObjectRegisterRead::DumpRegister(), lldb_private::DumpRegisterValue(), lldb_private::NativeRegisterContextDBReg_x86::GetWatchpointAddress(), lldb_private::NativeRegisterContextDBReg_x86::IsWatchpointHit(), lldb_private::NativeRegisterContextDBReg_x86::IsWatchpointVacant(), lldb_private::Rs::Read(), read_register_u64_raw(), lldb_private::Rs::ReadAPFloat(), lldb_private::RegisterContextUnwind::ReadFrameAddress(), lldb_private::RegisterContextUnwind::ReadGPRValue(), lldb_private::RegisterContextUnwind::ReadRegister(), lldb_private::NativeRegisterContext::ReadRegisterAsUnsigned(), lldb_private::RegisterContext::ReadRegisterAsUnsigned(), lldb_private::EmulateInstruction::ReadRegisterUnsigned(), lldb_private::NativeRegisterContextDBReg_x86::SetHardwareWatchpointWithIndex(), lldb_private::RegisterContextUnwind::TryFallbackUnwindPlan(), EmulationStateARM::WritePseudoRegister(), RegisterContextDarwin_arm64::WriteRegister(), RegisterContextDarwin_x86_64::WriteRegister(), and UnwindAssemblyInstEmulation::WriteRegister().

◆ 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

◆ 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 761 of file RegisterValue.cpp.

◆ operator=() [1/8]

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

Definition at line 190 of file RegisterValue.h.

References eTypeDouble, m_scalar, and m_type.

◆ operator=() [2/8]

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

Definition at line 185 of file RegisterValue.h.

References eTypeFloat, m_scalar, and m_type.

◆ operator=() [3/8]

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

Definition at line 180 of file RegisterValue.h.

References eTypeUInt128, m_scalar, and m_type.

◆ operator=() [4/8]

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

Definition at line 195 of file RegisterValue.h.

References eTypeLongDouble, m_scalar, and m_type.

◆ operator=() [5/8]

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

Definition at line 165 of file RegisterValue.h.

References eTypeUInt16, m_scalar, and m_type.

◆ operator=() [6/8]

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

Definition at line 170 of file RegisterValue.h.

References eTypeUInt32, m_scalar, and m_type.

◆ operator=() [7/8]

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

Definition at line 175 of file RegisterValue.h.

References eTypeUInt64, m_scalar, and m_type.

◆ operator=() [8/8]

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

Definition at line 160 of file RegisterValue.h.

References eTypeUInt8, m_scalar, and m_type.

◆ operator==()

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

◆ SetBit()

bool RegisterValue::SetBit ( uint32_t  bit)

◆ 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 232 of file RegisterValue.h.

References eTypeDouble, m_scalar, and m_type.

Referenced by RegisterContextDarwin_arm64::ReadRegister(), and SetValueFromData().

◆ SetFloat()

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

Definition at line 227 of file RegisterValue.h.

References eTypeFloat, m_scalar, and m_type.

Referenced by RegisterContextDarwin_arm64::ReadRegister(), and SetValueFromData().

◆ 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

Definition at line 237 of file RegisterValue.h.

References eTypeLongDouble, m_scalar, and m_type.

Referenced by ABISysV_i386::SetReturnValueObject(), and SetValueFromData().

◆ SetType() [1/2]

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

◆ SetType() [2/2]

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

◆ SetUInt()

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

◆ SetUInt128()

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

Definition at line 220 of file RegisterValue.h.

References eTypeUInt128, m_scalar, and m_type.

Referenced by SetUInt(), and SetValueFromData().

◆ SetUInt16()

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

Definition at line 205 of file RegisterValue.h.

References eTypeUInt16, m_scalar, and m_type.

Referenced by SetUInt(), and SetValueFromData().

◆ 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 200 of file RegisterValue.h.

References eTypeUInt8, m_scalar, and m_type.

Referenced by SetUInt(), and SetValueFromData().

◆ SetValueFromData()

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

◆ SetValueFromString() [1/2]

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

◆ SetValueFromString() [2/2]

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

◆ SetValueToInvalid()

void lldb_private::RegisterValue::SetValueToInvalid ( )
inline

◆ SignExtend()

bool RegisterValue::SignExtend ( uint32_t  sign_bitpos)

Member Data Documentation

◆ buffer

struct lldb_private::RegisterValue::RegisterValueBuffer lldb_private::RegisterValue::buffer
protected

◆ m_scalar

Scalar lldb_private::RegisterValue::m_scalar
protected

◆ m_type

RegisterValue::Type lldb_private::RegisterValue::m_type = eTypeInvalid
protected

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