1 //===-- ThreadPlanStepOut.h -------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ThreadPlanStepOut_h_
11 #define liblldb_ThreadPlanStepOut_h_
15 // Other libraries and framework includes
17 #include "lldb/Target/Thread.h"
18 #include "lldb/Target/ThreadPlan.h"
19 #include "lldb/Target/ThreadPlanShouldStopHere.h"
21 namespace lldb_private {
23 class ThreadPlanStepOut : public ThreadPlan,
24 public ThreadPlanShouldStopHere
27 ThreadPlanStepOut (Thread &thread,
28 SymbolContext *addr_context,
34 LazyBool step_out_avoids_code_without_debug_info,
35 bool continue_to_next_branch = false);
37 ~ThreadPlanStepOut() override;
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;
49 lldb::ValueObjectSP GetReturnValueObject() override
51 return m_return_valobj_sp;
56 SetFlagsToDefault() override
58 GetFlags().Set(ThreadPlanStepOut::s_default_flag_values);
61 bool DoPlanExplainsStop (Event *event_ptr) override;
62 bool DoWillResume(lldb::StateType resume_state, bool current_plan) override;
63 bool QueueInlinedStepPlan (bool queue_now);
66 static uint32_t s_default_flag_values; // These are the default flag values for the ThreadPlanStepThrough.
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;
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;
81 friend lldb::ThreadPlanSP
82 Thread::QueueThreadPlanForStepOut (bool abort_other_plans,
83 SymbolContext *addr_context,
89 LazyBool step_out_avoids_code_without_debug_info);
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
96 CalculateReturnValue();
98 DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepOut);
101 } // namespace lldb_private
103 #endif // liblldb_ThreadPlanStepOut_h_