diff options
author | Jason Molenda <jmolenda@apple.com> | 2013-12-13 00:29:16 +0000 |
---|---|---|
committer | Jason Molenda <jmolenda@apple.com> | 2013-12-13 00:29:16 +0000 |
commit | 5e8dce4dbfd6f3e3366948ec22b82b952ae2b108 (patch) | |
tree | 4ddc8514061bc208d847e04497561e574527518e /lldb/source/Plugins/SystemRuntime/MacOSX | |
parent | 2af6d73cdfba2768198ee502c12da14102bf7e55 (diff) | |
download | bcm5719-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')
-rw-r--r-- | lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.cpp | 23 | ||||
-rw-r--r-- | lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h | 3 |
2 files changed, 25 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() diff --git a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h index c472bee8572..4c684fee7b2 100644 --- a/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h +++ b/lldb/source/Plugins/SystemRuntime/MacOSX/SystemRuntimeMacOSX.h @@ -104,6 +104,9 @@ private: SystemRuntimeMacOSX::ArchivedBacktrace GetLibdispatchExtendedBacktrace (lldb::ThreadSP thread); + void + PopulateQueueList (lldb_private::QueueList &queue_list); + protected: lldb::user_id_t m_break_id; mutable lldb_private::Mutex m_mutex; |