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

#include <Value.h>

Public Types

enum class  ValueType {
  Invalid = -1 , Scalar = 0 , FileAddress , LoadAddress ,
  HostAddress
}
 Type that describes Value::m_value. More...
 
enum class  ContextType { Invalid = -1 , RegisterInfo = 0 , LLDBType , Variable }
 Type that describes Value::m_context. More...
 

Public Member Functions

 Value ()
 
 Value (const Scalar &scalar)
 
 Value (const void *bytes, int len)
 
 Value (const Value &rhs)
 
void SetBytes (const void *bytes, int len)
 
void AppendBytes (const void *bytes, int len)
 
Valueoperator= (const Value &rhs)
 
const CompilerTypeGetCompilerType ()
 
void SetCompilerType (const CompilerType &compiler_type)
 
ValueType GetValueType () const
 
AddressType GetValueAddressType () const
 
ContextType GetContextType () const
 
void SetValueType (ValueType value_type)
 
void ClearContext ()
 
void SetContext (ContextType context_type, void *p)
 
RegisterInfoGetRegisterInfo () const
 
TypeGetType ()
 
ScalarResolveValue (ExecutionContext *exe_ctx, Module *module=nullptr)
 
const ScalarGetScalar () const
 
ScalarGetScalar ()
 
size_t ResizeData (size_t len)
 
size_t AppendDataToHostBuffer (const Value &rhs)
 
DataBufferHeapGetBuffer ()
 
const DataBufferHeapGetBuffer () const
 
bool ValueOf (ExecutionContext *exe_ctx)
 
VariableGetVariable ()
 
void Dump (Stream *strm)
 
lldb::Format GetValueDefaultFormat ()
 
uint64_t GetValueByteSize (Status *error_ptr, ExecutionContext *exe_ctx)
 
Status GetValueAsData (ExecutionContext *exe_ctx, DataExtractor &data, Module *module)
 
void ConvertToLoadAddress (Module *module, Target *target)
 Convert this value's file address to a load address, if possible.
 
bool GetData (DataExtractor &data)
 
void Clear ()
 

Static Public Member Functions

static const char * GetValueTypeAsCString (ValueType context_type)
 
static const char * GetContextTypeAsCString (ContextType context_type)
 
static ValueType GetValueTypeFromAddressType (AddressType address_type)
 

Protected Attributes

Scalar m_value
 
CompilerType m_compiler_type
 
void * m_context = nullptr
 
ValueType m_value_type = ValueType::Scalar
 
ContextType m_context_type = ContextType::Invalid
 
DataBufferHeap m_data_buffer
 

Detailed Description

Definition at line 38 of file Value.h.

Member Enumeration Documentation

◆ ContextType

Type that describes Value::m_context.

Enumerator
Invalid 

Undefined.

RegisterInfo 

RegisterInfo * (can be a scalar or a vector register).

LLDBType 

lldb_private::Type *.

Variable 

lldb_private::Variable *.

Definition at line 56 of file Value.h.

◆ ValueType

enum class lldb_private::Value::ValueType
strong

Type that describes Value::m_value.

Enumerator
Invalid 
Scalar 

A raw scalar value.

FileAddress 

A file address value.

LoadAddress 

A load address value.

HostAddress 

A host address value (for memory in the process that < A is using liblldb).

Definition at line 41 of file Value.h.

Constructor & Destructor Documentation

◆ Value() [1/4]

Value::Value ( )

Definition at line 42 of file Value.cpp.

◆ Value() [2/4]

Value::Value ( const Scalar scalar)

Definition at line 44 of file Value.cpp.

◆ Value() [3/4]

Value::Value ( const void *  bytes,
int  len 
)

Definition at line 47 of file Value.cpp.

References SetBytes().

◆ Value() [4/4]

Value::Value ( const Value rhs)

Member Function Documentation

◆ AppendBytes()

void Value::AppendBytes ( const void *  bytes,
int  len 
)

◆ AppendDataToHostBuffer()

size_t Value::AppendDataToHostBuffer ( const Value rhs)

◆ Clear()

void Value::Clear ( )

◆ ClearContext()

void lldb_private::Value::ClearContext ( )
inline

Definition at line 91 of file Value.h.

References Invalid, m_context, and m_context_type.

Referenced by lldb_private::DWARFExpression::Evaluate().

◆ ConvertToLoadAddress()

void Value::ConvertToLoadAddress ( Module module,
Target target 
)

◆ Dump()

void Value::Dump ( Stream strm)

◆ GetBuffer() [1/2]

DataBufferHeap & lldb_private::Value::GetBuffer ( )
inline

◆ GetBuffer() [2/2]

const DataBufferHeap & lldb_private::Value::GetBuffer ( ) const
inline

Definition at line 122 of file Value.h.

References m_data_buffer.

◆ GetCompilerType()

const CompilerType & Value::GetCompilerType ( )

◆ GetContextType()

ContextType lldb_private::Value::GetContextType ( ) const
inline

◆ GetContextTypeAsCString()

const char * Value::GetContextTypeAsCString ( ContextType  context_type)
static

Definition at line 649 of file Value.cpp.

References Invalid, LLDBType, RegisterInfo, and Variable.

Referenced by Dump().

◆ GetData()

bool Value::GetData ( DataExtractor data)

◆ GetRegisterInfo()

RegisterInfo * Value::GetRegisterInfo ( ) const

◆ GetScalar() [1/2]

Scalar & lldb_private::Value::GetScalar ( )
inline

Definition at line 114 of file Value.h.

References m_value.

◆ GetScalar() [2/2]

const Scalar & lldb_private::Value::GetScalar ( ) const
inline

Definition at line 112 of file Value.h.

References m_value.

Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::ClangExpressionDeclMap::AddOneGenericVariable(), ConvertToLoadAddress(), PlatformPOSIX::DoLoadImage(), lldb_private::PlatformWindows::DoLoadImage(), lldb_private::DWARFExpression::Evaluate(), lldb_private::FunctionCaller::FetchFunctionResults(), lldb_private::ValueObject::GetAddressOf(), ABIMacOSX_arm64::GetArgumentValues(), ABISysV_arm64::GetArgumentValues(), ABIMacOSX_arm::GetArgumentValues(), ABISysV_arm::GetArgumentValues(), ABISysV_ppc::GetArgumentValues(), ABISysV_ppc64::GetArgumentValues(), ABISysV_s390x::GetArgumentValues(), ABIMacOSX_i386::GetArgumentValues(), ABISysV_i386::GetArgumentValues(), ABISysV_x86_64::GetArgumentValues(), ABIWindows_x86_64::GetArgumentValues(), lldb_private::AppleGetQueuesHandler::GetCurrentQueues(), lldb_private::AppleThreadPlanStepThroughObjCTrampoline::GetDescription(), lldb_private::ItaniumABILanguageRuntime::GetExceptionObjectForThread(), lldb_private::ValueObject::GetExpressionPath(), lldb_private::ClangExpressionDeclMap::GetFunctionInfo(), lldb_private::AppleGetItemInfoHandler::GetItemInfo(), lldb_private::ValueObject::GetLocationAsCStringImpl(), lldb_private::AppleObjCRuntime::GetObjectDescription(), lldb_private::AppleGetPendingItemsHandler::GetPendingItems(), lldb_private::ValueObject::GetPointeeData(), lldb_private::ValueObject::GetPointerValue(), ABIMacOSX_arm64::GetReturnValueObjectImpl(), ABISysV_arm64::GetReturnValueObjectImpl(), ABIMacOSX_arm::GetReturnValueObjectImpl(), ABISysV_arm::GetReturnValueObjectImpl(), ABIMacOSX_i386::GetReturnValueObjectImpl(), ABISysV_mips::GetReturnValueObjectImpl(), ABISysV_mips64::GetReturnValueObjectImpl(), ABISysV_arc::GetReturnValueObjectImpl(), ABISysV_hexagon::GetReturnValueObjectImpl(), ABISysV_riscv::GetReturnValueObjectImpl(), ABISysV_arc::GetReturnValueObjectSimple(), ABISysV_ppc::GetReturnValueObjectSimple(), ABISysV_riscv::GetReturnValueObjectSimple(), ABISysV_s390x::GetReturnValueObjectSimple(), ABISysV_i386::GetReturnValueObjectSimple(), ABISysV_x86_64::GetReturnValueObjectSimple(), ABIWindows_x86_64::GetReturnValueObjectSimple(), lldb_private::AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(), lldb_private::AppleGetThreadItemInfoHandler::GetThreadItemInfo(), GetValObjFromFPRegs(), GetValObjFromIntRegs(), lldb_private::ClangExpressionDeclMap::GetVariableValue(), IRInterpreter::Interpret(), lldb_private::ThreadPlanAssemblyTracer::Log(), DynamicLoaderMacOS::NotifyBreakpointHit(), DynamicLoaderMacOSXDYLD::NotifyBreakpointHit(), ObjCExceptionRecognizedStackFrame::ObjCExceptionRecognizedStackFrame(), ReadRegisterValueAsScalar(), lldb_private::AbortWithPayloadFrameRecognizer::RecognizeFrame(), lldb_private::ValueObject::SetData(), lldb_private::ValueObject::SetValueFromCString(), lldb_private::AppleThreadPlanStepThroughObjCTrampoline::ShouldStop(), lldb_private::AppleObjCRuntimeV2::SharedCacheClassInfoExtractor::UpdateISAToDescriptorMap(), lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::UpdateISAToDescriptorMap(), lldb_private::ValueObjectCast::UpdateValue(), lldb_private::ValueObjectChild::UpdateValue(), lldb_private::ValueObjectDynamicValue::UpdateValue(), lldb_private::ValueObjectMemory::UpdateValue(), lldb_private::ValueObjectRegister::UpdateValue(), lldb_private::ValueObjectVariable::UpdateValue(), lldb_private::ValueObjectVTable::UpdateValue(), ValueObjectVTableChild::UpdateValue(), lldb_private::ValueObjectConstResult::ValueObjectConstResult(), and lldb_private::ValueObjectMemory::ValueObjectMemory().

◆ GetType()

Type * Value::GetType ( )

Definition at line 146 of file Value.cpp.

References LLDBType, m_context, and m_context_type.

Referenced by GetCompilerType().

◆ GetValueAddressType()

AddressType Value::GetValueAddressType ( ) const

◆ GetValueAsData()

Status Value::GetValueAsData ( ExecutionContext exe_ctx,
DataExtractor data,
Module module 
)

Definition at line 315 of file Value.cpp.

References lldb_private::ConstString::AsCString(), lldb_private::Variable::CalculateSymbolContext(), lldb_private::DataExtractor::Clear(), lldb_private::eAddressTypeFile, lldb_private::eAddressTypeHost, lldb_private::eAddressTypeLoad, error(), FileAddress, lldb_private::ArchSpec::GetAddressByteSize(), lldb_private::ObjectFile::GetAddressByteSize(), lldb_private::Target::GetArchitecture(), lldb_private::ExecutionContext::GetBestExecutionContextScope(), lldb_private::ArchSpec::GetByteOrder(), lldb_private::ObjectFile::GetByteOrder(), lldb_private::Scalar::GetByteSize(), lldb_private::CompilerType::GetByteSize(), GetCompilerType(), lldb_private::Scalar::GetData(), lldb_private::Module::GetFileSpec(), lldb_private::Address::GetLoadAddress(), lldb_private::Variable::GetName(), lldb_private::Module::GetObjectFile(), lldb_private::FileSpec::GetPath(), lldb_private::CompilerType::GetPointerByteSize(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::ObjectFile::GetSectionList(), lldb_private::Target::GetSectionLoadList(), lldb_private::Process::GetState(), lldb_private::Process::GetTarget(), lldb_private::ExecutionContext::GetTargetPtr(), lldb_private::ExecutionContext::GetTargetRef(), GetValueByteSize(), GetVariable(), HostAddress, lldb_private::endian::InlHostByteOrder(), Invalid, lldb_private::Process::IsAlive(), lldb_private::SectionLoadList::IsEmpty(), lldb_private::Address::IsSectionOffset(), lldb_private::Address::IsValid(), lldb_private::CompilerType::IsValid(), LLDB_INVALID_ADDRESS, LoadAddress, m_value, m_value_type, lldb_private::SymbolContext::module_sp, lldb_private::DataExtractor::PeekData(), lldb_private::Target::ReadMemory(), lldb_private::Process::ReadMemory(), lldb_private::SectionLoadList::ResolveLoadAddress(), Scalar, lldb_private::DataExtractor::SetAddressByteSize(), lldb_private::DataExtractor::SetByteOrder(), lldb_private::DataExtractor::SetData(), lldb_private::StateIsStoppedState(), UINT32_MAX, lldb_private::Scalar::ULongLong(), and lldb_private::DataExtractor::ValidOffsetForDataOfSize().

Referenced by lldb_private::ValueObjectSynthetic::CopyValueData(), lldb_private::ValueObject::CreateConstantValue(), lldb_private::ValueObject::GetData(), lldb_private::AppleObjCTrampolineHandler::AppleObjCVTables::RefreshTrampolines(), ResolveValue(), lldb_private::ValueObjectCast::UpdateValue(), lldb_private::ValueObjectChild::UpdateValue(), lldb_private::ValueObjectDynamicValue::UpdateValue(), lldb_private::ValueObjectMemory::UpdateValue(), lldb_private::ValueObjectVariable::UpdateValue(), ValueObjectVTableChild::UpdateValue(), and lldb_private::ValueObjectConstResult::ValueObjectConstResult().

◆ GetValueByteSize()

uint64_t Value::GetValueByteSize ( Status error_ptr,
ExecutionContext exe_ctx 
)

◆ GetValueDefaultFormat()

lldb::Format Value::GetValueDefaultFormat ( )

◆ GetValueType()

Value::ValueType Value::GetValueType ( ) const

◆ GetValueTypeAsCString()

const char * Value::GetValueTypeAsCString ( ValueType  context_type)
static

Definition at line 633 of file Value.cpp.

References FileAddress, HostAddress, Invalid, LoadAddress, and Scalar.

Referenced by Dump().

◆ GetValueTypeFromAddressType()

Value::ValueType Value::GetValueTypeFromAddressType ( AddressType  address_type)
static

◆ GetVariable()

Variable * Value::GetVariable ( )

Definition at line 618 of file Value.cpp.

References m_context, m_context_type, and Variable.

Referenced by GetCompilerType(), and GetValueAsData().

◆ operator=()

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

◆ ResizeData()

size_t Value::ResizeData ( size_t  len)

◆ ResolveValue()

Scalar & Value::ResolveValue ( ExecutionContext exe_ctx,
Module module = nullptr 
)

◆ SetBytes()

void Value::SetBytes ( const void *  bytes,
int  len 
)

◆ SetCompilerType()

void Value::SetCompilerType ( const CompilerType compiler_type)

Definition at line 268 of file Value.cpp.

References m_compiler_type.

Referenced by lldb_private::ClangExpressionDeclMap::AddOneGenericVariable(), lldb_private::ClangExpressionDeclMap::AddOneVariable(), PlatformPOSIX::DoLoadImage(), lldb_private::PlatformWindows::DoLoadImage(), lldb_private::FunctionCaller::FetchFunctionResults(), lldb_private::AppleObjCRuntime::GetBacktraceThreadFromException(), lldb_private::AppleObjCRuntimeV2::SharedCacheClassInfoExtractor::GetClassInfoUtilityFunctionImpl(), lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::GetClassInfoUtilityFunctionImpl(), lldb_private::AppleGetQueuesHandler::GetCurrentQueues(), NSIndexPathSyntheticFrontEnd::Impl::InlinedIndexes::GetIndexAtIndex(), lldb_private::AppleGetItemInfoHandler::GetItemInfo(), lldb_private::AppleObjCRuntime::GetObjectDescription(), lldb_private::AppleGetPendingItemsHandler::GetPendingItems(), ABIMacOSX_arm64::GetReturnValueObjectImpl(), ABISysV_arm64::GetReturnValueObjectImpl(), ABIMacOSX_arm::GetReturnValueObjectImpl(), ABISysV_arm::GetReturnValueObjectImpl(), ABIMacOSX_i386::GetReturnValueObjectImpl(), ABISysV_mips::GetReturnValueObjectImpl(), ABISysV_mips64::GetReturnValueObjectImpl(), ABISysV_arc::GetReturnValueObjectSimple(), ABISysV_ppc::GetReturnValueObjectSimple(), ABISysV_riscv::GetReturnValueObjectSimple(), ABISysV_s390x::GetReturnValueObjectSimple(), ABISysV_i386::GetReturnValueObjectSimple(), ABISysV_x86_64::GetReturnValueObjectSimple(), ABIWindows_x86_64::GetReturnValueObjectSimple(), lldb_private::AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(), lldb_private::AppleGetThreadItemInfoHandler::GetThreadItemInfo(), lldb_private::ClangExpressionDeclMap::GetVariableValue(), lldb_private::ThreadPlanAssemblyTracer::Log(), lldb_private::PlatformWindows::MakeLoadImageUtilityFunction(), PlatformPOSIX::MakeLoadImageUtilityFunction(), DynamicLoaderMacOS::NotifyBreakpointHit(), DynamicLoaderMacOSXDYLD::NotifyBreakpointHit(), ObjCExceptionRecognizedStackFrame::ObjCExceptionRecognizedStackFrame(), lldb_private::AbortWithPayloadFrameRecognizer::RecognizeFrame(), lldb_private::AppleObjCTrampolineHandler::AppleObjCVTables::RefreshTrampolines(), lldb_private::AppleObjCRuntimeV2::SharedCacheClassInfoExtractor::UpdateISAToDescriptorMap(), lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::UpdateISAToDescriptorMap(), lldb_private::ValueObjectCast::UpdateValue(), lldb_private::ValueObjectChild::UpdateValue(), lldb_private::ValueObjectDynamicValue::UpdateValue(), lldb_private::ValueObjectMemory::UpdateValue(), lldb_private::ValueObjectVariable::UpdateValue(), lldb_private::ValueObjectVTable::UpdateValue(), ValueObjectVTableChild::UpdateValue(), lldb_private::ValueObjectCast::ValueObjectCast(), lldb_private::ValueObjectConstResult::ValueObjectConstResult(), and lldb_private::ValueObjectMemory::ValueObjectMemory().

◆ SetContext()

void lldb_private::Value::SetContext ( ContextType  context_type,
void *  p 
)
inline

◆ SetValueType()

void lldb_private::Value::SetValueType ( ValueType  value_type)
inline

Definition at line 89 of file Value.h.

References m_value_type.

Referenced by lldb_private::ClangExpressionDeclMap::AddOneFunction(), lldb_private::ClangExpressionDeclMap::AddOneGenericVariable(), ConvertToLoadAddress(), lldb_private::FunctionCaller::FetchFunctionResults(), lldb_private::AppleObjCRuntimeV2::SharedCacheClassInfoExtractor::GetClassInfoUtilityFunctionImpl(), lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::GetClassInfoUtilityFunctionImpl(), lldb_private::AppleGetQueuesHandler::GetCurrentQueues(), lldb_private::AppleGetItemInfoHandler::GetItemInfo(), lldb_private::AppleGetPendingItemsHandler::GetPendingItems(), ABIMacOSX_arm64::GetReturnValueObjectImpl(), ABISysV_arm64::GetReturnValueObjectImpl(), ABISysV_mips64::GetReturnValueObjectImpl(), ABISysV_arc::GetReturnValueObjectImpl(), ABISysV_riscv::GetReturnValueObjectImpl(), ABISysV_arc::GetReturnValueObjectSimple(), ABISysV_ppc::GetReturnValueObjectSimple(), ABISysV_riscv::GetReturnValueObjectSimple(), ABISysV_s390x::GetReturnValueObjectSimple(), ABISysV_i386::GetReturnValueObjectSimple(), ABISysV_x86_64::GetReturnValueObjectSimple(), ABIWindows_x86_64::GetReturnValueObjectSimple(), lldb_private::AppleObjCTrampolineHandler::GetStepThroughDispatchPlan(), lldb_private::AppleGetThreadItemInfoHandler::GetThreadItemInfo(), GetValObjFromFPRegs(), GetValObjFromIntRegs(), lldb_private::ClangExpressionDeclMap::GetVariableValue(), lldb_private::ThreadPlanAssemblyTracer::Log(), lldb_private::PlatformWindows::MakeLoadImageUtilityFunction(), PlatformPOSIX::MakeLoadImageUtilityFunction(), DynamicLoaderMacOS::NotifyBreakpointHit(), DynamicLoaderMacOSXDYLD::NotifyBreakpointHit(), ReadRegisterValueAsScalar(), lldb_private::AbortWithPayloadFrameRecognizer::RecognizeFrame(), lldb_private::AppleObjCTrampolineHandler::AppleObjCVTables::RefreshTrampolines(), lldb_private::RegisterContextUnwind::SavedLocationForRegister(), SetContext(), lldb_private::AppleObjCRuntimeV2::SharedCacheClassInfoExtractor::UpdateISAToDescriptorMap(), lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::UpdateISAToDescriptorMap(), lldb_private::ValueObjectChild::UpdateValue(), lldb_private::ValueObjectDynamicValue::UpdateValue(), lldb_private::ValueObjectMemory::UpdateValue(), lldb_private::ValueObjectRegister::UpdateValue(), lldb_private::ValueObjectVTable::UpdateValue(), ValueObjectVTableChild::UpdateValue(), lldb_private::ValueObjectConstResult::ValueObjectConstResult(), and lldb_private::ValueObjectMemory::ValueObjectMemory().

◆ ValueOf()

bool Value::ValueOf ( ExecutionContext exe_ctx)

Definition at line 197 of file Value.cpp.

References Invalid, LLDBType, m_context_type, RegisterInfo, ResolveValue(), and Variable.

Member Data Documentation

◆ m_compiler_type

CompilerType lldb_private::Value::m_compiler_type
protected

Definition at line 152 of file Value.h.

Referenced by Clear(), GetCompilerType(), operator=(), and SetCompilerType().

◆ m_context

void* lldb_private::Value::m_context = nullptr
protected

◆ m_context_type

ContextType lldb_private::Value::m_context_type = ContextType::Invalid
protected

◆ m_data_buffer

DataBufferHeap lldb_private::Value::m_data_buffer
protected

◆ m_value

Scalar lldb_private::Value::m_value
protected

◆ m_value_type

ValueType lldb_private::Value::m_value_type = ValueType::Scalar
protected

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