1 //===-- ThreadPlanCallUserExpression.h --------------------------------*- C++
4 // The LLVM Compiler Infrastructure
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 #ifndef liblldb_ThreadPlanCallUserExpression_h_
12 #define liblldb_ThreadPlanCallUserExpression_h_
14 #include "lldb/Target/Thread.h"
15 #include "lldb/Target/ThreadPlan.h"
16 #include "lldb/Target/ThreadPlanCallFunction.h"
17 #include "lldb/lldb-private.h"
19 #include "llvm/ADT/ArrayRef.h"
21 namespace lldb_private {
23 class ThreadPlanCallUserExpression : public ThreadPlanCallFunction {
25 ThreadPlanCallUserExpression(Thread &thread, Address &function,
26 llvm::ArrayRef<lldb::addr_t> args,
27 const EvaluateExpressionOptions &options,
28 lldb::UserExpressionSP &user_expression_sp);
30 ~ThreadPlanCallUserExpression() override;
32 void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
34 void DidPush() override;
36 void WillPop() override;
38 lldb::StopInfoSP GetRealStopInfo() override;
40 bool MischiefManaged() override;
42 void TransferExpressionOwnership() { m_manage_materialization = true; }
44 lldb::ExpressionVariableSP GetExpressionVariable() override {
45 return m_result_var_sp;
49 void DoTakedown(bool success) override;
51 lldb::UserExpressionSP
52 m_user_expression_sp; // This is currently just used to ensure the
53 // User expression the initiated this ThreadPlan
54 // lives as long as the thread plan does.
55 bool m_manage_materialization = false;
56 lldb::ExpressionVariableSP
57 m_result_var_sp; // If we are left to manage the materialization,
58 // then stuff the result expression variable here.
60 DISALLOW_COPY_AND_ASSIGN(ThreadPlanCallUserExpression);
63 } // namespace lldb_private
65 #endif // liblldb_ThreadPlanCallUserExpression_h_