From d9e416c0ea61c13440e99fdab86e44c6e71a8eff Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Sat, 18 Feb 2012 05:35:26 +0000 Subject: 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 --- lldb/source/Target/Thread.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'lldb/source/Target/Thread.cpp') diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp index 1c13b3df631..7423249f36b 100644 --- a/lldb/source/Target/Thread.cpp +++ b/lldb/source/Target/Thread.cpp @@ -1015,28 +1015,28 @@ Thread::DumpThreadPlans (lldb_private::Stream *s) const } -Target * +TargetSP Thread::CalculateTarget () { return m_process.CalculateTarget(); } -Process * +ProcessSP Thread::CalculateProcess () { - return &m_process; + return m_process.shared_from_this(); } -Thread * +ThreadSP Thread::CalculateThread () { - return this; + return shared_from_this(); } -StackFrame * +StackFrameSP Thread::CalculateStackFrame () { - return NULL; + return StackFrameSP(); } void -- cgit v1.2.3