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