forked from OSchip/llvm-project
Modify the impl of ThreadList::GetSelectedThread() so that it tries to fetch the
m_selected_tid thread first, check to see if it is valid (might be null if the thread just exited), and if not select/return the 0th thread instead. llvm-svn: 138591
This commit is contained in:
parent
689053770b
commit
943ddb730b
|
@ -545,9 +545,13 @@ ThreadSP
|
|||
ThreadList::GetSelectedThread ()
|
||||
{
|
||||
Mutex::Locker locker(m_threads_mutex);
|
||||
if (m_selected_tid == LLDB_INVALID_THREAD_ID)
|
||||
SetSelectedThreadByID(m_threads[0]->GetID());
|
||||
return FindThreadByID(m_selected_tid);
|
||||
ThreadSP thread_sp = FindThreadByID(m_selected_tid);
|
||||
if (!thread_sp.get())
|
||||
{
|
||||
m_selected_tid = m_threads[0]->GetID();
|
||||
thread_sp = m_threads[0];
|
||||
}
|
||||
return thread_sp;
|
||||
}
|
||||
|
||||
bool
|
||||
|
|
Loading…
Reference in New Issue