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

#include <Scalar.h>

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

Public Types

enum  Type {
  e_void = 0, e_sint, e_uint, e_slong,
  e_ulong, e_slonglong, e_ulonglong, e_sint128,
  e_uint128, e_sint256, e_uint256, e_sint512,
  e_uint512, e_float, e_double, e_long_double
}
 

Public Member Functions

 Scalar ()
 
 Scalar (int v)
 
 Scalar (unsigned int v)
 
 Scalar (long v)
 
 Scalar (unsigned long v)
 
 Scalar (long long v)
 
 Scalar (unsigned long long v)
 
 Scalar (float v)
 
 Scalar (double v)
 
 Scalar (long double v, bool ieee_quad)
 
 Scalar (llvm::APInt v)
 
 Scalar (const Scalar &rhs)
 
virtual ~Scalar ()
 
bool SignExtend (uint32_t bit_pos)
 
bool ExtractBitfield (uint32_t bit_size, uint32_t bit_offset)
 
bool SetBit (uint32_t bit)
 
bool ClearBit (uint32_t bit)
 
const void * GetBytes () const
 
size_t GetByteSize () const
 
bool GetData (DataExtractor &data, size_t limit_byte_size=UINT32_MAX) const
 
size_t GetAsMemoryData (void *dst, size_t dst_len, lldb::ByteOrder dst_byte_order, Status &error) const
 
bool IsZero () const
 
void Clear ()
 
const char * GetTypeAsCString () const
 
void GetValue (Stream *s, bool show_type) const
 
bool IsValid () const
 
bool Promote (Scalar::Type type)
 
bool MakeSigned ()
 
bool MakeUnsigned ()
 
Scalaroperator= (const int i)
 
Scalaroperator= (unsigned int v)
 
Scalaroperator= (long v)
 
Scalaroperator= (unsigned long v)
 
Scalaroperator= (long long v)
 
Scalaroperator= (unsigned long long v)
 
Scalaroperator= (float v)
 
Scalaroperator= (double v)
 
Scalaroperator= (long double v)
 
Scalaroperator= (llvm::APInt v)
 
Scalaroperator= (const Scalar &rhs)
 
Scalaroperator+= (const Scalar &rhs)
 
Scalaroperator<<= (const Scalar &rhs)
 
Scalaroperator>>= (const Scalar &rhs)
 
Scalaroperator &= (const Scalar &rhs)
 
bool ShiftRightLogical (const Scalar &rhs)
 
bool AbsoluteValue ()
 
bool UnaryNegate ()
 
bool OnesComplement ()
 
Scalar::Type GetType () const
 
int SInt (int fail_value=0) const
 
unsigned char UChar (unsigned char fail_value=0) const
 
signed char SChar (char fail_value=0) const
 
unsigned short UShort (unsigned short fail_value=0) const
 
short SShort (short fail_value=0) const
 
unsigned int UInt (unsigned int fail_value=0) const
 
long SLong (long fail_value=0) const
 
unsigned long ULong (unsigned long fail_value=0) const
 
long long SLongLong (long long fail_value=0) const
 
unsigned long long ULongLong (unsigned long long fail_value=0) const
 
llvm::APInt SInt128 (llvm::APInt &fail_value) const
 
llvm::APInt UInt128 (const llvm::APInt &fail_value) const
 
float Float (float fail_value=0.0f) const
 
double Double (double fail_value=0.0) const
 
long double LongDouble (long double fail_value=0.0) const
 
Status SetValueFromCString (const char *s, lldb::Encoding encoding, size_t byte_size)
 
Status SetValueFromData (DataExtractor &data, lldb::Encoding encoding, size_t byte_size)
 

Static Public Member Functions

static const char * GetValueTypeAsCString (Scalar::Type value_type)
 
static Scalar::Type GetValueTypeForSignedIntegerWithByteSize (size_t byte_size)
 
static Scalar::Type GetValueTypeForUnsignedIntegerWithByteSize (size_t byte_size)
 
static Scalar::Type GetValueTypeForFloatWithByteSize (size_t byte_size)
 
static bool UIntValueIsValidForSize (uint64_t uval64, size_t total_byte_size)
 
static bool SIntValueIsValidForSize (int64_t sval64, size_t total_byte_size)
 

Protected Types

typedef char schar_t
 
typedef unsigned char uchar_t
 
typedef short sshort_t
 
typedef unsigned short ushort_t
 
typedef int sint_t
 
typedef unsigned int uint_t
 
typedef long slong_t
 
typedef unsigned long ulong_t
 
typedef long long slonglong_t
 
typedef unsigned long long ulonglong_t
 
typedef float float_t
 
typedef double double_t
 
typedef long double long_double_t
 

Protected Attributes

Scalar::Type m_type
 
llvm::APInt m_integer
 
llvm::APFloat m_float
 
bool m_ieee_quad = false
 

Friends

const Scalar operator+ (const Scalar &lhs, const Scalar &rhs)
 
const Scalar operator- (const Scalar &lhs, const Scalar &rhs)
 
const Scalar operator/ (const Scalar &lhs, const Scalar &rhs)
 
const Scalar operator* (const Scalar &lhs, const Scalar &rhs)
 
const Scalar operator & (const Scalar &lhs, const Scalar &rhs)
 
const Scalar operator| (const Scalar &lhs, const Scalar &rhs)
 
const Scalar operator% (const Scalar &lhs, const Scalar &rhs)
 
const Scalar operator^ (const Scalar &lhs, const Scalar &rhs)
 
const Scalar operator<< (const Scalar &lhs, const Scalar &rhs)
 
const Scalar operator>> (const Scalar &lhs, const Scalar &rhs)
 
bool operator== (const Scalar &lhs, const Scalar &rhs)
 
bool operator!= (const Scalar &lhs, const Scalar &rhs)
 
bool operator< (const Scalar &lhs, const Scalar &rhs)
 
bool operator<= (const Scalar &lhs, const Scalar &rhs)
 
bool operator> (const Scalar &lhs, const Scalar &rhs)
 
bool operator>= (const Scalar &lhs, const Scalar &rhs)
 

Detailed Description

Definition at line 39 of file Scalar.h.

Member Typedef Documentation

◆ double_t

typedef double lldb_private::Scalar::double_t
protected

Definition at line 284 of file Scalar.h.

◆ float_t

typedef float lldb_private::Scalar::float_t
protected

Definition at line 283 of file Scalar.h.

◆ long_double_t

typedef long double lldb_private::Scalar::long_double_t
protected

Definition at line 285 of file Scalar.h.

◆ schar_t

typedef char lldb_private::Scalar::schar_t
protected

Definition at line 273 of file Scalar.h.

◆ sint_t

typedef int lldb_private::Scalar::sint_t
protected

Definition at line 277 of file Scalar.h.

◆ slong_t

typedef long lldb_private::Scalar::slong_t
protected

Definition at line 279 of file Scalar.h.

◆ slonglong_t

typedef long long lldb_private::Scalar::slonglong_t
protected

Definition at line 281 of file Scalar.h.

◆ sshort_t

typedef short lldb_private::Scalar::sshort_t
protected

Definition at line 275 of file Scalar.h.

◆ uchar_t

typedef unsigned char lldb_private::Scalar::uchar_t
protected

Definition at line 274 of file Scalar.h.

◆ uint_t

typedef unsigned int lldb_private::Scalar::uint_t
protected

Definition at line 278 of file Scalar.h.

◆ ulong_t

typedef unsigned long lldb_private::Scalar::ulong_t
protected

Definition at line 280 of file Scalar.h.

◆ ulonglong_t

typedef unsigned long long lldb_private::Scalar::ulonglong_t
protected

Definition at line 282 of file Scalar.h.

◆ ushort_t

typedef unsigned short lldb_private::Scalar::ushort_t
protected

Definition at line 276 of file Scalar.h.

Member Enumeration Documentation

◆ Type

Enumerator
e_void 
e_sint 
e_uint 
e_slong 
e_ulong 
e_slonglong 
e_ulonglong 
e_sint128 
e_uint128 
e_sint256 
e_uint256 
e_sint512 
e_uint512 
e_float 
e_double 
e_long_double 

Definition at line 41 of file Scalar.h.

Constructor & Destructor Documentation

◆ Scalar() [1/12]

Scalar::Scalar ( )

Definition at line 72 of file Scalar.cpp.

Referenced by Scalar().

◆ Scalar() [2/12]

lldb_private::Scalar::Scalar ( int  v)
inline

Definition at line 62 of file Scalar.h.

References m_integer.

◆ Scalar() [3/12]

lldb_private::Scalar::Scalar ( unsigned int  v)
inline

Definition at line 65 of file Scalar.h.

References m_integer.

◆ Scalar() [4/12]

lldb_private::Scalar::Scalar ( long  v)
inline

Definition at line 68 of file Scalar.h.

References m_integer.

◆ Scalar() [5/12]

lldb_private::Scalar::Scalar ( unsigned long  v)
inline

Definition at line 71 of file Scalar.h.

References m_integer.

◆ Scalar() [6/12]

lldb_private::Scalar::Scalar ( long long  v)
inline

Definition at line 74 of file Scalar.h.

References m_integer.

◆ Scalar() [7/12]

lldb_private::Scalar::Scalar ( unsigned long long  v)
inline

Definition at line 77 of file Scalar.h.

References m_integer.

◆ Scalar() [8/12]

lldb_private::Scalar::Scalar ( float  v)
inline

Definition at line 80 of file Scalar.h.

References m_float.

◆ Scalar() [9/12]

lldb_private::Scalar::Scalar ( double  v)
inline

Definition at line 81 of file Scalar.h.

References m_float.

◆ Scalar() [10/12]

lldb_private::Scalar::Scalar ( long double  v,
bool  ieee_quad 
)
inline

Definition at line 84 of file Scalar.h.

References BITWIDTH_INT128, m_float, and NUM_OF_WORDS_INT128.

◆ Scalar() [11/12]

lldb_private::Scalar::Scalar ( llvm::APInt  v)
inline

◆ Scalar() [12/12]

Scalar::Scalar ( const Scalar rhs)

Definition at line 74 of file Scalar.cpp.

◆ ~Scalar()

Scalar::~Scalar ( )
virtualdefault

Referenced by operator=(), and Scalar().

Member Function Documentation

◆ AbsoluteValue()

bool Scalar::AbsoluteValue ( )

◆ Clear()

void lldb_private::Scalar::Clear ( )
inline

◆ ClearBit()

bool Scalar::ClearBit ( uint32_t  bit)

◆ Double()

double Scalar::Double ( double  fail_value = 0.0) const

◆ ExtractBitfield()

bool Scalar::ExtractBitfield ( uint32_t  bit_size,
uint32_t  bit_offset 
)

◆ Float()

float Scalar::Float ( float  fail_value = 0.0f) const

◆ GetAsMemoryData()

size_t Scalar::GetAsMemoryData ( void *  dst,
size_t  dst_len,
lldb::ByteOrder  dst_byte_order,
Status error 
) const

◆ GetBytes()

const void * Scalar::GetBytes ( ) const

◆ GetByteSize()

size_t Scalar::GetByteSize ( ) const

◆ GetData()

bool Scalar::GetData ( DataExtractor data,
size_t  limit_byte_size = UINT32_MAX 
) const

◆ GetType()

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

◆ GetTypeAsCString()

const char * Scalar::GetTypeAsCString ( ) const

◆ GetValue()

void Scalar::GetValue ( Stream s,
bool  show_type 
) const

◆ GetValueTypeAsCString()

const char * Scalar::GetValueTypeAsCString ( Scalar::Type  value_type)
static

◆ GetValueTypeForFloatWithByteSize()

Scalar::Type Scalar::GetValueTypeForFloatWithByteSize ( size_t  byte_size)
static

Definition at line 1174 of file Scalar.cpp.

References e_double, e_float, e_long_double, and e_void.

Referenced by IsValid().

◆ GetValueTypeForSignedIntegerWithByteSize()

Scalar::Type Scalar::GetValueTypeForSignedIntegerWithByteSize ( size_t  byte_size)
static

Definition at line 1153 of file Scalar.cpp.

References e_sint, e_slong, e_slonglong, and e_void.

Referenced by IsValid(), and SetValueFromCString().

◆ GetValueTypeForUnsignedIntegerWithByteSize()

Scalar::Type Scalar::GetValueTypeForUnsignedIntegerWithByteSize ( size_t  byte_size)
static

Definition at line 1164 of file Scalar.cpp.

References e_uint, e_ulong, e_ulonglong, and e_void.

Referenced by IsValid(), and SetValueFromCString().

◆ IsValid()

bool lldb_private::Scalar::IsValid ( ) const
inline

◆ IsZero()

bool Scalar::IsZero ( ) const

◆ LongDouble()

long double Scalar::LongDouble ( long double  fail_value = 0.0) const

◆ MakeSigned()

bool Scalar::MakeSigned ( )

◆ MakeUnsigned()

bool Scalar::MakeUnsigned ( )

◆ OnesComplement()

bool Scalar::OnesComplement ( )

◆ operator &=()

Scalar& lldb_private::Scalar::operator&= ( const Scalar rhs)

Referenced by IsValid(), and operator>>=().

◆ operator+=()

Scalar & Scalar::operator+= ( const Scalar rhs)

◆ operator<<=()

Scalar & Scalar::operator<<= ( const Scalar rhs)

◆ operator=() [1/11]

Scalar & Scalar::operator= ( const int  i)

Definition at line 320 of file Scalar.cpp.

References e_sint, m_integer, and m_type.

Referenced by IsValid(), and SetValueFromData().

◆ operator=() [2/11]

Scalar & Scalar::operator= ( unsigned int  v)

Definition at line 326 of file Scalar.cpp.

References e_uint, m_integer, and m_type.

◆ operator=() [3/11]

Scalar & Scalar::operator= ( long  v)

Definition at line 332 of file Scalar.cpp.

References e_slong, m_integer, and m_type.

◆ operator=() [4/11]

Scalar & Scalar::operator= ( unsigned long  v)

Definition at line 338 of file Scalar.cpp.

References e_ulong, m_integer, and m_type.

◆ operator=() [5/11]

Scalar & Scalar::operator= ( long long  v)

Definition at line 344 of file Scalar.cpp.

References e_slonglong, m_integer, and m_type.

◆ operator=() [6/11]

Scalar & Scalar::operator= ( unsigned long long  v)

Definition at line 350 of file Scalar.cpp.

References e_ulonglong, m_integer, and m_type.

◆ operator=() [7/11]

Scalar & Scalar::operator= ( float  v)

Definition at line 356 of file Scalar.cpp.

References e_float, m_float, and m_type.

◆ operator=() [8/11]

Scalar & Scalar::operator= ( double  v)

Definition at line 362 of file Scalar.cpp.

References e_double, m_float, and m_type.

◆ operator=() [9/11]

Scalar & Scalar::operator= ( long double  v)

Definition at line 368 of file Scalar.cpp.

References BITWIDTH_INT128, e_long_double, m_float, m_ieee_quad, m_type, and NUM_OF_WORDS_INT128.

◆ operator=() [10/11]

Scalar & Scalar::operator= ( llvm::APInt  v)

◆ operator=() [11/11]

Scalar & Scalar::operator= ( const Scalar rhs)

Definition at line 311 of file Scalar.cpp.

References m_float, m_integer, and m_type.

◆ operator>>=()

Scalar & Scalar::operator>>= ( const Scalar rhs)

◆ Promote()

bool Scalar::Promote ( Scalar::Type  type)

◆ SChar()

signed char Scalar::SChar ( char  fail_value = 0) const

◆ SetBit()

bool Scalar::SetBit ( uint32_t  bit)

◆ SetValueFromCString()

Status Scalar::SetValueFromCString ( const char *  s,
lldb::Encoding  encoding,
size_t  byte_size 
)

◆ SetValueFromData()

Status Scalar::SetValueFromData ( DataExtractor data,
lldb::Encoding  encoding,
size_t  byte_size 
)

◆ ShiftRightLogical()

bool Scalar::ShiftRightLogical ( const Scalar rhs)

◆ SignExtend()

bool Scalar::SignExtend ( uint32_t  bit_pos)

◆ SInt()

int Scalar::SInt ( int  fail_value = 0) const

◆ SInt128()

llvm::APInt Scalar::SInt128 ( llvm::APInt &  fail_value) const

◆ SIntValueIsValidForSize()

static bool lldb_private::Scalar::SIntValueIsValidForSize ( int64_t  sval64,
size_t  total_byte_size 
)
inlinestatic

Definition at line 260 of file Scalar.h.

Referenced by SetValueFromCString().

◆ SLong()

long Scalar::SLong ( long  fail_value = 0) const

◆ SLongLong()

long long Scalar::SLongLong ( long long  fail_value = 0) const

◆ SShort()

short Scalar::SShort ( short  fail_value = 0) const

◆ UChar()

unsigned char Scalar::UChar ( unsigned char  fail_value = 0) const

◆ UInt()

unsigned int Scalar::UInt ( unsigned int  fail_value = 0) const

◆ UInt128()

llvm::APInt Scalar::UInt128 ( const llvm::APInt &  fail_value) const

◆ UIntValueIsValidForSize()

static bool lldb_private::Scalar::UIntValueIsValidForSize ( uint64_t  uval64,
size_t  total_byte_size 
)
inlinestatic

Definition at line 249 of file Scalar.h.

Referenced by SetValueFromCString().

◆ ULong()

unsigned long Scalar::ULong ( unsigned long  fail_value = 0) const

◆ ULongLong()

unsigned long long Scalar::ULongLong ( unsigned long long  fail_value = 0) const

Definition at line 1566 of file Scalar.cpp.

References e_double, e_float, e_long_double, e_sint, e_sint128, e_sint256, e_sint512, e_slong, e_slonglong, e_uint, e_uint128, e_uint256, e_uint512, e_ulong, e_ulonglong, e_void, m_float, m_integer, and m_type.

Referenced by InterpreterStackFrame::AssignValue(), lldb_private::Value::ConvertToLoadAddress(), lldb_private::ClangExpressionDeclMap::FindExternalVisibleDecls(), lldb_private::ValueObject::GetAddressOf(), lldb_private::AppleThreadPlanStepThroughObjCTrampoline::GetDescription(), lldb_private::ItaniumABILanguageRuntime::GetExceptionObjectForThread(), lldb_private::ValueObject::GetExpressionPath(), lldb_private::ClangExpressionDeclMap::GetFunctionInfo(), SymbolFileDWARF::GetGlobalAranges(), lldb_private::ValueObject::GetLocationAsCStringImpl(), lldb_private::AppleObjCRuntime::GetObjectDescription(), lldb_private::ValueObject::GetPointeeData(), lldb_private::ValueObject::GetPointerValue(), lldb_private::AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(), GetType(), lldb_private::Value::GetValueAsData(), lldb_private::ValueObject::GetValueAsUnsigned(), IRInterpreter::Interpret(), lldb_private::ValueObject::IsLogicalTrue(), lldb_private::RegisterContextLLDB::IsTrapHandlerFrame(), lldb_private::ThreadPlanAssemblyTracer::Log(), DynamicLoaderMacOS::NotifyBreakpointHit(), DynamicLoaderMacOSXDYLD::NotifyBreakpointHit(), ObjCExceptionRecognizedStackFrame::ObjCExceptionRecognizedStackFrame(), lldb_private::Value::operator=(), lldb_private::StopInfoWatchpoint::PerformAction(), lldb_private::IRMemoryMap::ReadPointerFromMemory(), lldb_private::Target::ReadPointerFromMemory(), lldb_private::Process::ReadPointerFromMemory(), lldb_private::Target::ReadUnsignedIntegerFromMemory(), lldb_private::Process::ReadUnsignedIntegerFromMemory(), lldb_private::Value::ResolveValue(), lldb_private::ValueObject::SetData(), lldb_private::ValueObject::SetValueFromCString(), lldb_private::CompilerType::SetValueFromScalar(), lldb_private::AppleThreadPlanStepThroughObjCTrampoline::ShouldStop(), lldb_private::ValueObjectChild::UpdateValue(), and lldb_private::Value::Value().

◆ UnaryNegate()

bool Scalar::UnaryNegate ( )

◆ UShort()

unsigned short Scalar::UShort ( unsigned short  fail_value = 0) const

Friends And Related Function Documentation

◆ operator &

const Scalar operator& ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator!=

bool operator!= ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator%

const Scalar operator% ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator*

const Scalar operator* ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator+

const Scalar operator+ ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator-

const Scalar operator- ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator/

const Scalar operator/ ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator<

bool operator< ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator<<

const Scalar operator<< ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator<=

bool operator<= ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator==

bool operator== ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator>

bool operator> ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator>=

bool operator>= ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator>>

const Scalar operator>> ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator^

const Scalar operator^ ( const Scalar lhs,
const Scalar rhs 
)
friend

◆ operator|

const Scalar operator| ( const Scalar lhs,
const Scalar rhs 
)
friend

Member Data Documentation

◆ m_float

llvm::APFloat lldb_private::Scalar::m_float
protected

◆ m_ieee_quad

bool lldb_private::Scalar::m_ieee_quad = false
protected

Definition at line 291 of file Scalar.h.

Referenced by operator=(), and Promote().

◆ m_integer

llvm::APInt lldb_private::Scalar::m_integer
protected

◆ m_type

Scalar::Type lldb_private::Scalar::m_type
protected

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