]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Target/ThreadPlanCallUserExpression.h
Merge llvm, clang, compiler-rt, libc++, libunwind, lld, lldb and openmp
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Target / ThreadPlanCallUserExpression.h
1 //===-- ThreadPlanCallUserExpression.h --------------------------------*- C++
2 //-*-===//
3 //
4 //                     The LLVM Compiler Infrastructure
5 //
6 // This file is distributed under the University of Illinois Open Source
7 // License. See LICENSE.TXT for details.
8 //
9 //===----------------------------------------------------------------------===//
10
11 #ifndef liblldb_ThreadPlanCallUserExpression_h_
12 #define liblldb_ThreadPlanCallUserExpression_h_
13
14 #include "lldb/Target/Thread.h"
15 #include "lldb/Target/ThreadPlan.h"
16 #include "lldb/Target/ThreadPlanCallFunction.h"
17 #include "lldb/lldb-private.h"
18
19 #include "llvm/ADT/ArrayRef.h"
20
21 namespace lldb_private {
22
23 class ThreadPlanCallUserExpression : public ThreadPlanCallFunction {
24 public:
25   ThreadPlanCallUserExpression(Thread &thread, Address &function,
26                                llvm::ArrayRef<lldb::addr_t> args,
27                                const EvaluateExpressionOptions &options,
28                                lldb::UserExpressionSP &user_expression_sp);
29
30   ~ThreadPlanCallUserExpression() override;
31
32   void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
33
34   void DidPush() override;
35
36   void WillPop() override;
37
38   lldb::StopInfoSP GetRealStopInfo() override;
39
40   bool MischiefManaged() override;
41
42   void TransferExpressionOwnership() { m_manage_materialization = true; }
43
44   lldb::ExpressionVariableSP GetExpressionVariable() override {
45     return m_result_var_sp;
46   }
47
48 protected:
49   void DoTakedown(bool success) override;
50 private:
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.
59
60   DISALLOW_COPY_AND_ASSIGN(ThreadPlanCallUserExpression);
61 };
62
63 } // namespace lldb_private
64
65 #endif // liblldb_ThreadPlanCallUserExpression_h_