ThreadPlanCallUserExpression.h revision 3e2ef48cd65658162791134b34c3c1fb9e8c8991
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/Expression/ClangUserExpression.h"
19#include "lldb/Target/Thread.h"
20#include "lldb/Target/ThreadPlan.h"
21#include "lldb/Target/ThreadPlanCallFunction.h"
22
23namespace lldb_private {
24
25class ThreadPlanCallUserExpression : public ThreadPlanCallFunction
26{
27public:
28    ThreadPlanCallUserExpression (Thread &thread,
29                            Address &function,
30                            lldb::addr_t arg,
31                            bool stop_other_threads,
32                            bool discard_on_error,
33                            lldb::addr_t *this_arg,
34                            lldb::addr_t *cmd_arg,
35                            ClangUserExpression::ClangUserExpressionSP &user_expression_sp);
36
37    virtual
38    ~ThreadPlanCallUserExpression ();
39
40    virtual void
41    GetDescription (Stream *s, lldb::DescriptionLevel level);
42
43    virtual void
44    WillPop ()
45    {
46        ThreadPlanCallFunction::WillPop();
47        if (m_user_expression_sp)
48            m_user_expression_sp.reset();
49    }
50
51protected:
52private:
53    ClangUserExpression::ClangUserExpressionSP m_user_expression_sp;  // This is currently just used to ensure the
54                                                          // User expression the initiated this ThreadPlan
55                                                          // lives as long as the thread plan does.
56    DISALLOW_COPY_AND_ASSIGN (ThreadPlanCallUserExpression);
57};
58
59} // namespace lldb_private
60
61#endif  // liblldb_ThreadPlanCallUserExpression_h_
62