LLDB  mainline
Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor Class Reference

We can read the class info from the Objective-C runtime using gdb_objc_realized_classes or objc_copyRealizedClassList. More...

Inheritance diagram for lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor:
Inheritance graph
[legend]
Collaboration diagram for lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor:
Collaboration graph
[legend]

Classes

struct  gdb_objc_realized_classes_helper
 Helper to read class info using the gdb_objc_realized_classes. More...
 
struct  objc_copyRealizedClassList_helper
 Helper to read class info using objc_copyRealizedClassList. More...
 

Public Member Functions

 DynamicClassInfoExtractor (AppleObjCRuntimeV2 &runtime)
 
DescriptorMapUpdateResult UpdateISAToDescriptorMap (RemoteNXMapTable &hash_table)
 
- Public Member Functions inherited from lldb_private::AppleObjCRuntimeV2::ClassInfoExtractor
 ClassInfoExtractor (AppleObjCRuntimeV2 &runtime)
 
std::mutex & GetMutex ()
 

Private Types

enum  Helper { gdb_objc_realized_classes, objc_copyRealizedClassList }
 

Private Member Functions

Helper ComputeHelper () const
 Compute which helper to use. More...
 
UtilityFunctionGetClassInfoUtilityFunction (ExecutionContext &exe_ctx, Helper helper)
 
lldb::addr_tGetClassInfoArgs (Helper helper)
 
std::unique_ptr< UtilityFunctionGetClassInfoUtilityFunctionImpl (ExecutionContext &exe_ctx, std::string code, std::string name)
 

Private Attributes

gdb_objc_realized_classes_helper m_gdb_objc_realized_classes_helper
 
objc_copyRealizedClassList_helper m_objc_copyRealizedClassList_helper
 

Additional Inherited Members

- Protected Attributes inherited from lldb_private::AppleObjCRuntimeV2::ClassInfoExtractor
AppleObjCRuntimeV2m_runtime
 The lifetime of this object is tied to that of the runtime. More...
 
std::mutex m_mutex
 

Detailed Description

We can read the class info from the Objective-C runtime using gdb_objc_realized_classes or objc_copyRealizedClassList.

The latter is preferred because it includes lazily named classes, but it's not always available or safe to call.

We potentially need both for the same process, because we may need to use gdb_objc_realized_classes until dyld is initialized and then switch over to objc_copyRealizedClassList for lazily named classes.

Definition at line 325 of file AppleObjCRuntimeV2.h.

Member Enumeration Documentation

◆ Helper

Enumerator
gdb_objc_realized_classes 
objc_copyRealizedClassList 

Definition at line 334 of file AppleObjCRuntimeV2.h.

Constructor & Destructor Documentation

◆ DynamicClassInfoExtractor()

lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::DynamicClassInfoExtractor ( AppleObjCRuntimeV2 runtime)
inline

Definition at line 327 of file AppleObjCRuntimeV2.h.

Member Function Documentation

◆ ComputeHelper()

AppleObjCRuntimeV2::DynamicClassInfoExtractor::Helper AppleObjCRuntimeV2::DynamicClassInfoExtractor::ComputeHelper ( ) const
private

Compute which helper to use.

Prefer objc_copyRealizedClassList if it's available and it's safe to call (i.e. dyld is fully initialized). Use gdb_objc_realized_classes otherwise.

Definition at line 1614 of file AppleObjCRuntimeV2.cpp.

References gdb_objc_realized_classes, and objc_copyRealizedClassList.

◆ GetClassInfoArgs()

lldb::addr_t & AppleObjCRuntimeV2::DynamicClassInfoExtractor::GetClassInfoArgs ( Helper  helper)
private

Definition at line 1603 of file AppleObjCRuntimeV2.cpp.

◆ GetClassInfoUtilityFunction()

UtilityFunction * AppleObjCRuntimeV2::DynamicClassInfoExtractor::GetClassInfoUtilityFunction ( ExecutionContext exe_ctx,
Helper  helper 
)
private

◆ GetClassInfoUtilityFunctionImpl()

std::unique_ptr< UtilityFunction > AppleObjCRuntimeV2::DynamicClassInfoExtractor::GetClassInfoUtilityFunctionImpl ( ExecutionContext exe_ctx,
std::string  code,
std::string  name 
)
private

◆ UpdateISAToDescriptorMap()

AppleObjCRuntimeV2::DescriptorMapUpdateResult AppleObjCRuntimeV2::DynamicClassInfoExtractor::UpdateISAToDescriptorMap ( RemoteNXMapTable hash_table)

Definition at line 1726 of file AppleObjCRuntimeV2.cpp.

References lldb_private::Process::AllocateMemory(), lldb_private::DiagnosticManager::Clear(), lldb_private::Process::DeallocateMemory(), lldb_private::DiagnosticManager::Dump(), lldb::eEncodingUint, lldb::eExpressionCompleted, lldb_private::FunctionCaller::ExecuteFunction(), lldb_private::AppleObjCRuntimeV2::DescriptorMapUpdateResult::Fail(), gdb_objc_realized_classes, lldb_private::Process::GetAddressByteSize(), lldb_private::FunctionCaller::GetArgumentValues(), lldb_private::TypeSystemClang::GetBuiltinTypeForEncodingAndBitSize(), lldb_private::Process::GetByteOrder(), lldb_private::DataBufferHeap::GetBytes(), lldb_private::DataBufferHeap::GetByteSize(), RemoteNXMapTable::GetCount(), lldb_private::ThreadList::GetExpressionExecutionThread(), lldb_private::ScratchTypeSystemClang::GetForTarget(), lldb_private::UtilityFunction::GetFunctionCaller(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::GetLogIfAnyCategoriesSet(), lldb_private::Value::GetScalar(), RemoteNXMapTable::GetTableLoadAddress(), lldb_private::Process::GetTarget(), lldb_private::Process::GetThreadList(), lldb_private::ProcessProperties::GetUtilityExpressionTimeout(), lldb_private::ValueList::GetValueAtIndex(), lldb_private::Log::GetVerbose(), LIBLLDB_LOG_PROCESS, LIBLLDB_LOG_TYPES, LLDB_INVALID_ADDRESS, LLDB_LOG, LLDB_LOGF, lldb_private::Process::ReadMemory(), lldb_private::Value::Scalar, lldb_private::Value::SetCompilerType(), lldb_private::EvaluateExpressionOptions::SetIgnoreBreakpoints(), lldb_private::EvaluateExpressionOptions::SetIsForUtilityExpr(), lldb_private::EvaluateExpressionOptions::SetStopOthers(), lldb_private::EvaluateExpressionOptions::SetTimeout(), lldb_private::EvaluateExpressionOptions::SetTryAllThreads(), lldb_private::EvaluateExpressionOptions::SetUnwindOnError(), lldb_private::Value::SetValueType(), lldb_private::AppleObjCRuntimeV2::DescriptorMapUpdateResult::Success(), lldb_private::Scalar::ULong(), and lldb_private::FunctionCaller::WriteFunctionArguments().

Referenced by lldb_private::AppleObjCRuntimeV2::UpdateISAToDescriptorMapIfNeeded().

Member Data Documentation

◆ m_gdb_objc_realized_classes_helper

gdb_objc_realized_classes_helper lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::m_gdb_objc_realized_classes_helper
private

Definition at line 361 of file AppleObjCRuntimeV2.h.

◆ m_objc_copyRealizedClassList_helper

objc_copyRealizedClassList_helper lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::m_objc_copyRealizedClassList_helper
private

Definition at line 362 of file AppleObjCRuntimeV2.h.


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