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, objc_copyRealizedClassList or objc_getRealizedClassList_trylock. More...

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

Classes

struct  UtilityFunctionHelper
 

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 , objc_getRealizedClassList_trylock }
 

Private Member Functions

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

Private Attributes

UtilityFunctionHelper m_gdb_objc_realized_classes_helper
 
UtilityFunctionHelper m_objc_copyRealizedClassList_helper
 
UtilityFunctionHelper m_objc_getRealizedClassList_trylock_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.
 
std::mutex m_mutex
 

Detailed Description

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

The RealizedClassList variants are preferred because they include lazily named classes, but they are not always available or safe to call.

We potentially need more than one helper 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 or objc_getRealizedClassList_trylock for lazily named classes.

Definition at line 330 of file AppleObjCRuntimeV2.h.

Member Enumeration Documentation

◆ Helper

Enumerator
gdb_objc_realized_classes 
objc_copyRealizedClassList 
objc_getRealizedClassList_trylock 

Definition at line 339 of file AppleObjCRuntimeV2.h.

Constructor & Destructor Documentation

◆ DynamicClassInfoExtractor()

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

Definition at line 332 of file AppleObjCRuntimeV2.h.

Member Function Documentation

◆ ComputeHelper()

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

Compute which helper to use.

If dyld is not yet fully initialized we must use gdb_objc_realized_classes. Otherwise, we prefer objc_getRealizedClassList_trylock and objc_copyRealizedClassList respectively, depending on availability.

Definition at line 1861 of file AppleObjCRuntimeV2.cpp.

References lldb_private::eDynamicClassInfoHelperAuto, lldb_private::eDynamicClassInfoHelperCopyRealizedClassList, lldb_private::eDynamicClassInfoHelperGetRealizedClassList, lldb_private::eDynamicClassInfoHelperRealizedClassesStruct, gdb_objc_realized_classes, lldb_private::TargetProperties::GetDynamicClassInfoHelper(), lldb_private::ExecutionContext::GetTargetRef(), objc_copyRealizedClassList, and objc_getRealizedClassList_trylock.

◆ GetClassInfoArgs()

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

Definition at line 1848 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,
Helper  helper,
std::string  code,
std::string  name 
)
private

◆ UpdateISAToDescriptorMap()

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

Definition at line 1989 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::Process::GetByteOrder(), lldb_private::WritableDataBuffer::GetBytes(), lldb_private::DataBufferHeap::GetByteSize(), RemoteNXMapTable::GetCount(), lldb_private::ThreadList::GetExpressionExecutionThread(), lldb_private::ScratchTypeSystemClang::GetForTarget(), lldb_private::UtilityFunction::GetFunctionCaller(), lldb_private::GetLog(), 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(), LLDB_INVALID_ADDRESS, LLDB_LOG, LLDB_LOGF, lldb_private::Process, lldb_private::Process::ReadMemory(), lldb_private::AppleObjCRuntimeV2::DescriptorMapUpdateResult::Retry(), 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::Types, lldb_private::Scalar::ULong(), and lldb_private::FunctionCaller::WriteFunctionArguments().

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

Member Data Documentation

◆ m_gdb_objc_realized_classes_helper

UtilityFunctionHelper lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::m_gdb_objc_realized_classes_helper
private

Definition at line 364 of file AppleObjCRuntimeV2.h.

◆ m_objc_copyRealizedClassList_helper

UtilityFunctionHelper lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::m_objc_copyRealizedClassList_helper
private

Definition at line 365 of file AppleObjCRuntimeV2.h.

◆ m_objc_getRealizedClassList_trylock_helper

UtilityFunctionHelper lldb_private::AppleObjCRuntimeV2::DynamicClassInfoExtractor::m_objc_getRealizedClassList_trylock_helper
private

Definition at line 366 of file AppleObjCRuntimeV2.h.


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