From bda4e5eb33be438f73ea698787d3a750f0099fcc Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Tue, 18 Jan 2011 01:58:06 +0000 Subject: [PATCH] In ThreadPlanCallFunction, do the Takedown right when the thread plan gets popped. When the function call is discarded (e.g. when it crashes and discard_on_error is true) the plan gets discarded. You need to make sure that the stack gets restored right then, and not wait till you start again and the thread plan stack is cleared. llvm-svn: 123716 --- lldb/include/lldb/Target/ThreadPlanCallFunction.h | 3 +++ lldb/source/Target/ThreadPlanCallFunction.cpp | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/lldb/include/lldb/Target/ThreadPlanCallFunction.h b/lldb/include/lldb/Target/ThreadPlanCallFunction.h index 2ef39e65249f..f9dfaa26cfc1 100644 --- a/lldb/include/lldb/Target/ThreadPlanCallFunction.h +++ b/lldb/include/lldb/Target/ThreadPlanCallFunction.h @@ -69,6 +69,9 @@ public: { return true; } + + virtual void + WillPop (); protected: private: diff --git a/lldb/source/Target/ThreadPlanCallFunction.cpp b/lldb/source/Target/ThreadPlanCallFunction.cpp index a662ea0589dc..9619f56bb35a 100644 --- a/lldb/source/Target/ThreadPlanCallFunction.cpp +++ b/lldb/source/Target/ThreadPlanCallFunction.cpp @@ -128,6 +128,13 @@ ThreadPlanCallFunction::DoTakedown () ClearBreakpoints(); } +void +ThreadPlanCallFunction::WillPop () +{ + if (m_valid && !IsPlanComplete()) + DoTakedown(); +} + void ThreadPlanCallFunction::GetDescription (Stream *s, lldb::DescriptionLevel level) {