2013-12-13 08:29:16 +08:00
|
|
|
//===-- QueueItem.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/Queue.h"
|
2014-02-05 13:44:54 +08:00
|
|
|
#include "lldb/Target/Process.h"
|
2013-12-13 08:29:16 +08:00
|
|
|
#include "lldb/Target/QueueItem.h"
|
2014-02-05 13:44:54 +08:00
|
|
|
#include "lldb/Target/SystemRuntime.h"
|
2013-12-13 08:29:16 +08:00
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
|
|
|
QueueItem::QueueItem (QueueSP queue_sp) :
|
2013-12-18 08:58:23 +08:00
|
|
|
m_queue_wp (),
|
2013-12-13 08:29:16 +08:00
|
|
|
m_kind (eQueueItemKindUnknown),
|
2014-02-05 13:44:54 +08:00
|
|
|
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),
|
|
|
|
m_target_queue_id (LLDB_INVALID_QUEUE_ID),
|
|
|
|
m_stop_id (0),
|
|
|
|
m_backtrace(),
|
|
|
|
m_thread_label(),
|
|
|
|
m_queue_label(),
|
|
|
|
m_target_queue_label()
|
2013-12-13 08:29:16 +08:00
|
|
|
{
|
2013-12-18 08:58:23 +08:00
|
|
|
m_queue_wp = queue_sp;
|
2013-12-13 08:29:16 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
QueueItem::~QueueItem ()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
QueueItemKind
|
|
|
|
QueueItem::GetKind() const
|
|
|
|
{
|
|
|
|
return m_kind;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
QueueItem::SetKind (QueueItemKind item_kind)
|
|
|
|
{
|
|
|
|
m_kind = item_kind;
|
|
|
|
}
|
|
|
|
|
|
|
|
Address &
|
|
|
|
QueueItem::GetAddress ()
|
|
|
|
{
|
|
|
|
return m_address;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
QueueItem::SetAddress (Address addr)
|
|
|
|
{
|
|
|
|
m_address = addr;
|
|
|
|
}
|
|
|
|
|
|
|
|
ThreadSP
|
|
|
|
QueueItem::GetExtendedBacktraceThread (ConstString type)
|
|
|
|
{
|
2014-02-05 13:44:54 +08:00
|
|
|
ThreadSP return_thread;
|
|
|
|
QueueSP queue_sp = m_queue_wp.lock();
|
|
|
|
if (queue_sp)
|
|
|
|
{
|
|
|
|
ProcessSP process_sp = queue_sp->GetProcess();
|
|
|
|
if (process_sp && process_sp->GetSystemRuntime())
|
|
|
|
{
|
|
|
|
return_thread = process_sp->GetSystemRuntime()->GetExtendedBacktraceForQueueItem (this->shared_from_this(), type);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return return_thread;
|
2013-12-13 08:29:16 +08:00
|
|
|
}
|