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 @@ -35,6 +35,8 @@ void GetDescription(Stream *s, lldb::DescriptionLevel level) override; + void DidPush() override; + void WillPop() override; lldb::StopInfoSP GetRealStopInfo() override; @@ -48,6 +50,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 @@ -60,6 +60,12 @@ ThreadPlanCallFunction::GetDescription(s, level); } +void ThreadPlanCallUserExpression::DidPush() { + ThreadPlanCallFunction::DidPush(); + if (m_user_expression_sp) + m_user_expression_sp->WillStartExecuting(); +} + void ThreadPlanCallUserExpression::WillPop() { ThreadPlanCallFunction::WillPop(); if (m_user_expression_sp) @@ -113,3 +119,8 @@ return stop_info_sp; } + +void ThreadPlanCallUserExpression::DoTakedown(bool success) { + ThreadPlanCallFunction::DoTakedown(success); + m_user_expression_sp->DidFinishExecuting(); +}