ThreadPlanCallFunction.h revision 29756d452be39535ded2cff50d9db4df46fe6400
1//===-- ThreadPlanCallFunction.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_ThreadPlanCallFunction_h_
11#define liblldb_ThreadPlanCallFunction_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
21namespace lldb_private {
22
23class ThreadPlanCallFunction : public ThreadPlan
24{
25public:
26    ThreadPlanCallFunction (Thread &thread,
27                            Address &function,
28                            lldb::addr_t arg,
29                            bool stop_other_threads,
30                            bool discard_on_error = true,
31                            lldb::addr_t *this_arg = 0);
32
33    ThreadPlanCallFunction (Thread &thread,
34                            Address &function,
35                            ValueList &args,
36                            bool stop_other_threads,
37                            bool discard_on_error = true);
38
39    virtual
40    ~ThreadPlanCallFunction ();
41
42    virtual void
43    GetDescription (Stream *s, lldb::DescriptionLevel level);
44
45    virtual bool
46    ValidatePlan (Stream *error);
47
48    virtual bool
49    PlanExplainsStop ();
50
51    virtual bool
52    ShouldStop (Event *event_ptr);
53
54    virtual bool
55    StopOthers ();
56
57    virtual void
58    SetStopOthers (bool new_value);
59
60    virtual lldb::StateType
61    RunState ();
62
63    virtual void
64    DidPush ();
65
66    virtual bool
67    WillStop ();
68
69    virtual bool
70    MischiefManaged ();
71
72    virtual bool
73    IsMasterPlan()
74    {
75        return true;
76    }
77
78protected:
79private:
80    void
81    SetBreakpoints ();
82
83    void
84    ClearBreakpoints ();
85
86    bool
87    BreakpointsExplainStop ();
88
89    bool                                            m_use_abi;
90    bool                                            m_valid;
91    bool                                            m_stop_other_threads;
92    Address                                         m_function_addr;
93    Address                                         m_start_addr;
94    lldb::addr_t                                    m_arg_addr;
95    ValueList                                      *m_args;
96    Process                                        &m_process;
97    Thread                                         &m_thread;
98    Thread::RegisterCheckpoint                      m_register_backup;
99    lldb::ThreadPlanSP                              m_subplan_sp;
100    LanguageRuntime                                *m_cxx_language_runtime;
101    LanguageRuntime                                *m_objc_language_runtime;
102
103    DISALLOW_COPY_AND_ASSIGN (ThreadPlanCallFunction);
104};
105
106} // namespace lldb_private
107
108#endif  // liblldb_ThreadPlanCallFunction_h_
109