summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-03-15 17:25:04 +0000
committerEnrico Granata <egranata@apple.com>2013-03-15 17:25:04 +0000
commitebafd2f1873d35cfc3f0063ee2feb7d36a01ba8f (patch)
treee9d2b2a58f2d460de7efc5fd1c94416e2116231d /lldb/source/Target
parentc8541f2bf21c33a567d8dcaf163bc6071311fd58 (diff)
downloadbcm5719-llvm-ebafd2f1873d35cfc3f0063ee2feb7d36a01ba8f.tar.gz
bcm5719-llvm-ebafd2f1873d35cfc3f0063ee2feb7d36a01ba8f.zip
<rdar://problem/13194155>
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
Diffstat (limited to 'lldb/source/Target')
-rw-r--r--lldb/source/Target/ExecutionContext.cpp26
-rw-r--r--lldb/source/Target/StackFrameList.cpp4
2 files changed, 16 insertions, 14 deletions
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
diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp
index 0a45d33ea65..913456d2419 100644
--- a/lldb/source/Target/StackFrameList.cpp
+++ b/lldb/source/Target/StackFrameList.cpp
@@ -250,6 +250,10 @@ StackFrameList::SetCurrentInlinedDepth (uint32_t new_depth)
void
StackFrameList::GetFramesUpTo(uint32_t end_idx)
{
+ // this makes sure we do not fetch frames for an invalid thread
+ if (m_thread.IsValid() == false)
+ return;
+
// We've already gotten more frames than asked for, or we've already finished unwinding, return.
if (m_frames.size() > end_idx || GetAllFramesFetched())
return;
OpenPOWER on IntegriCloud