When a client asks for a queue pending item's extended backtrace,
hold a strong pointer to that extended backtrace thread in the Process just like we do for asking a thread's extended backtrace. Also, give extended backtrace threads an invalid ThreadIndexID number. We'll still give them valid thread_id's. Clients who want to know the original thread's IndexID can call GetExtendedBacktraceOriginatingIndexID(). <rdar://problem/16126034> llvm-svn: 203088
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include "lldb/API/SBQueueItem.h"
|
||||
#include "lldb/API/SBThread.h"
|
||||
#include "lldb/Core/Address.h"
|
||||
#include "lldb/Target/Process.h"
|
||||
#include "lldb/Target/QueueItem.h"
|
||||
#include "lldb/Target/Thread.h"
|
||||
|
||||
@@ -108,12 +109,20 @@ SBQueueItem::GetExtendedBacktraceThread (const char *type)
|
||||
SBThread result;
|
||||
if (m_queue_item_sp)
|
||||
{
|
||||
ThreadSP thread_sp;
|
||||
ConstString type_const (type);
|
||||
thread_sp = m_queue_item_sp->GetExtendedBacktraceThread (type_const);
|
||||
if (thread_sp)
|
||||
ProcessSP process_sp = m_queue_item_sp->GetProcessSP();
|
||||
Process::StopLocker stop_locker;
|
||||
if (process_sp && stop_locker.TryLock(&process_sp->GetRunLock()))
|
||||
{
|
||||
result.SetThread (thread_sp);
|
||||
ThreadSP thread_sp;
|
||||
ConstString type_const (type);
|
||||
thread_sp = m_queue_item_sp->GetExtendedBacktraceThread (type_const);
|
||||
if (thread_sp)
|
||||
{
|
||||
// Save this in the Process' ExtendedThreadList so a strong pointer retains the
|
||||
// object
|
||||
process_sp->GetExtendedThreadList().AddThread (thread_sp);
|
||||
result.SetThread (thread_sp);
|
||||
}
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user