ThreadPlanCallFunction.h revision 48685687640e88515cd17b6fa613d13e180558d6
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    virtual
34    ~ThreadPlanCallFunction ();
35
36    virtual void
37    GetDescription (Stream *s, lldb::DescriptionLevel level);
38
39    virtual bool
40    ValidatePlan (Stream *error);
41
42    virtual bool
43    PlanExplainsStop ();
44
45    virtual bool
46    ShouldStop (Event *event_ptr);
47
48    virtual bool
49    StopOthers ();
50
51    virtual void
52    SetStopOthers (bool new_value);
53
54    virtual lldb::StateType
55    GetPlanRunState ();
56
57    virtual void
58    DidPush ();
59
60    virtual bool
61    WillStop ();
62
63    virtual bool
64    MischiefManaged ();
65
66    virtual bool
67    IsMasterPlan()
68    {
69        return true;
70    }
71
72protected:
73private:
74    void
75    DoTakedown ();
76
77    void
78    SetBreakpoints ();
79
80    void
81    ClearBreakpoints ();
82
83    bool
84    BreakpointsExplainStop ();
85
86    bool                                            m_use_abi;
87    bool                                            m_valid;
88    bool                                            m_stop_other_threads;
89    Address                                         m_function_addr;
90    Address                                         m_start_addr;
91    lldb::addr_t                                    m_arg_addr;
92    ValueList                                      *m_args;
93    Process                                        &m_process;
94    Thread                                         &m_thread;
95    Thread::RegisterCheckpoint                      m_register_backup;
96    lldb::ThreadPlanSP                              m_subplan_sp;
97    LanguageRuntime                                *m_cxx_language_runtime;
98    LanguageRuntime                                *m_objc_language_runtime;
99
100    DISALLOW_COPY_AND_ASSIGN (ThreadPlanCallFunction);
101};
102
103} // namespace lldb_private
104
105#endif  // liblldb_ThreadPlanCallFunction_h_
106