Index: include/lldb/Expression/Expression.h =================================================================== --- include/lldb/Expression/Expression.h +++ include/lldb/Expression/Expression.h @@ -99,6 +99,16 @@ //------------------------------------------------------------------ lldb::addr_t StartAddress() { return m_jit_start_addr; } + //------------------------------------------------------------------ + /// Called to notify the expression that it is about to be executed. + //------------------------------------------------------------------ + virtual void WillStartExecuting() {} + + //------------------------------------------------------------------ + /// Called to notify the expression that its execution has finished. + //------------------------------------------------------------------ + virtual void DidFinishExecuting() {} + virtual ExpressionTypeSystemHelper *GetTypeSystemHelper() { return nullptr; } protected: Index: include/lldb/Target/ThreadPlanCallFunction.h =================================================================== --- include/lldb/Target/ThreadPlanCallFunction.h +++ include/lldb/Target/ThreadPlanCallFunction.h @@ -117,7 +117,7 @@ lldb::addr_t &start_load_addr, lldb::addr_t &function_load_addr); - void DoTakedown(bool success); + virtual void DoTakedown(bool success); void SetBreakpoints(); Index: include/lldb/Target/ThreadPlanCallUserExpression.h =================================================================== --- include/lldb/Target/ThreadPlanCallUserExpression.h +++ include/lldb/Target/ThreadPlanCallUserExpression.h @@ -48,6 +48,7 @@ } protected: + void DoTakedown(bool success) override; private: lldb::UserExpressionSP m_user_expression_sp; // This is currently just used to ensure the Index: source/Target/ThreadPlanCallUserExpression.cpp =================================================================== --- source/Target/ThreadPlanCallUserExpression.cpp +++ source/Target/ThreadPlanCallUserExpression.cpp @@ -48,6 +48,7 @@ // stop when done. SetIsMasterPlan(true); SetOkayToDiscard(false); + m_user_expression_sp->WillStartExecuting(); } ThreadPlanCallUserExpression::~ThreadPlanCallUserExpression() {} @@ -113,3 +114,8 @@ return stop_info_sp; } + +void ThreadPlanCallUserExpression::DoTakedown(bool success) { + ThreadPlanCallFunction::DoTakedown(success); + m_user_expression_sp->DidFinishExecuting(); +}