aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/API/SBProcess.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/API/SBProcess.cpp
parent2af6d73cdfba2768198ee502c12da14102bf7e55 (diff)
downloadllvm-5e8dce4dbfd6f3e3366948ec22b82b952ae2b108.zip
llvm-5e8dce4dbfd6f3e3366948ec22b82b952ae2b108.tar.gz
llvm-5e8dce4dbfd6f3e3366948ec22b82b952ae2b108.tar.bz2
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/API/SBProcess.cpp')
-rw-r--r--lldb/source/API/SBProcess.cpp47
1 files changed, 47 insertions, 0 deletions
diff --git a/lldb/source/API/SBProcess.cpp b/lldb/source/API/SBProcess.cpp
index 557006f..235388b 100644
--- a/lldb/source/API/SBProcess.cpp
+++ b/lldb/source/API/SBProcess.cpp
@@ -535,6 +535,53 @@ SBProcess::GetThreadAtIndex (size_t index)
}
uint32_t
+SBProcess::GetNumQueues ()
+{
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+ uint32_t num_queues = 0;
+ ProcessSP process_sp(GetSP());
+ if (process_sp)
+ {
+ Process::StopLocker stop_locker;
+
+ Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
+ num_queues = process_sp->GetQueueList().GetSize();
+ }
+
+ if (log)
+ log->Printf ("SBProcess(%p)::GetNumQueues () => %d", process_sp.get(), num_queues);
+
+ return num_queues;
+}
+
+SBQueue
+SBProcess::GetQueueAtIndex (size_t index)
+{
+ Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
+
+ SBQueue sb_queue;
+ QueueSP queue_sp;
+ ProcessSP process_sp(GetSP());
+ if (process_sp)
+ {
+ Process::StopLocker stop_locker;
+ Mutex::Locker api_locker (process_sp->GetTarget().GetAPIMutex());
+ queue_sp = process_sp->GetQueueList().GetQueueAtIndex(index);
+ sb_queue.SetQueue (queue_sp);
+ }
+
+ if (log)
+ {
+ log->Printf ("SBProcess(%p)::GetQueueAtIndex (index=%d) => SBQueue(%p)",
+ process_sp.get(), (uint32_t) index, queue_sp.get());
+ }
+
+ return sb_queue;
+}
+
+
+uint32_t
SBProcess::GetStopID(bool include_expression_stops)
{
ProcessSP process_sp(GetSP());