diff options
author | Jason Molenda <jmolenda@apple.com> | 2014-04-25 00:01:15 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2014-04-25 00:01:15 +0000 |
commit | b9ffa98cab65ecb1e66a194bb9641735ef8e7eb2 (patch) | |
tree | 7b08a842255de003f00d2be36defedfa72537ef1 /lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp | |
parent | 5ad11841f7fe4ae35165e34fb5574f2e4e8499ed (diff) | |
download | bcm5719-llvm-b9ffa98cab65ecb1e66a194bb9641735ef8e7eb2.tar.gz bcm5719-llvm-b9ffa98cab65ecb1e66a194bb9641735ef8e7eb2.zip |
Add a new SBThread::GetQueue() method to get the queue that is
currently associated with a given thread, on relevant targets.
Change the queue detection code to verify that the queues
associated with all live threads are included in the list.
<rdar://problem/16411314>
llvm-svn: 207160
Diffstat (limited to 'lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp')
-rw-r--r-- | lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp index b4495fde00c..7ff14fc5e09 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp @@ -524,26 +524,7 @@ SystemRuntimeMacOSX::GetExtendedBacktraceTypes () void SystemRuntimeMacOSX::PopulateQueueList (lldb_private::QueueList &queue_list) { - if (!BacktraceRecordingHeadersInitialized()) - { - // We don't have libBacktraceRecording -- build the list of queues by looking at - // all extant threads, and the queues that they currently belong to. - - for (ThreadSP thread_sp : m_process->Threads()) - { - if (thread_sp->GetQueueID() != LLDB_INVALID_QUEUE_ID) - { - if (queue_list.FindQueueByID (thread_sp->GetQueueID()).get() == NULL) - { - QueueSP queue_sp (new Queue(m_process->shared_from_this(), thread_sp->GetQueueID(), thread_sp->GetQueueName())); - queue_sp->SetKind (GetQueueKind (thread_sp->GetQueueLibdispatchQueueAddress())); - queue_sp->SetLibdispatchQueueAddress (thread_sp->GetQueueLibdispatchQueueAddress()); - queue_list.AddQueue (queue_sp); - } - } - } - } - else + if (BacktraceRecordingHeadersInitialized()) { AppleGetQueuesHandler::GetQueuesReturnInfo queue_info_pointer; ThreadSP cur_thread_sp (m_process->GetThreadList().GetSelectedThread()); @@ -566,6 +547,26 @@ SystemRuntimeMacOSX::PopulateQueueList (lldb_private::QueueList &queue_list) } } } + + // We either didn't have libBacktraceRecording (and need to create the queues list based on threads) + // or we did get the queues list from libBacktraceRecording but some special queues may not be + // included in its information. This is needed because libBacktraceRecording + // will only list queues with pending or running items by default - but the magic com.apple.main-thread + // queue on thread 1 is always around. + + for (ThreadSP thread_sp : m_process->Threads()) + { + if (thread_sp->GetQueueID() != LLDB_INVALID_QUEUE_ID) + { + if (queue_list.FindQueueByID (thread_sp->GetQueueID()).get() == NULL) + { + QueueSP queue_sp (new Queue(m_process->shared_from_this(), thread_sp->GetQueueID(), thread_sp->GetQueueName())); + queue_sp->SetKind (GetQueueKind (thread_sp->GetQueueLibdispatchQueueAddress())); + queue_sp->SetLibdispatchQueueAddress (thread_sp->GetQueueLibdispatchQueueAddress()); + queue_list.AddQueue (queue_sp); + } + } + } } // Returns either an array of introspection_dispatch_item_info_ref's for the pending items on |