Author: jingham Date: Fri Oct 18 12:11:02 2013 New Revision: 192987 URL: http://llvm.org/viewvc/llvm-project?rev=192987&view=rev Log: Make sure the CallFunction Thread plans don't try to do DoTakedown if their thread has gone away by the time they get around to doing it.
<rdar://problem/15245544> Modified: lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h lldb/trunk/source/Target/Thread.cpp Modified: lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h?rev=192987&r1=192986&r2=192987&view=diff ============================================================================== --- lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h (original) +++ lldb/trunk/include/lldb/Target/ThreadPlanCallFunction.h Fri Oct 18 12:11:02 2013 @@ -136,7 +136,13 @@ public: virtual bool RestoreThreadState(); - + + virtual void + ThreadDestroyed () + { + m_takedown_done = true; + } + protected: void ReportRegisterState (const char *message); Modified: lldb/trunk/source/Target/Thread.cpp URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Thread.cpp?rev=192987&r1=192986&r2=192987&view=diff ============================================================================== --- lldb/trunk/source/Target/Thread.cpp (original) +++ lldb/trunk/source/Target/Thread.cpp Fri Oct 18 12:11:02 2013 @@ -282,12 +282,18 @@ Thread::~Thread() void Thread::DestroyThread () { - // Tell any plans on the plan stack that the thread is being destroyed since - // any active plans that have a thread go away in the middle of might need - // to do cleanup. + // Tell any plans on the plan stacks that the thread is being destroyed since + // any plans that have a thread go away in the middle of might need + // to do cleanup, or in some cases NOT do cleanup... for (auto plan : m_plan_stack) plan->ThreadDestroyed(); + for (auto plan : m_discarded_plan_stack) + plan->ThreadDestroyed(); + + for (auto plan : m_completed_plan_stack) + plan->ThreadDestroyed(); + m_destroy_called = true; m_plan_stack.clear(); m_discarded_plan_stack.clear(); _______________________________________________ lldb-commits mailing list lldb-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits