diff options
author | Greg Clayton <gclayton@apple.com> | 2012-02-18 05:35:26 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-02-18 05:35:26 +0000 |
commit | d9e416c0ea61c13440e99fdab86e44c6e71a8eff (patch) | |
tree | 7cdcdc10fb941cb0658a5a651a5f6ceb2cd40e63 /lldb/source/Target/StackFrameList.cpp | |
parent | 0dea49e324ecb836ddad859495bde8ffc48a8ae0 (diff) | |
download | bcm5719-llvm-d9e416c0ea61c13440e99fdab86e44c6e71a8eff.tar.gz bcm5719-llvm-d9e416c0ea61c13440e99fdab86e44c6e71a8eff.zip |
The second part in thread hardening the internals of LLDB where we make
the lldb_private::StackFrame objects hold onto a weak pointer to the thread
object. The lldb_private::StackFrame objects the the most volatile objects
we have as when we are doing single stepping, frames can often get lost or
thrown away, only to be re-created as another object that still refers to the
same frame. We have another bug tracking that. But we need to be able to
have frames no longer be able to get the thread when they are not part of
a thread anymore, and this is the first step (this fix makes that possible
but doesn't implement it yet).
Also changed lldb_private::ExecutionContextScope to return shared pointers to
all objects in the execution context to further thread harden the internals.
llvm-svn: 150871
Diffstat (limited to 'lldb/source/Target/StackFrameList.cpp')
-rw-r--r-- | lldb/source/Target/StackFrameList.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lldb/source/Target/StackFrameList.cpp b/lldb/source/Target/StackFrameList.cpp index b69cad2f9c5..27383d87ef7 100644 --- a/lldb/source/Target/StackFrameList.cpp +++ b/lldb/source/Target/StackFrameList.cpp @@ -89,9 +89,9 @@ StackFrameList::GetNumFrames (bool can_create) { cfa = m_thread.m_reg_context_sp->GetSP(); m_thread.GetRegisterContext(); - unwind_frame_sp.reset (new StackFrame (m_frames.size(), + unwind_frame_sp.reset (new StackFrame (m_thread.shared_from_this(), + m_frames.size(), idx, - m_thread, m_thread.m_reg_context_sp, cfa, m_thread.m_reg_context_sp->GetPC(), @@ -108,7 +108,7 @@ StackFrameList::GetNumFrames (bool can_create) { const bool success = unwinder->GetFrameInfoAtIndex(idx, cfa, pc); assert (success); - unwind_frame_sp.reset (new StackFrame (m_frames.size(), idx, m_thread, cfa, pc, NULL)); + unwind_frame_sp.reset (new StackFrame (m_thread.shared_from_this(), m_frames.size(), idx, cfa, pc, NULL)); m_frames.push_back (unwind_frame_sp); } @@ -130,9 +130,9 @@ StackFrameList::GetNumFrames (bool can_create) while (unwind_sc.GetParentOfInlinedScope(curr_frame_address, next_frame_sc, next_frame_address)) { - StackFrameSP frame_sp(new StackFrame (m_frames.size(), + StackFrameSP frame_sp(new StackFrame (m_thread.shared_from_this(), + m_frames.size(), idx, - m_thread, unwind_frame_sp->GetRegisterContextSP (), cfa, next_frame_address, @@ -264,9 +264,9 @@ StackFrameList::GetFrameAtIndex (uint32_t idx) // context with the stack frame at index zero. m_thread.GetRegisterContext(); assert (m_thread.m_reg_context_sp.get()); - frame_sp.reset (new StackFrame (0, + frame_sp.reset (new StackFrame (m_thread.shared_from_this(), 0, - m_thread, + 0, m_thread.m_reg_context_sp, m_thread.m_reg_context_sp->GetSP(), m_thread.m_reg_context_sp->GetPC(), @@ -289,7 +289,7 @@ StackFrameList::GetFrameAtIndex (uint32_t idx) addr_t pc, cfa; if (unwinder->GetFrameInfoAtIndex(idx, cfa, pc)) { - frame_sp.reset (new StackFrame (idx, idx, m_thread, cfa, pc, NULL)); + frame_sp.reset (new StackFrame (m_thread.shared_from_this(), idx, idx, cfa, pc, NULL)); Function *function = frame_sp->GetSymbolContext (eSymbolContextFunction).function; if (function) |