diff options
Diffstat (limited to 'contrib/llvm/tools/lldb/source/Target/QueueItem.cpp')
-rw-r--r-- | contrib/llvm/tools/lldb/source/Target/QueueItem.cpp | 85 |
1 files changed, 82 insertions, 3 deletions
diff --git a/contrib/llvm/tools/lldb/source/Target/QueueItem.cpp b/contrib/llvm/tools/lldb/source/Target/QueueItem.cpp index bb67628..002187b 100644 --- a/contrib/llvm/tools/lldb/source/Target/QueueItem.cpp +++ b/contrib/llvm/tools/lldb/source/Target/QueueItem.cpp @@ -15,10 +15,13 @@ using namespace lldb; using namespace lldb_private; -QueueItem::QueueItem (QueueSP queue_sp) : +QueueItem::QueueItem (QueueSP queue_sp, ProcessSP process_sp, lldb::addr_t item_ref, lldb_private::Address address) : m_queue_wp (), + m_process_wp (), + m_item_ref (item_ref), + m_address (address), + m_have_fetched_entire_item (false), m_kind (eQueueItemKindUnknown), - m_address (), m_item_that_enqueued_this_ref (LLDB_INVALID_ADDRESS), m_enqueueing_thread_id (LLDB_INVALID_THREAD_ID), m_enqueueing_queue_id (LLDB_INVALID_QUEUE_ID), @@ -30,6 +33,7 @@ QueueItem::QueueItem (QueueSP queue_sp) : m_target_queue_label() { m_queue_wp = queue_sp; + m_process_wp = process_sp; } QueueItem::~QueueItem () @@ -37,8 +41,9 @@ QueueItem::~QueueItem () } QueueItemKind -QueueItem::GetKind() const +QueueItem::GetKind() { + FetchEntireItem (); return m_kind; } @@ -63,6 +68,7 @@ QueueItem::SetAddress (Address addr) ThreadSP QueueItem::GetExtendedBacktraceThread (ConstString type) { + FetchEntireItem (); ThreadSP return_thread; QueueSP queue_sp = m_queue_wp.lock(); if (queue_sp) @@ -75,3 +81,76 @@ QueueItem::GetExtendedBacktraceThread (ConstString type) } return return_thread; } + +lldb::addr_t +QueueItem::GetItemThatEnqueuedThis () +{ + FetchEntireItem (); + return m_item_that_enqueued_this_ref; +} + +lldb::tid_t +QueueItem::GetEnqueueingThreadID () +{ + FetchEntireItem (); + return m_enqueueing_thread_id; +} + +lldb::queue_id_t +QueueItem::GetEnqueueingQueueID () +{ + FetchEntireItem (); + return m_enqueueing_queue_id; +} + +uint32_t +QueueItem::GetStopID () +{ + FetchEntireItem (); + return m_stop_id; +} + +std::vector<lldb::addr_t> & +QueueItem::GetEnqueueingBacktrace () +{ + FetchEntireItem (); + return m_backtrace; +} + +std::string +QueueItem::GetThreadLabel () +{ + FetchEntireItem (); + return m_thread_label; +} + +std::string +QueueItem::GetQueueLabel () +{ + FetchEntireItem (); + return m_queue_label; +} + + +ProcessSP +QueueItem::GetProcessSP() +{ + return m_process_wp.lock (); +} + +void +QueueItem::FetchEntireItem() +{ + if (m_have_fetched_entire_item == true) + return; + ProcessSP process_sp = m_process_wp.lock(); + if (process_sp) + { + SystemRuntime *runtime = process_sp->GetSystemRuntime(); + if (runtime) + { + runtime->CompleteQueueItem (this, m_item_ref); + m_have_fetched_entire_item = true; + } + } +} |