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_
16 // Other libraries and framework includes
18 #include "lldb/Target/Thread.h"
19 #include "lldb/Target/ThreadPlan.h"
20 #include "lldb/Target/ThreadPlanCallFunction.h"
21 #include "lldb/lldb-private.h"
23 #include "llvm/ADT/ArrayRef.h"
25 namespace lldb_private {
27 class ThreadPlanCallUserExpression : public ThreadPlanCallFunction {
29 ThreadPlanCallUserExpression(Thread &thread, Address &function,
30 llvm::ArrayRef<lldb::addr_t> args,
31 const EvaluateExpressionOptions &options,
32 lldb::UserExpressionSP &user_expression_sp);
34 ~ThreadPlanCallUserExpression() override;
36 void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
38 void DidPush() override;
40 void WillPop() override;
42 lldb::StopInfoSP GetRealStopInfo() override;
44 bool MischiefManaged() override;
46 void TransferExpressionOwnership() { m_manage_materialization = true; }
48 lldb::ExpressionVariableSP GetExpressionVariable() override {
49 return m_result_var_sp;
53 void DoTakedown(bool success) override;
55 lldb::UserExpressionSP
56 m_user_expression_sp; // This is currently just used to ensure the
57 // User expression the initiated this ThreadPlan
58 // lives as long as the thread plan does.
59 bool m_manage_materialization = false;
60 lldb::ExpressionVariableSP
61 m_result_var_sp; // If we are left to manage the materialization,
62 // then stuff the result expression variable here.
64 DISALLOW_COPY_AND_ASSIGN(ThreadPlanCallUserExpression);
67 } // namespace lldb_private
69 #endif // liblldb_ThreadPlanCallUserExpression_h_