Change the Mac OS X SystemRuntime plugin from using the placeholder
libldi library to collect extended backtrace information; switch
to the libBacktraceRecording library and its APIs. Complete the
work of adding QueueItems to Queues and allow for the QueueItems
to be interrogated about their extended backtraces in turn.
There's still cleanup and documentation to do on this code but the
code is functional and I it's a good time to get the work-in-progress
checked in.
<rdar://problem/15314027>
llvm-svn: 200822
diff --git a/lldb/source/Target/Queue.cpp b/lldb/source/Target/Queue.cpp
index 21e1127..2b9d2a0 100644
--- a/lldb/source/Target/Queue.cpp
+++ b/lldb/source/Target/Queue.cpp
@@ -11,6 +11,7 @@
#include "lldb/Target/Queue.h"
#include "lldb/Target/QueueList.h"
#include "lldb/Target/Thread.h"
+#include "lldb/Target/SystemRuntime.h"
using namespace lldb;
using namespace lldb_private;
@@ -19,13 +20,15 @@
m_process_wp (),
m_queue_id (queue_id),
m_queue_name (),
- m_enqueued_items()
+ m_running_work_items_count(0),
+ m_pending_work_items_count(0),
+ m_pending_items(),
+ m_dispatch_queue_t_addr(LLDB_INVALID_ADDRESS)
{
if (queue_name)
m_queue_name = queue_name;
m_process_wp = process_sp;
- m_index_id = process_sp->AssignIndexIDToQueue (queue_id);
}
Queue::~Queue ()
@@ -50,7 +53,7 @@
uint32_t
Queue::GetIndexID ()
{
- return m_index_id;
+ return m_queue_id;
}
std::vector<lldb::ThreadSP>
@@ -70,3 +73,55 @@
}
return result;
}
+
+void
+Queue::SetNumRunningWorkItems (uint32_t count)
+{
+ m_running_work_items_count = count;
+}
+
+uint32_t
+Queue::GetNumRunningWorkItems () const
+{
+ return m_running_work_items_count;
+}
+
+
+void
+Queue::SetNumPendingWorkItems (uint32_t count)
+{
+ m_pending_work_items_count = count;
+}
+
+uint32_t
+Queue::GetNumPendingWorkItems () const
+{
+ return m_pending_work_items_count;
+}
+
+void
+Queue::SetLibdispatchQueueAddress (addr_t dispatch_queue_t_addr)
+{
+ m_dispatch_queue_t_addr = dispatch_queue_t_addr;
+}
+
+addr_t
+Queue::GetLibdispatchQueueAddress () const
+{
+ return m_dispatch_queue_t_addr;
+}
+
+
+const std::vector<lldb::QueueItemSP> &
+Queue::GetPendingItems ()
+{
+ if (m_pending_items.size() == 0)
+ {
+ ProcessSP process_sp = m_process_wp.lock();
+ if (process_sp && process_sp->GetSystemRuntime())
+ {
+ process_sp->GetSystemRuntime()->PopulatePendingItemsForQueue (this);
+ }
+ }
+ return m_pending_items;
+}