summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
diff options
context:
space:
mode:
authorJason Molenda <jmolenda@apple.com>2013-12-13 00:29:16 +0000
committerJason Molenda <jmolenda@apple.com>2013-12-13 00:29:16 +0000
commit5e8dce4dbfd6f3e3366948ec22b82b952ae2b108 (patch)
tree4ddc8514061bc208d847e04497561e574527518e /lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
parent2af6d73cdfba2768198ee502c12da14102bf7e55 (diff)
downloadbcm5719-llvm-5e8dce4dbfd6f3e3366948ec22b82b952ae2b108.tar.gz
bcm5719-llvm-5e8dce4dbfd6f3e3366948ec22b82b952ae2b108.zip
Add new Queue, QueueItem, Queuelist, SBQueue, SBQueueItem classes to represent
libdispatch aka Grand Central Dispatch (GCD) queues. Still fleshing out the documentation and testing of these but the overall API is settling down so it's a good time to check it in. <rdar://problem/15600370> llvm-svn: 197190
Diffstat (limited to 'lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp')
-rw-r--r--lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
index 388264a2d95..5756e7071d7 100644
--- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
+++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp
@@ -22,10 +22,11 @@
#include "lldb/Symbol/ObjectFile.h"
#include "lldb/Symbol/SymbolContext.h"
#include "Plugins/Process/Utility/HistoryThread.h"
+#include "lldb/Target/Queue.h"
+#include "lldb/Target/QueueList.h"
#include "lldb/Target/Target.h"
#include "lldb/Target/Thread.h"
-
#include "SystemRuntimeMacOSX.h"
using namespace lldb;
@@ -443,6 +444,26 @@ SystemRuntimeMacOSX::GetExtendedBacktraceThread (ThreadSP original_thread_sp, Co
return new_extended_thread_sp;
}
+void
+SystemRuntimeMacOSX::PopulateQueueList (lldb_private::QueueList &queue_list)
+{
+ // For now, iterate over the threads and see what queue each thread is associated with.
+ // If we haven't already added this queue, add it to the QueueList.
+ // (a single libdispatch queue may be using multiple threads simultaneously.)
+
+ 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_list.AddQueue (queue_sp);
+ }
+ }
+ }
+}
+
void
SystemRuntimeMacOSX::Initialize()
OpenPOWER on IntegriCloud