aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm/tools/lldb/source/Target/Queue.cpp
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2014-02-26 16:09:54 +0000
committerEd Maste <emaste@FreeBSD.org>2014-02-26 16:09:54 +0000
commit6ec4f0a5fade164dbdd2da5688b1547f7d2e1bee (patch)
tree2051bbbd01801966a37ebc937a241c33ca0e6b79 /contrib/llvm/tools/lldb/source/Target/Queue.cpp
parent276ffe2d97f464a3e5586910b8727f0f2fcded4e (diff)
parent6fcb82420be1fd6d56aeb736ae5a369fa0946bb4 (diff)
downloadsrc-6ec4f0a5fade164dbdd2da5688b1547f7d2e1bee.tar.gz
src-6ec4f0a5fade164dbdd2da5688b1547f7d2e1bee.zip
Update LLDB snapshot to upstream r202189
Highlights include (upstream revs in parens): - Improvements to the remote GDB protocol client (r196610, r197579, r197857, r200072, and others) - Bug fixes for big-endian targets (r196808) - Initial support for libdispatch (GCD) queues in the debuggee (r197190) - Add "step-avoid-libraries" setting (r199943) - IO subsystem improvements (including initial work on a curses gui) (r200263) - Support hardware watchpoints on FreeBSD (r201706) - Improved unwinding through hand-written assembly functions (r201839) - Handle DW_TAG_unspecified_parameters for variadic functions (r202061) - Fix Ctrl+C interrupting a running inferior process (r202086, r202154) - Various bug fixes for memory leaks, LLDB segfaults, the C++ demangler, ELF core files, DWARF debug info, and others. Sponsored by: DARPA, AFRL
Notes
Notes: svn path=/head/; revision=262528
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Target/Queue.cpp')
-rw-r--r--contrib/llvm/tools/lldb/source/Target/Queue.cpp127
1 files changed, 127 insertions, 0 deletions
diff --git a/contrib/llvm/tools/lldb/source/Target/Queue.cpp b/contrib/llvm/tools/lldb/source/Target/Queue.cpp
new file mode 100644
index 000000000000..2b9d2a0ed9a4
--- /dev/null
+++ b/contrib/llvm/tools/lldb/source/Target/Queue.cpp
@@ -0,0 +1,127 @@
+//===-- Queue.cpp -----------------------------------------------*- C++ -*-===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+
+#include "lldb/Target/Process.h"
+#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;
+
+Queue::Queue (ProcessSP process_sp, lldb::queue_id_t queue_id, const char *queue_name) :
+ m_process_wp (),
+ m_queue_id (queue_id),
+ m_queue_name (),
+ 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;
+}
+
+Queue::~Queue ()
+{
+}
+
+queue_id_t
+Queue::GetID ()
+{
+ return m_queue_id;
+}
+
+const char *
+Queue::GetName ()
+{
+ const char *result = NULL;
+ if (m_queue_name.size() > 0)
+ result = m_queue_name.c_str();
+ return result;
+}
+
+uint32_t
+Queue::GetIndexID ()
+{
+ return m_queue_id;
+}
+
+std::vector<lldb::ThreadSP>
+Queue::GetThreads ()
+{
+ std::vector<ThreadSP> result;
+ ProcessSP process_sp = m_process_wp.lock();
+ if (process_sp.get ())
+ {
+ for (ThreadSP thread_sp : process_sp->Threads())
+ {
+ if (thread_sp->GetQueueID() == m_queue_id)
+ {
+ result.push_back (thread_sp);
+ }
+ }
+ }
+ 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;
+}