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

#include <AppleObjCTrampolineHandler.h>

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

Classes

class  AppleObjCVTables
 
struct  DispatchFunction
 

Public Member Functions

 AppleObjCTrampolineHandler (const lldb::ProcessSP &process_sp, const lldb::ModuleSP &objc_module_sp)
 
 ~AppleObjCTrampolineHandler ()
 
lldb::ThreadPlanSP GetStepThroughDispatchPlan (Thread &thread, bool stop_others)
 
FunctionCallerGetLookupImplementationFunctionCaller ()
 
bool AddrIsMsgForward (lldb::addr_t addr) const
 
lldb::addr_t SetupDispatchFunction (Thread &thread, ValueList &dispatch_values)
 
const DispatchFunctionFindDispatchFunction (lldb::addr_t addr)
 
void ForEachDispatchFunction (std::function< void(lldb::addr_t, const DispatchFunction &)>)
 

Private Types

using MsgsendMap = std::map< lldb::addr_t, int >
 

Private Attributes

MsgsendMap m_msgSend_map
 
MsgsendMap m_opt_dispatch_map
 
lldb::ProcessWP m_process_wp
 
lldb::ModuleSP m_objc_module_sp
 
const char * m_lookup_implementation_function_code
 
std::unique_ptr< UtilityFunctionm_impl_code
 
std::mutex m_impl_function_mutex
 
lldb::addr_t m_impl_fn_addr
 
lldb::addr_t m_impl_stret_fn_addr
 
lldb::addr_t m_msg_forward_addr
 
lldb::addr_t m_msg_forward_stret_addr
 
std::unique_ptr< AppleObjCVTablesm_vtables_up
 

Static Private Attributes

static const char * g_lookup_implementation_function_name
 
static const char * g_lookup_implementation_with_stret_function_code
 
static const char * g_lookup_implementation_no_stret_function_code
 
static const DispatchFunction g_dispatch_functions []
 
static const char * g_opt_dispatch_names []
 

Detailed Description

Definition at line 21 of file AppleObjCTrampolineHandler.h.

Member Typedef Documentation

◆ MsgsendMap

Definition at line 140 of file AppleObjCTrampolineHandler.h.

Constructor & Destructor Documentation

◆ AppleObjCTrampolineHandler()

AppleObjCTrampolineHandler::AppleObjCTrampolineHandler ( const lldb::ProcessSP &  process_sp,
const lldb::ModuleSP &  objc_module_sp 
)

◆ ~AppleObjCTrampolineHandler()

AppleObjCTrampolineHandler::~AppleObjCTrampolineHandler ( )
default

Member Function Documentation

◆ AddrIsMsgForward()

bool lldb_private::AppleObjCTrampolineHandler::AddrIsMsgForward ( lldb::addr_t  addr) const
inline

◆ FindDispatchFunction()

const AppleObjCTrampolineHandler::DispatchFunction * AppleObjCTrampolineHandler::FindDispatchFunction ( lldb::addr_t  addr)

Definition at line 868 of file AppleObjCTrampolineHandler.cpp.

References g_dispatch_functions, and m_msgSend_map.

Referenced by GetStepThroughDispatchPlan().

◆ ForEachDispatchFunction()

void AppleObjCTrampolineHandler::ForEachDispatchFunction ( std::function< void(lldb::addr_t, const DispatchFunction &)>  )

◆ GetLookupImplementationFunctionCaller()

FunctionCaller * AppleObjCTrampolineHandler::GetLookupImplementationFunctionCaller ( )

◆ GetStepThroughDispatchPlan()

ThreadPlanSP AppleObjCTrampolineHandler::GetStepThroughDispatchPlan ( Thread thread,
bool  stop_others 
)

Definition at line 887 of file AppleObjCTrampolineHandler.cpp.

References lldb_private::Thread::CalculateProcess(), lldb_private::Thread::CalculateTarget(), lldb::eBasicTypeVoid, lldb::eDescriptionLevelFull, lldb::eEncodingSint, lldb_private::AppleObjCTrampolineHandler::DispatchFunction::eFixUpFixed, lldb_private::AppleObjCTrampolineHandler::DispatchFunction::eFixUpNone, lldb_private::AppleObjCTrampolineHandler::DispatchFunction::eFixUpToFix, lldb_private::AppleObjCTrampolineHandler::AppleObjCVTables::eOBJC_TRAMPOLINE_STRET, FindDispatchFunction(), lldb_private::AppleObjCTrampolineHandler::DispatchFunction::fixedup, g_opt_dispatch_names, lldb_private::ObjCLanguageRuntime::Get(), lldb_private::Process::GetAddressByteSize(), lldb_private::ABI::GetArgumentValues(), lldb_private::TypeSystemClang::GetBasicType(), lldb_private::TypeSystemClang::GetBuiltinTypeForEncodingAndBitSize(), lldb_private::StreamString::GetData(), lldb_private::ScratchTypeSystemClang::GetForTarget(), lldb_private::GetLogIfAllCategoriesSet(), lldb_private::CompilerType::GetPointerType(), lldb_private::Thread::GetProcess(), lldb_private::ExecutionContext::GetProcessPtr(), lldb_private::Thread::GetRegisterContext(), lldb_private::Value::GetScalar(), lldb_private::Thread::GetStackFrameAtIndex(), lldb_private::ValueList::GetValueAtIndex(), lldb_private::Log::GetVerbose(), lldb_private::AppleObjCTrampolineHandler::DispatchFunction::is_super, lldb_private::AppleObjCTrampolineHandler::DispatchFunction::is_super2, lldb_private::Scalar::IsValid(), LIBLLDB_LOG_STEP, LLDB_INVALID_ADDRESS, LLDB_LOGF, lldb_private::Value::LoadAddress, lldb_private::ObjCLanguageRuntime::LookupInMethodCache(), m_opt_dispatch_map, m_vtables_up, lldb_private::ValueList::PushValue(), lldb_private::Value::ResolveValue(), lldb_private::Value::Scalar, lldb_private::Value::SetCompilerType(), lldb_private::Value::SetValueType(), lldb_private::AppleObjCTrampolineHandler::DispatchFunction::stret_return, lldb_private::Scalar::ULongLong(), and arm64_dwarf::x0.

◆ SetupDispatchFunction()

lldb::addr_t AppleObjCTrampolineHandler::SetupDispatchFunction ( Thread thread,
ValueList dispatch_values 
)

Member Data Documentation

◆ g_dispatch_functions

const AppleObjCTrampolineHandler::DispatchFunction AppleObjCTrampolineHandler::g_dispatch_functions
staticprivate

◆ g_lookup_implementation_function_name

const char * AppleObjCTrampolineHandler::g_lookup_implementation_function_name
staticprivate
Initial value:
=
"__lldb_objc_find_implementation_for_selector"

Definition at line 55 of file AppleObjCTrampolineHandler.h.

Referenced by SetupDispatchFunction().

◆ g_lookup_implementation_no_stret_function_code

const char * AppleObjCTrampolineHandler::g_lookup_implementation_no_stret_function_code
staticprivate

Definition at line 57 of file AppleObjCTrampolineHandler.h.

Referenced by AppleObjCTrampolineHandler().

◆ g_lookup_implementation_with_stret_function_code

const char* lldb_private::AppleObjCTrampolineHandler::g_lookup_implementation_with_stret_function_code
staticprivate

Definition at line 56 of file AppleObjCTrampolineHandler.h.

Referenced by AppleObjCTrampolineHandler().

◆ g_opt_dispatch_names

const char * AppleObjCTrampolineHandler::g_opt_dispatch_names
staticprivate
Initial value:
= {
"objc_alloc",
"objc_autorelease",
"objc_release",
"objc_retain",
"objc_alloc_init",
"objc_allocWithZone",
"objc_opt_class",
"objc_opt_isKindOfClass",
"objc_opt_new",
"objc_opt_respondsToSelector",
"objc_opt_self",
}

Definition at line 138 of file AppleObjCTrampolineHandler.h.

Referenced by AppleObjCTrampolineHandler(), and GetStepThroughDispatchPlan().

◆ m_impl_code

std::unique_ptr<UtilityFunction> lldb_private::AppleObjCTrampolineHandler::m_impl_code
private

◆ m_impl_fn_addr

lldb::addr_t lldb_private::AppleObjCTrampolineHandler::m_impl_fn_addr
private

Definition at line 150 of file AppleObjCTrampolineHandler.h.

Referenced by AppleObjCTrampolineHandler().

◆ m_impl_function_mutex

std::mutex lldb_private::AppleObjCTrampolineHandler::m_impl_function_mutex
private

Definition at line 149 of file AppleObjCTrampolineHandler.h.

Referenced by SetupDispatchFunction().

◆ m_impl_stret_fn_addr

lldb::addr_t lldb_private::AppleObjCTrampolineHandler::m_impl_stret_fn_addr
private

Definition at line 151 of file AppleObjCTrampolineHandler.h.

Referenced by AppleObjCTrampolineHandler().

◆ m_lookup_implementation_function_code

const char* lldb_private::AppleObjCTrampolineHandler::m_lookup_implementation_function_code
private

◆ m_msg_forward_addr

lldb::addr_t lldb_private::AppleObjCTrampolineHandler::m_msg_forward_addr
private

Definition at line 152 of file AppleObjCTrampolineHandler.h.

Referenced by AddrIsMsgForward(), and AppleObjCTrampolineHandler().

◆ m_msg_forward_stret_addr

lldb::addr_t lldb_private::AppleObjCTrampolineHandler::m_msg_forward_stret_addr
private

Definition at line 153 of file AppleObjCTrampolineHandler.h.

Referenced by AddrIsMsgForward(), and AppleObjCTrampolineHandler().

◆ m_msgSend_map

MsgsendMap lldb_private::AppleObjCTrampolineHandler::m_msgSend_map
private

◆ m_objc_module_sp

lldb::ModuleSP lldb_private::AppleObjCTrampolineHandler::m_objc_module_sp
private

◆ m_opt_dispatch_map

MsgsendMap lldb_private::AppleObjCTrampolineHandler::m_opt_dispatch_map
private

◆ m_process_wp

lldb::ProcessWP lldb_private::AppleObjCTrampolineHandler::m_process_wp
private

Definition at line 145 of file AppleObjCTrampolineHandler.h.

Referenced by AppleObjCTrampolineHandler().

◆ m_vtables_up

std::unique_ptr<AppleObjCVTables> lldb_private::AppleObjCTrampolineHandler::m_vtables_up
private

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