From ebafd2f1873d35cfc3f0063ee2feb7d36a01ba8f Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Fri, 15 Mar 2013 17:25:04 +0000 Subject: Fixing an issue where threads and frames could get out of sync and cause ValueObjects to fail to retrieve their values correctly llvm-svn: 177166 --- lldb/source/Target/ExecutionContext.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'lldb/source/Target/ExecutionContext.cpp') diff --git a/lldb/source/Target/ExecutionContext.cpp b/lldb/source/Target/ExecutionContext.cpp index ae3fc20d028..9ace4c93b17 100644 --- a/lldb/source/Target/ExecutionContext.cpp +++ b/lldb/source/Target/ExecutionContext.cpp @@ -815,22 +815,20 @@ lldb::StackFrameSP ExecutionContextRef::GetFrameSP () const { lldb::StackFrameSP frame_sp (m_frame_wp.lock()); - if (!frame_sp && m_stack_id.IsValid()) + if (frame_sp) { - lldb::ThreadSP thread_sp (GetThreadSP()); - if (thread_sp) - { - frame_sp = thread_sp->GetFrameWithStackID (m_stack_id); - m_frame_wp = frame_sp; - } - else - { - // If the thread that this frame was supposed to belong to is not valid, then - // return a NULL frame_sp. - frame_sp.reset(); - } + lldb::ThreadSP frame_thread_sp(frame_sp->GetThread()); + if (frame_thread_sp && frame_thread_sp->IsValid()) + return frame_sp; + } + lldb::ThreadSP thread_sp (GetThreadSP()); + if (thread_sp && thread_sp->IsValid()) + { + frame_sp = thread_sp->GetFrameWithStackID (m_stack_id); + m_frame_wp = frame_sp; + return frame_sp; } - return frame_sp; + return lldb::StackFrameSP(); } ExecutionContext -- cgit v1.2.3