]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Target/ThreadPlanCallUserExpression.h
MFV r309299:
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Target / ThreadPlanCallUserExpression.h
1 //===-- ThreadPlanCallUserExpression.h --------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #ifndef liblldb_ThreadPlanCallUserExpression_h_
11 #define liblldb_ThreadPlanCallUserExpression_h_
12
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/lldb-private.h"
18 #include "lldb/Target/Thread.h"
19 #include "lldb/Target/ThreadPlan.h"
20 #include "lldb/Target/ThreadPlanCallFunction.h"
21
22 #include "llvm/ADT/ArrayRef.h"
23
24 namespace lldb_private {
25
26 class ThreadPlanCallUserExpression : public ThreadPlanCallFunction
27 {
28 public:
29     ThreadPlanCallUserExpression (Thread &thread,
30                                   Address &function,
31                                   llvm::ArrayRef<lldb::addr_t> args,
32                                   const EvaluateExpressionOptions &options,
33                                   lldb::UserExpressionSP &user_expression_sp);
34     
35     ~ThreadPlanCallUserExpression() override;
36
37     void
38     GetDescription(Stream *s, lldb::DescriptionLevel level) override;
39     
40     void
41     WillPop() override;
42
43     lldb::StopInfoSP
44     GetRealStopInfo() override;
45     
46     bool
47     MischiefManaged() override;
48     
49     void
50     TransferExpressionOwnership ()
51     {
52         m_manage_materialization = true;
53     }
54     
55     lldb::ExpressionVariableSP
56     GetExpressionVariable() override
57     {
58         return m_result_var_sp;
59     }
60     
61 protected:
62 private:
63     lldb::UserExpressionSP m_user_expression_sp;    // This is currently just used to ensure the
64                                                          // User expression the initiated this ThreadPlan
65                                                          // lives as long as the thread plan does.
66     bool m_manage_materialization = false;
67     lldb::ExpressionVariableSP m_result_var_sp;     // If we are left to manage the materialization,
68                                                          // then stuff the result expression variable here.
69
70     DISALLOW_COPY_AND_ASSIGN (ThreadPlanCallUserExpression);
71 };
72
73 } // namespace lldb_private
74
75 #endif // liblldb_ThreadPlanCallUserExpression_h_