LLDB mainline
Classes | Public Member Functions | Static Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
SystemRuntimeMacOSX Class Reference

#include <SystemRuntimeMacOSX.h>

Inheritance diagram for SystemRuntimeMacOSX:
Inheritance graph
[legend]

Classes

struct  ItemInfo
 
struct  ItemRefAndCodeAddress
 
struct  libBacktraceRecording_info
 
struct  LibdispatchOffsets
 
struct  LibdispatchTSDIndexes
 
struct  LibdispatchVoucherOffsets
 
struct  LibpthreadOffsets
 
struct  PendingItemsForQueue
 

Public Member Functions

 SystemRuntimeMacOSX (lldb_private::Process *process)
 
 ~SystemRuntimeMacOSX () override
 
void Clear (bool clear_process)
 
void Detach () override
 Called before detaching from a process.
 
const std::vector< lldb_private::ConstString > & GetExtendedBacktraceTypes () override
 Return a list of thread origin extended backtraces that may be available.
 
lldb::ThreadSP GetExtendedBacktraceThread (lldb::ThreadSP thread, lldb_private::ConstString type) override
 Return a Thread which shows the origin of this thread's creation.
 
lldb::ThreadSP GetExtendedBacktraceForQueueItem (lldb::QueueItemSP queue_item_sp, lldb_private::ConstString type) override
 Get the extended backtrace thread for a QueueItem.
 
lldb::ThreadSP GetExtendedBacktraceFromItemRef (lldb::addr_t item_ref)
 
void PopulateQueueList (lldb_private::QueueList &queue_list) override
 Populate the Process' QueueList with libdispatch / GCD queues that exist.
 
void PopulateQueuesUsingLibBTR (lldb::addr_t queues_buffer, uint64_t queues_buffer_size, uint64_t count, lldb_private::QueueList &queue_list)
 
void PopulatePendingQueuesUsingLibBTR (lldb::addr_t items_buffer, uint64_t items_buffer_size, uint64_t count, lldb_private::Queue *queue)
 
std::string GetQueueNameFromThreadQAddress (lldb::addr_t dispatch_qaddr) override
 Get the queue name for a thread given a thread's dispatch_qaddr.
 
lldb::queue_id_t GetQueueIDFromThreadQAddress (lldb::addr_t dispatch_qaddr) override
 Get the QueueID for the libdispatch queue given the thread's dispatch_qaddr.
 
lldb::addr_t GetLibdispatchQueueAddressFromThreadQAddress (lldb::addr_t dispatch_qaddr) override
 Get the libdispatch_queue_t address for the queue given the thread's dispatch_qaddr.
 
void PopulatePendingItemsForQueue (lldb_private::Queue *queue) override
 Get the pending work items for a libdispatch Queue.
 
void CompleteQueueItem (lldb_private::QueueItem *queue_item, lldb::addr_t item_ref) override
 Complete the fields in a QueueItem.
 
lldb::QueueKind GetQueueKind (lldb::addr_t dispatch_queue_addr) override
 Retrieve the Queue kind for the queue at a thread's dispatch_qaddr.
 
void AddThreadExtendedInfoPacketHints (lldb_private::StructuredData::ObjectSP dict) override
 Add key-value pairs to the StructuredData dictionary object with information debugserver may need when constructing the jThreadExtendedInfo packet.
 
bool SafeToCallFunctionsOnThisThread (lldb::ThreadSP thread_sp) override
 Determine whether it is safe to run an expression on a given thread.
 
llvm::StringRef GetPluginName () override
 
- Public Member Functions inherited from lldb_private::SystemRuntime
 SystemRuntime (Process *process)
 Construct with a process.
 
 ~SystemRuntime () override
 Destructor.
 
virtual void DidAttach ()
 Called after attaching to a process.
 
virtual void DidLaunch ()
 Called after launching a process.
 
void ModulesDidLoad (const ModuleList &module_list) override
 Called when modules have been loaded in the process.
 
virtual void Detach ()
 Called before detaching from a process.
 
virtual const std::vector< ConstString > & GetExtendedBacktraceTypes ()
 Return a list of thread origin extended backtraces that may be available.
 
virtual lldb::ThreadSP GetExtendedBacktraceThread (lldb::ThreadSP thread, ConstString type)
 Return a Thread which shows the origin of this thread's creation.
 
virtual lldb::ThreadSP GetExtendedBacktraceForQueueItem (lldb::QueueItemSP queue_item_sp, ConstString type)
 Get the extended backtrace thread for a QueueItem.
 
virtual void PopulateQueueList (lldb_private::QueueList &queue_list)
 Populate the Process' QueueList with libdispatch / GCD queues that exist.
 
virtual std::string GetQueueNameFromThreadQAddress (lldb::addr_t dispatch_qaddr)
 Get the queue name for a thread given a thread's dispatch_qaddr.
 
virtual lldb::queue_id_t GetQueueIDFromThreadQAddress (lldb::addr_t dispatch_qaddr)
 Get the QueueID for the libdispatch queue given the thread's dispatch_qaddr.
 
virtual lldb::addr_t GetLibdispatchQueueAddressFromThreadQAddress (lldb::addr_t dispatch_qaddr)
 Get the libdispatch_queue_t address for the queue given the thread's dispatch_qaddr.
 
virtual lldb::QueueKind GetQueueKind (lldb::addr_t dispatch_qaddr)
 Retrieve the Queue kind for the queue at a thread's dispatch_qaddr.
 
virtual void PopulatePendingItemsForQueue (lldb_private::Queue *queue)
 Get the pending work items for a libdispatch Queue.
 
virtual void CompleteQueueItem (lldb_private::QueueItem *queue_item, lldb::addr_t item_ref)
 Complete the fields in a QueueItem.
 
virtual void AddThreadExtendedInfoPacketHints (lldb_private::StructuredData::ObjectSP dict)
 Add key-value pairs to the StructuredData dictionary object with information debugserver may need when constructing the jThreadExtendedInfo packet.
 
virtual bool SafeToCallFunctionsOnThisThread (lldb::ThreadSP thread_sp)
 Determine whether it is safe to run an expression on a given thread.
 
- Public Member Functions inherited from lldb_private::Runtime
 Runtime (Process *process)
 
virtual ~Runtime ()=default
 
 Runtime (const Runtime &)=delete
 
const Runtimeoperator= (const Runtime &)=delete
 
ProcessGetProcess ()
 
TargetGetTargetRef ()
 
virtual void ModulesDidLoad (const ModuleList &module_list)=0
 Called when modules have been loaded in the process.
 
- Public Member Functions inherited from lldb_private::PluginInterface
 PluginInterface ()=default
 
virtual ~PluginInterface ()=default
 
virtual llvm::StringRef GetPluginName ()=0
 
 PluginInterface (const PluginInterface &)=delete
 
PluginInterfaceoperator= (const PluginInterface &)=delete
 

Static Public Member Functions

static void Initialize ()
 
static void Terminate ()
 
static llvm::StringRef GetPluginNameStatic ()
 
static lldb_private::SystemRuntimeCreateInstance (lldb_private::Process *process)
 
- Static Public Member Functions inherited from lldb_private::SystemRuntime
static SystemRuntimeFindPlugin (Process *process)
 Find a system runtime plugin for a given process.
 

Protected Attributes

lldb::user_id_t m_break_id
 
std::recursive_mutex m_mutex
 
- Protected Attributes inherited from lldb_private::SystemRuntime
std::vector< ConstStringm_types
 
- Protected Attributes inherited from lldb_private::Runtime
Processm_process
 

Private Member Functions

bool BacktraceRecordingHeadersInitialized ()
 
void ReadLibdispatchOffsetsAddress ()
 
void ReadLibdispatchOffsets ()
 
void ReadLibpthreadOffsetsAddress ()
 
void ReadLibpthreadOffsets ()
 
void ReadLibdispatchTSDIndexesAddress ()
 
void ReadLibdispatchTSDIndexes ()
 
PendingItemsForQueue GetPendingItemRefsForQueue (lldb::addr_t queue)
 
ItemInfo ExtractItemInfoFromBuffer (lldb_private::DataExtractor &extractor)
 
 SystemRuntimeMacOSX (const SystemRuntimeMacOSX &)=delete
 
const SystemRuntimeMacOSXoperator= (const SystemRuntimeMacOSX &)=delete
 

Private Attributes

lldb_private::AppleGetQueuesHandler m_get_queues_handler
 
lldb_private::AppleGetPendingItemsHandler m_get_pending_items_handler
 
lldb_private::AppleGetItemInfoHandler m_get_item_info_handler
 
lldb_private::AppleGetThreadItemInfoHandler m_get_thread_item_info_handler
 
lldb::addr_t m_page_to_free
 
uint64_t m_page_to_free_size
 
libBacktraceRecording_info m_lib_backtrace_recording_info
 
lldb::addr_t m_dispatch_queue_offsets_addr
 
struct LibdispatchOffsets m_libdispatch_offsets
 
lldb::addr_t m_libpthread_layout_offsets_addr
 
struct LibpthreadOffsets m_libpthread_offsets
 
lldb::addr_t m_dispatch_tsd_indexes_addr
 
struct LibdispatchTSDIndexes m_libdispatch_tsd_indexes
 
lldb::addr_t m_dispatch_voucher_offsets_addr
 
struct LibdispatchVoucherOffsets m_libdispatch_voucher_offsets
 

Detailed Description

Definition at line 31 of file SystemRuntimeMacOSX.h.

Constructor & Destructor Documentation

◆ SystemRuntimeMacOSX() [1/2]

SystemRuntimeMacOSX::SystemRuntimeMacOSX ( lldb_private::Process process)

◆ ~SystemRuntimeMacOSX()

SystemRuntimeMacOSX::~SystemRuntimeMacOSX ( )
override

Definition at line 100 of file SystemRuntimeMacOSX.cpp.

References Clear().

◆ SystemRuntimeMacOSX() [2/2]

SystemRuntimeMacOSX::SystemRuntimeMacOSX ( const SystemRuntimeMacOSX )
privatedelete

Member Function Documentation

◆ AddThreadExtendedInfoPacketHints()

void SystemRuntimeMacOSX::AddThreadExtendedInfoPacketHints ( lldb_private::StructuredData::ObjectSP  dict)
overridevirtual

◆ BacktraceRecordingHeadersInitialized()

bool SystemRuntimeMacOSX::BacktraceRecordingHeadersInitialized ( )
private

◆ Clear()

void SystemRuntimeMacOSX::Clear ( bool  clear_process)

◆ CompleteQueueItem()

void SystemRuntimeMacOSX::CompleteQueueItem ( lldb_private::QueueItem queue_item,
lldb::addr_t  item_ref 
)
overridevirtual

Complete the fields in a QueueItem.

PopulatePendingItemsForQueue() may not fill in all of the QueueItem details; when the remaining fields are needed, they will be fetched by call this method.

Parameters
[in]queue_itemThe QueueItem that we will be completing.
[in]item_refThe item_ref token that is needed to retrieve the rest of the information about the QueueItem.

Reimplemented from lldb_private::SystemRuntime.

Definition at line 889 of file SystemRuntimeMacOSX.cpp.

References SystemRuntimeMacOSX::ItemInfo::enqueuing_callstack, SystemRuntimeMacOSX::ItemInfo::enqueuing_queue_label, SystemRuntimeMacOSX::ItemInfo::enqueuing_queue_serialnum, SystemRuntimeMacOSX::ItemInfo::enqueuing_thread_id, SystemRuntimeMacOSX::ItemInfo::enqueuing_thread_label, error(), ExtractItemInfoFromBuffer(), lldb_private::Process::GetAddressByteSize(), lldb_private::Process::GetByteOrder(), lldb_private::WritableDataBuffer::GetBytes(), lldb_private::DataBufferHeap::GetByteSize(), lldb_private::ThreadList::GetExpressionExecutionThread(), lldb_private::AppleGetItemInfoHandler::GetItemInfo(), lldb_private::Process::GetThreadList(), lldb_private::AppleGetItemInfoHandler::GetItemInfoReturnInfo::item_buffer_ptr, lldb_private::AppleGetItemInfoHandler::GetItemInfoReturnInfo::item_buffer_size, SystemRuntimeMacOSX::ItemInfo::item_that_enqueued_this, LLDB_INVALID_ADDRESS, m_get_item_info_handler, m_page_to_free, m_page_to_free_size, lldb_private::Runtime::m_process, lldb_private::Process::ReadMemory(), lldb_private::QueueItem::SetEnqueueingBacktrace(), lldb_private::QueueItem::SetEnqueueingQueueID(), lldb_private::QueueItem::SetEnqueueingThreadID(), lldb_private::QueueItem::SetItemThatEnqueuedThis(), lldb_private::QueueItem::SetQueueLabel(), lldb_private::QueueItem::SetStopID(), lldb_private::QueueItem::SetTargetQueueLabel(), lldb_private::QueueItem::SetThreadLabel(), SystemRuntimeMacOSX::ItemInfo::stop_id, and SystemRuntimeMacOSX::ItemInfo::target_queue_label.

◆ CreateInstance()

SystemRuntime * SystemRuntimeMacOSX::CreateInstance ( lldb_private::Process process)
static

◆ Detach()

void SystemRuntimeMacOSX::Detach ( )
overridevirtual

Called before detaching from a process.

This will give a SystemRuntime plugin a chance to free any resources in the inferior process before we detach.

Reimplemented from lldb_private::SystemRuntime.

Definition at line 102 of file SystemRuntimeMacOSX.cpp.

References lldb_private::AppleGetItemInfoHandler::Detach(), lldb_private::AppleGetPendingItemsHandler::Detach(), lldb_private::AppleGetQueuesHandler::Detach(), lldb_private::AppleGetThreadItemInfoHandler::Detach(), m_get_item_info_handler, m_get_pending_items_handler, m_get_queues_handler, and m_get_thread_item_info_handler.

◆ ExtractItemInfoFromBuffer()

SystemRuntimeMacOSX::ItemInfo SystemRuntimeMacOSX::ExtractItemInfoFromBuffer ( lldb_private::DataExtractor extractor)
private

◆ GetExtendedBacktraceForQueueItem()

ThreadSP SystemRuntimeMacOSX::GetExtendedBacktraceForQueueItem ( lldb::QueueItemSP  queue_item_sp,
lldb_private::ConstString  type 
)
overridevirtual

Get the extended backtrace thread for a QueueItem.

A QueueItem represents a function/block that will be executed on a libdispatch queue in the future, or it represents a function/block that is currently executing on a thread.

This method will report a thread backtrace of the function that enqueued it originally, if possible.

Parameters
[in]queue_item_spThe QueueItem that we are getting an extended backtrace for.
[in]typeThe type of extended backtrace to fetch. The types supported are returned from SystemRuntime::GetExtendedBacktraceTypes.
Returns
If an extended backtrace is available, it is returned. Else an empty ThreadSP is returned.

Reimplemented from lldb_private::SystemRuntime.

Definition at line 593 of file SystemRuntimeMacOSX.cpp.

References lldb_private::Runtime::m_process.

◆ GetExtendedBacktraceFromItemRef()

ThreadSP SystemRuntimeMacOSX::GetExtendedBacktraceFromItemRef ( lldb::addr_t  item_ref)

◆ GetExtendedBacktraceThread()

ThreadSP SystemRuntimeMacOSX::GetExtendedBacktraceThread ( lldb::ThreadSP  thread,
lldb_private::ConstString  type 
)
overridevirtual

Return a Thread which shows the origin of this thread's creation.

This likely returns a HistoryThread which shows how thread was originally created (e.g. "pthread" type), or how the work that is currently executing on it was originally enqueued (e.g. "libdispatch" type).

There may be a chain of thread-origins; it may be informative to the end user to query the returned ThreadSP for its origins as well.

Parameters
[in]threadThe thread to examine.
[in]typeThe type of thread origin being requested. The types supported are returned from SystemRuntime::GetExtendedBacktraceTypes.
Returns
A ThreadSP which will have a StackList of frames. This Thread will not appear in the Process' list of current threads. Normal thread operations like stepping will not be available. This is a historical view thread and may be only useful for showing a backtrace.

An empty ThreadSP will be returned if no thread origin is available.

Reimplemented from lldb_private::SystemRuntime.

Definition at line 462 of file SystemRuntimeMacOSX.cpp.

References lldb_private::ConstString::AsCString(), BacktraceRecordingHeadersInitialized(), SystemRuntimeMacOSX::ItemInfo::enqueuing_callstack, SystemRuntimeMacOSX::ItemInfo::enqueuing_queue_label, SystemRuntimeMacOSX::ItemInfo::enqueuing_queue_serialnum, SystemRuntimeMacOSX::ItemInfo::enqueuing_thread_id, error(), ExtractItemInfoFromBuffer(), lldb_private::StructuredData::Array::ForEach(), lldb_private::Process::GetAddressByteSize(), lldb_private::StructuredData::Object::GetAsArray(), lldb_private::StructuredData::Object::GetAsDictionary(), lldb_private::Process::GetByteOrder(), lldb_private::WritableDataBuffer::GetBytes(), lldb_private::DataBufferHeap::GetByteSize(), lldb_private::ThreadList::GetExpressionExecutionThread(), GetExtendedBacktraceFromItemRef(), lldb_private::StructuredData::Array::GetSize(), lldb_private::AppleGetThreadItemInfoHandler::GetThreadItemInfo(), lldb_private::Process::GetThreadList(), lldb_private::StructuredData::Dictionary::GetValueForKeyAsInteger(), lldb_private::AppleGetThreadItemInfoHandler::GetThreadItemInfoReturnInfo::item_buffer_ptr, lldb_private::AppleGetThreadItemInfoHandler::GetThreadItemInfoReturnInfo::item_buffer_size, SystemRuntimeMacOSX::ItemInfo::item_that_enqueued_this, LLDB_INVALID_ADDRESS, m_get_thread_item_info_handler, m_page_to_free, m_page_to_free_size, lldb_private::Runtime::m_process, pc, and lldb_private::Process::ReadMemory().

◆ GetExtendedBacktraceTypes()

const std::vector< ConstString > & SystemRuntimeMacOSX::GetExtendedBacktraceTypes ( )
overridevirtual

Return a list of thread origin extended backtraces that may be available.

A System Runtime may be able to provide a backtrace of when this thread was originally created. Furthermore, it may be able to provide that extended backtrace for different styles of creation. On a system with both pthreads and libdispatch, aka Grand Central Dispatch, queues, the system runtime may be able to provide the pthread creation of the thread and it may also be able to provide the backtrace of when this GCD queue work block was enqueued. The caller may request these different origins by name.

The names will be provided in the order that they are most likely to be requested. For instance, a most natural order may be to request the GCD libdispatch queue origin. If there is none, then request the pthread origin.

Returns
A vector of ConstStrings with names like "pthread" or "libdispatch". An empty vector may be returned if no thread origin extended backtrace capabilities are available.

Reimplemented from lldb_private::SystemRuntime.

Definition at line 719 of file SystemRuntimeMacOSX.cpp.

References lldb_private::SystemRuntime::m_types.

◆ GetLibdispatchQueueAddressFromThreadQAddress()

lldb::addr_t SystemRuntimeMacOSX::GetLibdispatchQueueAddressFromThreadQAddress ( lldb::addr_t  dispatch_qaddr)
overridevirtual

Get the libdispatch_queue_t address for the queue given the thread's dispatch_qaddr.

On systems using libdispatch queues, a thread may be associated with a queue. There will be a call to get the thread's dispatch_qaddr. Given the thread's dispatch_qaddr, find the libdispatch_queue_t address and return it.

Parameters
[in]dispatch_qaddrThe address of the dispatch_qaddr pointer for this thread.
Returns
The libdispatch_queue_t address, or LLDB_INVALID_ADDRESS if unavailable/not found.

Reimplemented from lldb_private::SystemRuntime.

Definition at line 164 of file SystemRuntimeMacOSX.cpp.

References error(), LLDB_INVALID_ADDRESS, lldb_private::Runtime::m_process, and lldb_private::Process::ReadPointerFromMemory().

◆ GetPendingItemRefsForQueue()

SystemRuntimeMacOSX::PendingItemsForQueue SystemRuntimeMacOSX::GetPendingItemRefsForQueue ( lldb::addr_t  queue)
private

◆ GetPluginName()

llvm::StringRef SystemRuntimeMacOSX::GetPluginName ( )
inlineoverridevirtual

Implements lldb_private::PluginInterface.

Definition at line 101 of file SystemRuntimeMacOSX.h.

References GetPluginNameStatic().

◆ GetPluginNameStatic()

static llvm::StringRef SystemRuntimeMacOSX::GetPluginNameStatic ( )
inlinestatic

Definition at line 42 of file SystemRuntimeMacOSX.h.

Referenced by GetPluginName(), and Initialize().

◆ GetQueueIDFromThreadQAddress()

lldb::queue_id_t SystemRuntimeMacOSX::GetQueueIDFromThreadQAddress ( lldb::addr_t  dispatch_qaddr)
overridevirtual

Get the QueueID for the libdispatch queue given the thread's dispatch_qaddr.

On systems using libdispatch queues, a thread may be associated with a queue. There will be a call to get the thread's dispatch_qaddr. At the dispatch_qaddr we will find the address of this thread's dispatch_queue_t structure. Given the address of the dispatch_queue_t structure for a thread, get the queue ID and return it.

Parameters
[in]dispatch_qaddrThe address of the dispatch_qaddr pointer for this thread.
Returns
The queue ID, or if it could not be retrieved, LLDB_INVALID_QUEUE_ID.

Reimplemented from lldb_private::SystemRuntime.

Definition at line 241 of file SystemRuntimeMacOSX.cpp.

References SystemRuntimeMacOSX::LibdispatchOffsets::dqo_serialnum, SystemRuntimeMacOSX::LibdispatchOffsets::dqo_serialnum_size, error(), SystemRuntimeMacOSX::LibdispatchOffsets::IsValid(), LLDB_INVALID_ADDRESS, LLDB_INVALID_QUEUE_ID, m_libdispatch_offsets, lldb_private::Runtime::m_process, ReadLibdispatchOffsets(), lldb_private::Process::ReadPointerFromMemory(), and lldb_private::Process::ReadUnsignedIntegerFromMemory().

◆ GetQueueKind()

lldb::QueueKind SystemRuntimeMacOSX::GetQueueKind ( lldb::addr_t  dispatch_qaddr)
overridevirtual

Retrieve the Queue kind for the queue at a thread's dispatch_qaddr.

Retrieve the Queue kind - either eQueueKindSerial or eQueueKindConcurrent, indicating that this queue processes work items serially or concurrently.

Returns
The Queue kind, if it could be read, else eQueueKindUnknown.

Reimplemented from lldb_private::SystemRuntime.

Definition at line 176 of file SystemRuntimeMacOSX.cpp.

References SystemRuntimeMacOSX::LibdispatchOffsets::dqo_version, SystemRuntimeMacOSX::LibdispatchOffsets::dqo_width, SystemRuntimeMacOSX::LibdispatchOffsets::dqo_width_size, lldb::eQueueKindConcurrent, lldb::eQueueKindSerial, lldb::eQueueKindUnknown, error(), SystemRuntimeMacOSX::LibdispatchOffsets::IsValid(), LLDB_INVALID_ADDRESS, m_libdispatch_offsets, lldb_private::Runtime::m_process, ReadLibdispatchOffsets(), and lldb_private::Process::ReadUnsignedIntegerFromMemory().

Referenced by PopulateQueueList(), and PopulateQueuesUsingLibBTR().

◆ GetQueueNameFromThreadQAddress()

std::string SystemRuntimeMacOSX::GetQueueNameFromThreadQAddress ( lldb::addr_t  dispatch_qaddr)
overridevirtual

Get the queue name for a thread given a thread's dispatch_qaddr.

On systems using libdispatch queues, a thread may be associated with a queue. There will be a call to get the thread's dispatch_qaddr. At the dispatch_qaddr we will find the address of this thread's dispatch_queue_t structure. Given the address of the dispatch_queue_t structure for a thread, get the queue name and return it.

Parameters
[in]dispatch_qaddrThe address of the dispatch_qaddr pointer for this thread.
Returns
The string of this queue's name. An empty string is returned if the name could not be found.

Reimplemented from lldb_private::SystemRuntime.

Definition at line 122 of file SystemRuntimeMacOSX.cpp.

References SystemRuntimeMacOSX::LibdispatchOffsets::dqo_label, SystemRuntimeMacOSX::LibdispatchOffsets::dqo_label_size, SystemRuntimeMacOSX::LibdispatchOffsets::dqo_version, error(), SystemRuntimeMacOSX::LibdispatchOffsets::IsValid(), LLDB_INVALID_ADDRESS, m_libdispatch_offsets, lldb_private::Runtime::m_process, lldb_private::Process::ReadCStringFromMemory(), ReadLibdispatchOffsets(), lldb_private::Process::ReadMemory(), and lldb_private::Process::ReadPointerFromMemory().

◆ Initialize()

void SystemRuntimeMacOSX::Initialize ( )
static

◆ operator=()

const SystemRuntimeMacOSX & SystemRuntimeMacOSX::operator= ( const SystemRuntimeMacOSX )
privatedelete

◆ PopulatePendingItemsForQueue()

void SystemRuntimeMacOSX::PopulatePendingItemsForQueue ( lldb_private::Queue queue)
overridevirtual

Get the pending work items for a libdispatch Queue.

If this system/process is using libdispatch and the runtime can do so, retrieve the list of pending work items for the specified Queue and add it to the Queue.

Parameters
[in]queueThe queue of interest.

Reimplemented from lldb_private::SystemRuntime.

Definition at line 872 of file SystemRuntimeMacOSX.cpp.

References BacktraceRecordingHeadersInitialized(), SystemRuntimeMacOSX::ItemRefAndCodeAddress::code_address, lldb_private::Queue::GetLibdispatchQueueAddress(), GetPendingItemRefsForQueue(), lldb_private::Process::GetTarget(), SystemRuntimeMacOSX::ItemRefAndCodeAddress::item_ref, SystemRuntimeMacOSX::PendingItemsForQueue::item_refs_and_code_addresses, lldb_private::Runtime::m_process, lldb_private::Queue::PushPendingQueueItem(), and lldb_private::Target::ResolveLoadAddress().

◆ PopulatePendingQueuesUsingLibBTR()

void SystemRuntimeMacOSX::PopulatePendingQueuesUsingLibBTR ( lldb::addr_t  items_buffer,
uint64_t  items_buffer_size,
uint64_t  count,
lldb_private::Queue queue 
)

◆ PopulateQueueList()

void SystemRuntimeMacOSX::PopulateQueueList ( lldb_private::QueueList queue_list)
overridevirtual

Populate the Process' QueueList with libdispatch / GCD queues that exist.

When process execution is paused, the SystemRuntime may be called to fill in the list of Queues that currently exist.

Parameters
[out]queue_listThis QueueList will be cleared, and any queues that currently exist will be added. An empty QueueList will be returned if no queues exist or if this Systemruntime does not support libdispatch queues.

Reimplemented from lldb_private::SystemRuntime.

Definition at line 729 of file SystemRuntimeMacOSX.cpp.

References lldb_private::QueueList::AddQueue(), BacktraceRecordingHeadersInitialized(), lldb_private::AppleGetQueuesHandler::GetQueuesReturnInfo::count, lldb_private::eLazyBoolNo, error(), lldb_private::QueueList::FindQueueByID(), lldb_private::AppleGetQueuesHandler::GetCurrentQueues(), lldb_private::ThreadList::GetExpressionExecutionThread(), GetQueueKind(), lldb_private::Process::GetThreadList(), LLDB_INVALID_ADDRESS, LLDB_INVALID_QUEUE_ID, m_get_queues_handler, m_page_to_free, m_page_to_free_size, lldb_private::Runtime::m_process, PopulateQueuesUsingLibBTR(), lldb_private::AppleGetQueuesHandler::GetQueuesReturnInfo::queues_buffer_ptr, lldb_private::AppleGetQueuesHandler::GetQueuesReturnInfo::queues_buffer_size, and lldb_private::Process::Threads().

◆ PopulateQueuesUsingLibBTR()

void SystemRuntimeMacOSX::PopulateQueuesUsingLibBTR ( lldb::addr_t  queues_buffer,
uint64_t  queues_buffer_size,
uint64_t  count,
lldb_private::QueueList queue_list 
)

◆ ReadLibdispatchOffsets()

void SystemRuntimeMacOSX::ReadLibdispatchOffsets ( )
private

◆ ReadLibdispatchOffsetsAddress()

void SystemRuntimeMacOSX::ReadLibdispatchOffsetsAddress ( )
private

◆ ReadLibdispatchTSDIndexes()

void SystemRuntimeMacOSX::ReadLibdispatchTSDIndexes ( )
private

◆ ReadLibdispatchTSDIndexesAddress()

void SystemRuntimeMacOSX::ReadLibdispatchTSDIndexesAddress ( )
private

◆ ReadLibpthreadOffsets()

void SystemRuntimeMacOSX::ReadLibpthreadOffsets ( )
private

◆ ReadLibpthreadOffsetsAddress()

void SystemRuntimeMacOSX::ReadLibpthreadOffsetsAddress ( )
private

◆ SafeToCallFunctionsOnThisThread()

bool SystemRuntimeMacOSX::SafeToCallFunctionsOnThisThread ( lldb::ThreadSP  thread_sp)
overridevirtual

Determine whether it is safe to run an expression on a given thread.

If a system must not run functions on a thread in some particular state, this method gives a way for it to flag that the expression should not be run.

Parameters
[in]thread_spThe thread we want to run the expression on.
Returns
True will be returned if there are no known problems with running an expression on this thread. False means that the inferior function call should not be made on this thread.

Reimplemented from lldb_private::SystemRuntime.

Definition at line 227 of file SystemRuntimeMacOSX.cpp.

References lldb_private::SymbolContext::GetFunctionName().

◆ Terminate()

void SystemRuntimeMacOSX::Terminate ( )
static

Member Data Documentation

◆ m_break_id

lldb::user_id_t SystemRuntimeMacOSX::m_break_id
protected

Definition at line 104 of file SystemRuntimeMacOSX.h.

Referenced by Clear().

◆ m_dispatch_queue_offsets_addr

lldb::addr_t SystemRuntimeMacOSX::m_dispatch_queue_offsets_addr
private

Definition at line 272 of file SystemRuntimeMacOSX.h.

Referenced by ReadLibdispatchOffsets(), and ReadLibdispatchOffsetsAddress().

◆ m_dispatch_tsd_indexes_addr

lldb::addr_t SystemRuntimeMacOSX::m_dispatch_tsd_indexes_addr
private

◆ m_dispatch_voucher_offsets_addr

lldb::addr_t SystemRuntimeMacOSX::m_dispatch_voucher_offsets_addr
private

Definition at line 281 of file SystemRuntimeMacOSX.h.

◆ m_get_item_info_handler

lldb_private::AppleGetItemInfoHandler SystemRuntimeMacOSX::m_get_item_info_handler
private

◆ m_get_pending_items_handler

lldb_private::AppleGetPendingItemsHandler SystemRuntimeMacOSX::m_get_pending_items_handler
private

Definition at line 264 of file SystemRuntimeMacOSX.h.

Referenced by Detach(), and GetPendingItemRefsForQueue().

◆ m_get_queues_handler

lldb_private::AppleGetQueuesHandler SystemRuntimeMacOSX::m_get_queues_handler
private

Definition at line 263 of file SystemRuntimeMacOSX.h.

Referenced by Detach(), and PopulateQueueList().

◆ m_get_thread_item_info_handler

lldb_private::AppleGetThreadItemInfoHandler SystemRuntimeMacOSX::m_get_thread_item_info_handler
private

Definition at line 266 of file SystemRuntimeMacOSX.h.

Referenced by Detach(), and GetExtendedBacktraceThread().

◆ m_lib_backtrace_recording_info

libBacktraceRecording_info SystemRuntimeMacOSX::m_lib_backtrace_recording_info
private

◆ m_libdispatch_offsets

struct LibdispatchOffsets SystemRuntimeMacOSX::m_libdispatch_offsets
private

◆ m_libdispatch_tsd_indexes

struct LibdispatchTSDIndexes SystemRuntimeMacOSX::m_libdispatch_tsd_indexes
private

◆ m_libdispatch_voucher_offsets

struct LibdispatchVoucherOffsets SystemRuntimeMacOSX::m_libdispatch_voucher_offsets
private

Definition at line 282 of file SystemRuntimeMacOSX.h.

◆ m_libpthread_layout_offsets_addr

lldb::addr_t SystemRuntimeMacOSX::m_libpthread_layout_offsets_addr
private

Definition at line 275 of file SystemRuntimeMacOSX.h.

Referenced by ReadLibpthreadOffsets(), and ReadLibpthreadOffsetsAddress().

◆ m_libpthread_offsets

struct LibpthreadOffsets SystemRuntimeMacOSX::m_libpthread_offsets
private

◆ m_mutex

std::recursive_mutex SystemRuntimeMacOSX::m_mutex
mutableprotected

Definition at line 105 of file SystemRuntimeMacOSX.h.

Referenced by Clear().

◆ m_page_to_free

lldb::addr_t SystemRuntimeMacOSX::m_page_to_free
private

◆ m_page_to_free_size

uint64_t SystemRuntimeMacOSX::m_page_to_free_size
private

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