summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2013-10-18 17:11:02 +0000
committerJim Ingham <jingham@apple.com>2013-10-18 17:11:02 +0000
commitb1499243f355a12d735ea6f512dbc31c4fa733f2 (patch)
tree2da533aa825d6895ed67cc3958c74181c868a2d7
parent5010b6972c36c3ede5433d330fb1c7b3b3310318 (diff)
downloadbcm5719-llvm-b1499243f355a12d735ea6f512dbc31c4fa733f2.tar.gz
bcm5719-llvm-b1499243f355a12d735ea6f512dbc31c4fa733f2.zip
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> llvm-svn: 192987
-rw-r--r--lldb/include/lldb/Target/ThreadPlanCallFunction.h8
-rw-r--r--lldb/source/Target/Thread.cpp12
2 files changed, 16 insertions, 4 deletions
diff --git a/lldb/include/lldb/Target/ThreadPlanCallFunction.h b/lldb/include/lldb/Target/ThreadPlanCallFunction.h
index d747706c639..7b8efb60b88 100644
--- a/lldb/include/lldb/Target/ThreadPlanCallFunction.h
+++ b/lldb/include/lldb/Target/ThreadPlanCallFunction.h
@@ -136,7 +136,13 @@ public:
virtual bool
RestoreThreadState();
-
+
+ virtual void
+ ThreadDestroyed ()
+ {
+ m_takedown_done = true;
+ }
+
protected:
void ReportRegisterState (const char *message);
diff --git a/lldb/source/Target/Thread.cpp b/lldb/source/Target/Thread.cpp
index 1e33565a4c5..df0c143db52 100644
--- a/lldb/source/Target/Thread.cpp
+++ b/lldb/source/Target/Thread.cpp
@@ -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();
OpenPOWER on IntegriCloud