]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/lldb/Target/ThreadPlanStepOut.h
Vendor import of lldb trunk r257626:
[FreeBSD/FreeBSD.git] / include / lldb / Target / ThreadPlanStepOut.h
1 //===-- ThreadPlanStepOut.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_ThreadPlanStepOut_h_
11 #define liblldb_ThreadPlanStepOut_h_
12
13 // C Includes
14 // C++ Includes
15 // Other libraries and framework includes
16 // Project includes
17 #include "lldb/Target/Thread.h"
18 #include "lldb/Target/ThreadPlan.h"
19 #include "lldb/Target/ThreadPlanShouldStopHere.h"
20
21 namespace lldb_private {
22
23 class ThreadPlanStepOut : public ThreadPlan,
24                           public ThreadPlanShouldStopHere
25 {
26 public:
27     ThreadPlanStepOut (Thread &thread,
28                        SymbolContext *addr_context,
29                        bool first_insn,
30                        bool stop_others,
31                        Vote stop_vote,
32                        Vote run_vote,
33                        uint32_t frame_idx,
34                        LazyBool step_out_avoids_code_without_debug_info,
35                        bool continue_to_next_branch = false);
36
37     ~ThreadPlanStepOut() override;
38
39     void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
40     bool ValidatePlan(Stream *error) override;
41     bool ShouldStop(Event *event_ptr) override;
42     bool StopOthers() override;
43     lldb::StateType GetPlanRunState() override;
44     bool WillStop() override;
45     bool MischiefManaged() override;
46     void DidPush() override;
47     bool IsPlanStale() override;
48     
49     lldb::ValueObjectSP GetReturnValueObject() override
50     {
51         return m_return_valobj_sp;
52     }
53
54 protected:
55     void
56     SetFlagsToDefault() override
57     {
58         GetFlags().Set(ThreadPlanStepOut::s_default_flag_values);
59     }
60     
61     bool DoPlanExplainsStop (Event *event_ptr) override;
62     bool DoWillResume(lldb::StateType resume_state, bool current_plan) override;
63     bool QueueInlinedStepPlan (bool queue_now);
64
65 private:
66     static uint32_t s_default_flag_values;  // These are the default flag values for the ThreadPlanStepThrough.
67     
68     lldb::addr_t m_step_from_insn;
69     StackID  m_step_out_to_id;
70     StackID  m_immediate_step_from_id;
71     lldb::break_id_t m_return_bp_id;
72     lldb::addr_t m_return_addr;
73     bool m_stop_others;
74     lldb::ThreadPlanSP m_step_out_to_inline_plan_sp;    // This plan implements step out to the real function containing
75                                                         // an inlined frame so we can then step out of that.
76     lldb::ThreadPlanSP m_step_through_inline_plan_sp;   // This plan then steps past the inlined frame(s).
77     lldb::ThreadPlanSP m_step_out_further_plan_sp;      // This plan keeps stepping out if ShouldStopHere told us to.
78     Function *m_immediate_step_from_function;
79     lldb::ValueObjectSP m_return_valobj_sp;
80
81     friend lldb::ThreadPlanSP
82     Thread::QueueThreadPlanForStepOut (bool abort_other_plans,
83                                        SymbolContext *addr_context,
84                                        bool first_insn,
85                                        bool stop_others,
86                                        Vote stop_vote,
87                                        Vote run_vote,
88                                        uint32_t frame_idx,
89                                        LazyBool step_out_avoids_code_without_debug_info);
90
91     void SetupAvoidNoDebug(LazyBool step_out_avoids_code_without_debug_info);
92     // Need an appropriate marker for the current stack so we can tell step out
93     // from step in.
94
95     void
96     CalculateReturnValue();
97     
98     DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepOut);
99 };
100
101 } // namespace lldb_private
102
103 #endif // liblldb_ThreadPlanStepOut_h_