Index: lldb/include/lldb/Target/Thread.h =================================================================== --- lldb/include/lldb/Target/Thread.h +++ lldb/include/lldb/Target/Thread.h @@ -218,7 +218,7 @@ virtual void RefreshStateAfterStop() = 0; - void SelectMostRelevantFrame(); + void SelectMostRelevantFrame(lldb::StackFrameSP first_frame); std::string GetStopDescription(); Index: lldb/source/Target/StackFrameList.cpp =================================================================== --- lldb/source/Target/StackFrameList.cpp +++ lldb/source/Target/StackFrameList.cpp @@ -547,6 +547,9 @@ curr_frame_address = next_frame_address; } } + + if (idx == 0) + m_thread.SelectMostRelevantFrame(unwind_frame_sp); } while (m_frames.size() - 1 < end_idx); // Don't try to merge till you've calculated all the frames in this stack. Index: lldb/source/Target/Thread.cpp =================================================================== --- lldb/source/Target/Thread.cpp +++ lldb/source/Target/Thread.cpp @@ -578,15 +578,9 @@ return raw_stop_description; } -void Thread::SelectMostRelevantFrame() { +void Thread::SelectMostRelevantFrame(lldb::StackFrameSP first_frame) { Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_THREAD); - - auto frames_list_sp = GetStackFrameList(); - - // Only the top frame should be recognized. - auto frame_sp = frames_list_sp->GetFrameAtIndex(0); - - auto recognized_frame_sp = frame_sp->GetRecognizedFrame(); + auto recognized_frame_sp = first_frame->GetRecognizedFrame(); if (!recognized_frame_sp) { LLDB_LOG(log, "Frame #0 not recognized"); @@ -606,8 +600,6 @@ void Thread::WillStop() { ThreadPlan *current_plan = GetCurrentPlan(); - SelectMostRelevantFrame(); - // FIXME: I may decide to disallow threads with no plans. In which // case this should go to an assert.