LLDB mainline
|
#include <SystemRuntimeMacOSX.h>
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 Runtime & | operator= (const Runtime &)=delete |
Process * | GetProcess () |
Target & | GetTargetRef () |
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 | |
PluginInterface & | operator= (const PluginInterface &)=delete |
Static Public Member Functions | |
static void | Initialize () |
static void | Terminate () |
static llvm::StringRef | GetPluginNameStatic () |
static lldb_private::SystemRuntime * | CreateInstance (lldb_private::Process *process) |
Static Public Member Functions inherited from lldb_private::SystemRuntime | |
static SystemRuntime * | FindPlugin (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< ConstString > | m_types |
Protected Attributes inherited from lldb_private::Runtime | |
Process * | m_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 SystemRuntimeMacOSX & | operator= (const SystemRuntimeMacOSX &)=delete |
Definition at line 31 of file SystemRuntimeMacOSX.h.
SystemRuntimeMacOSX::SystemRuntimeMacOSX | ( | lldb_private::Process * | process | ) |
Definition at line 82 of file SystemRuntimeMacOSX.cpp.
References lldb_private::RegisterAbortWithPayloadFrameRecognizer().
|
override |
Definition at line 100 of file SystemRuntimeMacOSX.cpp.
References Clear().
|
privatedelete |
|
overridevirtual |
Add key-value pairs to the StructuredData dictionary object with information debugserver may need when constructing the jThreadExtendedInfo packet.
[out] | dict | Dictionary to which key-value pairs should be added; they will be sent to the remote gdb server stub as arguments in the jThreadExtendedInfo request. |
Reimplemented from lldb_private::SystemRuntime.
Definition at line 200 of file SystemRuntimeMacOSX.cpp.
References lldb_private::StructuredData::Dictionary::AddIntegerItem(), SystemRuntimeMacOSX::LibdispatchTSDIndexes::dti_qos_class_index, SystemRuntimeMacOSX::LibdispatchTSDIndexes::dti_queue_index, SystemRuntimeMacOSX::LibdispatchTSDIndexes::dti_voucher_index, lldb_private::StructuredData::Object::GetAsDictionary(), SystemRuntimeMacOSX::LibdispatchTSDIndexes::IsValid(), SystemRuntimeMacOSX::LibpthreadOffsets::IsValid(), m_libdispatch_tsd_indexes, m_libpthread_offsets, SystemRuntimeMacOSX::LibpthreadOffsets::plo_pthread_tsd_base_address_offset, SystemRuntimeMacOSX::LibpthreadOffsets::plo_pthread_tsd_base_offset, SystemRuntimeMacOSX::LibpthreadOffsets::plo_pthread_tsd_entry_size, ReadLibdispatchTSDIndexes(), and ReadLibpthreadOffsets().
|
private |
Definition at line 617 of file SystemRuntimeMacOSX.cpp.
References lldb_private::SymbolContextList::Clear(), error(), lldb::eSymbolTypeData, lldb_private::ModuleList::FindSymbolsWithNameAndType(), lldb_private::SymbolContext::GetAddressRange(), lldb_private::AddressRange::GetBaseAddress(), lldb_private::SymbolContextList::GetContextAtIndex(), lldb_private::Target::GetImages(), lldb_private::Address::GetLoadAddress(), lldb_private::Process::GetTarget(), lldb_private::SymbolContextList::IsEmpty(), SystemRuntimeMacOSX::libBacktraceRecording_info::item_info_data_offset, SystemRuntimeMacOSX::libBacktraceRecording_info::item_info_version, LLDB_INVALID_ADDRESS, m_lib_backtrace_recording_info, lldb_private::Runtime::m_process, SystemRuntimeMacOSX::libBacktraceRecording_info::queue_info_data_offset, SystemRuntimeMacOSX::libBacktraceRecording_info::queue_info_version, and lldb_private::Process::ReadUnsignedIntegerFromMemory().
Referenced by GetExtendedBacktraceThread(), PopulatePendingItemsForQueue(), and PopulateQueueList().
void SystemRuntimeMacOSX::Clear | ( | bool | clear_process | ) |
Definition at line 110 of file SystemRuntimeMacOSX.cpp.
References lldb_private::Process::ClearBreakpointSiteByID(), lldb_private::Process::IsAlive(), LLDB_BREAK_ID_IS_VALID, LLDB_INVALID_BREAK_ID, m_break_id, m_mutex, and lldb_private::Runtime::m_process.
Referenced by ~SystemRuntimeMacOSX().
|
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.
[in] | queue_item | The QueueItem that we will be completing. |
[in] | item_ref | The 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.
|
static |
Definition at line 44 of file SystemRuntimeMacOSX.cpp.
References lldb_private::ObjectFile::eStrataUser, lldb_private::ObjectFile::GetArchitecture(), lldb_private::Module::GetObjectFile(), lldb_private::ObjectFile::GetStrata(), and lldb_private::ArchSpec::GetTriple().
Referenced by Initialize(), and Terminate().
|
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.
|
private |
Definition at line 999 of file SystemRuntimeMacOSX.cpp.
References SystemRuntimeMacOSX::ItemInfo::enqueuing_callstack, SystemRuntimeMacOSX::ItemInfo::enqueuing_callstack_frame_count, SystemRuntimeMacOSX::ItemInfo::enqueuing_queue_label, SystemRuntimeMacOSX::ItemInfo::enqueuing_queue_serialnum, SystemRuntimeMacOSX::ItemInfo::enqueuing_thread_id, SystemRuntimeMacOSX::ItemInfo::enqueuing_thread_label, SystemRuntimeMacOSX::ItemInfo::function_or_block, lldb_private::DataExtractor::GetAddress(), lldb_private::DataExtractor::GetCStr(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), SystemRuntimeMacOSX::libBacktraceRecording_info::item_info_data_offset, SystemRuntimeMacOSX::ItemInfo::item_that_enqueued_this, m_lib_backtrace_recording_info, SystemRuntimeMacOSX::ItemInfo::stop_id, SystemRuntimeMacOSX::ItemInfo::target_queue_label, and SystemRuntimeMacOSX::ItemInfo::target_queue_serialnum.
Referenced by CompleteQueueItem(), GetExtendedBacktraceFromItemRef(), and GetExtendedBacktraceThread().
|
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.
[in] | queue_item_sp | The QueueItem that we are getting an extended backtrace for. |
[in] | type | The type of extended backtrace to fetch. The types supported are returned from SystemRuntime::GetExtendedBacktraceTypes. |
Reimplemented from lldb_private::SystemRuntime.
Definition at line 593 of file SystemRuntimeMacOSX.cpp.
References lldb_private::Runtime::m_process.
ThreadSP SystemRuntimeMacOSX::GetExtendedBacktraceFromItemRef | ( | lldb::addr_t | item_ref | ) |
Definition at line 555 of file SystemRuntimeMacOSX.cpp.
References SystemRuntimeMacOSX::ItemInfo::enqueuing_callstack, SystemRuntimeMacOSX::ItemInfo::enqueuing_queue_label, SystemRuntimeMacOSX::ItemInfo::enqueuing_queue_serialnum, SystemRuntimeMacOSX::ItemInfo::enqueuing_thread_id, 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, and lldb_private::Process::ReadMemory().
Referenced by GetExtendedBacktraceThread().
|
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.
[in] | thread | The thread to examine. |
[in] | type | The type of thread origin being requested. The types supported are returned from SystemRuntime::GetExtendedBacktraceTypes. |
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().
|
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.
Reimplemented from lldb_private::SystemRuntime.
Definition at line 719 of file SystemRuntimeMacOSX.cpp.
References lldb_private::SystemRuntime::m_types.
|
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.
[in] | dispatch_qaddr | The address of the dispatch_qaddr pointer for this thread. |
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().
|
private |
Definition at line 795 of file SystemRuntimeMacOSX.cpp.
References SystemRuntimeMacOSX::ItemRefAndCodeAddress::code_address, lldb_private::AppleGetPendingItemsHandler::GetPendingItemsReturnInfo::count, error(), lldb_private::DataExtractor::GetAddress(), lldb_private::Process::GetAddressByteSize(), lldb_private::Process::GetByteOrder(), lldb_private::WritableDataBuffer::GetBytes(), lldb_private::DataBufferHeap::GetByteSize(), lldb_private::ThreadList::GetExpressionExecutionThread(), lldb_private::AppleGetPendingItemsHandler::GetPendingItems(), lldb_private::Process::GetThreadList(), lldb_private::DataExtractor::GetU32(), SystemRuntimeMacOSX::ItemRefAndCodeAddress::item_ref, SystemRuntimeMacOSX::PendingItemsForQueue::item_refs_and_code_addresses, lldb_private::AppleGetPendingItemsHandler::GetPendingItemsReturnInfo::items_buffer_ptr, lldb_private::AppleGetPendingItemsHandler::GetPendingItemsReturnInfo::items_buffer_size, LLDB_INVALID_ADDRESS, m_get_pending_items_handler, m_page_to_free, m_page_to_free_size, lldb_private::Runtime::m_process, SystemRuntimeMacOSX::PendingItemsForQueue::new_style, and lldb_private::Process::ReadMemory().
Referenced by PopulatePendingItemsForQueue().
|
inlineoverridevirtual |
Implements lldb_private::PluginInterface.
Definition at line 101 of file SystemRuntimeMacOSX.h.
References GetPluginNameStatic().
|
inlinestatic |
Definition at line 42 of file SystemRuntimeMacOSX.h.
Referenced by GetPluginName(), and Initialize().
|
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.
[in] | dispatch_qaddr | The address of the dispatch_qaddr pointer for this thread. |
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().
|
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.
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().
|
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.
[in] | dispatch_qaddr | The address of the dispatch_qaddr pointer for this thread. |
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().
|
static |
Definition at line 1025 of file SystemRuntimeMacOSX.cpp.
References CreateInstance(), GetPluginNameStatic(), and lldb_private::PluginManager::RegisterPlugin().
|
privatedelete |
|
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.
[in] | queue | The 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().
void SystemRuntimeMacOSX::PopulatePendingQueuesUsingLibBTR | ( | lldb::addr_t | items_buffer, |
uint64_t | items_buffer_size, | ||
uint64_t | count, | ||
lldb_private::Queue * | queue | ||
) |
|
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.
[out] | queue_list | This 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().
void SystemRuntimeMacOSX::PopulateQueuesUsingLibBTR | ( | lldb::addr_t | queues_buffer, |
uint64_t | queues_buffer_size, | ||
uint64_t | count, | ||
lldb_private::QueueList & | queue_list | ||
) |
Definition at line 925 of file SystemRuntimeMacOSX.cpp.
References lldb_private::QueueList::AddQueue(), error(), lldb_private::DataExtractor::GetAddress(), lldb_private::Process::GetAddressByteSize(), lldb_private::Process::GetByteOrder(), lldb_private::WritableDataBuffer::GetBytes(), lldb_private::DataBufferHeap::GetByteSize(), lldb_private::DataExtractor::GetCStr(), lldb_private::GetLog(), GetQueueKind(), lldb_private::DataExtractor::GetU32(), lldb_private::DataExtractor::GetU64(), LLDB_LOGF, m_lib_backtrace_recording_info, m_page_to_free, m_page_to_free_size, lldb_private::Runtime::m_process, SystemRuntimeMacOSX::libBacktraceRecording_info::queue_info_data_offset, and lldb_private::Process::ReadMemory().
Referenced by PopulateQueueList().
|
private |
Definition at line 302 of file SystemRuntimeMacOSX.cpp.
References SystemRuntimeMacOSX::LibdispatchOffsets::dqo_version, error(), lldb_private::Process::GetAddressByteSize(), lldb_private::Process::GetByteOrder(), SystemRuntimeMacOSX::LibdispatchOffsets::IsValid(), m_dispatch_queue_offsets_addr, m_libdispatch_offsets, lldb_private::Runtime::m_process, ReadLibdispatchOffsetsAddress(), and lldb_private::Process::ReadMemory().
Referenced by GetQueueIDFromThreadQAddress(), GetQueueKind(), and GetQueueNameFromThreadQAddress().
|
private |
Definition at line 270 of file SystemRuntimeMacOSX.cpp.
References lldb::eSymbolTypeData, lldb_private::ModuleList::FindFirstModule(), lldb_private::Target::GetImages(), lldb_private::Symbol::GetLoadAddress(), lldb_private::Process::GetTarget(), LLDB_INVALID_ADDRESS, m_dispatch_queue_offsets_addr, and lldb_private::Runtime::m_process.
Referenced by ReadLibdispatchOffsets().
|
private |
Definition at line 396 of file SystemRuntimeMacOSX.cpp.
References lldb_private::TypeSystemClang::AddFieldToRecordType(), lldb_private::TypeSystemClang::CompleteTagDeclarationDefinition(), SystemRuntimeMacOSX::LibdispatchTSDIndexes::dti_qos_class_index, SystemRuntimeMacOSX::LibdispatchTSDIndexes::dti_queue_index, SystemRuntimeMacOSX::LibdispatchTSDIndexes::dti_version, SystemRuntimeMacOSX::LibdispatchTSDIndexes::dti_voucher_index, lldb::eAccessPublic, lldb::eEncodingUint, lldb::eLanguageTypeC, error(), lldb_private::ProcessStructReader::GetField(), lldb_private::ScratchTypeSystemClang::GetForTarget(), lldb_private::Process::GetTarget(), SystemRuntimeMacOSX::LibdispatchTSDIndexes::IsValid(), LLDB_INVALID_ADDRESS, m_dispatch_tsd_indexes_addr, m_libdispatch_tsd_indexes, lldb_private::Runtime::m_process, ReadLibdispatchTSDIndexesAddress(), lldb_private::Target::ReadUnsignedIntegerFromMemory(), lldb_private::Target::ResolveLoadAddress(), and lldb_private::TypeSystemClang::StartTagDeclarationDefinition().
Referenced by AddThreadExtendedInfoPacketHints().
|
private |
Definition at line 374 of file SystemRuntimeMacOSX.cpp.
References lldb::eSymbolTypeData, lldb_private::ModuleList::FindFirstModule(), lldb_private::Target::GetImages(), lldb_private::Symbol::GetLoadAddress(), lldb_private::Process::GetTarget(), LLDB_INVALID_ADDRESS, m_dispatch_tsd_indexes_addr, and lldb_private::Runtime::m_process.
Referenced by ReadLibdispatchTSDIndexes().
|
private |
Definition at line 349 of file SystemRuntimeMacOSX.cpp.
References error(), lldb_private::Process::GetAddressByteSize(), lldb_private::Process::GetByteOrder(), SystemRuntimeMacOSX::LibpthreadOffsets::IsValid(), LLDB_INVALID_ADDRESS, m_libpthread_layout_offsets_addr, m_libpthread_offsets, lldb_private::Runtime::m_process, SystemRuntimeMacOSX::LibpthreadOffsets::plo_version, ReadLibpthreadOffsetsAddress(), and lldb_private::Process::ReadMemory().
Referenced by AddThreadExtendedInfoPacketHints().
|
private |
Definition at line 326 of file SystemRuntimeMacOSX.cpp.
References lldb::eSymbolTypeData, lldb_private::ModuleList::FindFirstModule(), lldb_private::Target::GetImages(), lldb_private::Symbol::GetLoadAddress(), lldb_private::Process::GetTarget(), LLDB_INVALID_ADDRESS, m_libpthread_layout_offsets_addr, and lldb_private::Runtime::m_process.
Referenced by ReadLibpthreadOffsets().
|
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.
[in] | thread_sp | The thread we want to run the expression on. |
Reimplemented from lldb_private::SystemRuntime.
Definition at line 227 of file SystemRuntimeMacOSX.cpp.
References lldb_private::SymbolContext::GetFunctionName().
|
static |
Definition at line 1031 of file SystemRuntimeMacOSX.cpp.
References CreateInstance(), and lldb_private::PluginManager::UnregisterPlugin().
|
protected |
Definition at line 104 of file SystemRuntimeMacOSX.h.
Referenced by Clear().
|
private |
Definition at line 272 of file SystemRuntimeMacOSX.h.
Referenced by ReadLibdispatchOffsets(), and ReadLibdispatchOffsetsAddress().
|
private |
Definition at line 278 of file SystemRuntimeMacOSX.h.
Referenced by ReadLibdispatchTSDIndexes(), and ReadLibdispatchTSDIndexesAddress().
|
private |
Definition at line 281 of file SystemRuntimeMacOSX.h.
|
private |
Definition at line 265 of file SystemRuntimeMacOSX.h.
Referenced by CompleteQueueItem(), Detach(), and GetExtendedBacktraceFromItemRef().
|
private |
Definition at line 264 of file SystemRuntimeMacOSX.h.
Referenced by Detach(), and GetPendingItemRefsForQueue().
|
private |
Definition at line 263 of file SystemRuntimeMacOSX.h.
Referenced by Detach(), and PopulateQueueList().
|
private |
Definition at line 266 of file SystemRuntimeMacOSX.h.
Referenced by Detach(), and GetExtendedBacktraceThread().
|
private |
Definition at line 270 of file SystemRuntimeMacOSX.h.
Referenced by BacktraceRecordingHeadersInitialized(), ExtractItemInfoFromBuffer(), and PopulateQueuesUsingLibBTR().
|
private |
Definition at line 273 of file SystemRuntimeMacOSX.h.
Referenced by GetQueueIDFromThreadQAddress(), GetQueueKind(), GetQueueNameFromThreadQAddress(), and ReadLibdispatchOffsets().
|
private |
Definition at line 279 of file SystemRuntimeMacOSX.h.
Referenced by AddThreadExtendedInfoPacketHints(), and ReadLibdispatchTSDIndexes().
|
private |
Definition at line 282 of file SystemRuntimeMacOSX.h.
|
private |
Definition at line 275 of file SystemRuntimeMacOSX.h.
Referenced by ReadLibpthreadOffsets(), and ReadLibpthreadOffsetsAddress().
|
private |
Definition at line 276 of file SystemRuntimeMacOSX.h.
Referenced by AddThreadExtendedInfoPacketHints(), and ReadLibpthreadOffsets().
|
mutableprotected |
Definition at line 105 of file SystemRuntimeMacOSX.h.
Referenced by Clear().
|
private |
Definition at line 268 of file SystemRuntimeMacOSX.h.
Referenced by CompleteQueueItem(), GetExtendedBacktraceFromItemRef(), GetExtendedBacktraceThread(), GetPendingItemRefsForQueue(), PopulateQueueList(), and PopulateQueuesUsingLibBTR().
|
private |
Definition at line 269 of file SystemRuntimeMacOSX.h.
Referenced by CompleteQueueItem(), GetExtendedBacktraceFromItemRef(), GetExtendedBacktraceThread(), GetPendingItemRefsForQueue(), PopulateQueueList(), and PopulateQueuesUsingLibBTR().