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);
36 virtual ~ThreadPlanStepOut ();
38 virtual void GetDescription (Stream *s, lldb::DescriptionLevel level);
39 virtual bool ValidatePlan (Stream *error);
40 virtual bool ShouldStop (Event *event_ptr);
41 virtual bool StopOthers ();
42 virtual lldb::StateType GetPlanRunState ();
43 virtual bool WillStop ();
44 virtual bool MischiefManaged ();
45 virtual void DidPush();
46 virtual bool IsPlanStale();
48 virtual lldb::ValueObjectSP GetReturnValueObject()
50 return m_return_valobj_sp;
57 GetFlags().Set(ThreadPlanStepOut::s_default_flag_values);
60 virtual bool DoPlanExplainsStop (Event *event_ptr);
61 virtual bool DoWillResume (lldb::StateType resume_state, bool current_plan);
62 bool QueueInlinedStepPlan (bool queue_now);
65 static uint32_t s_default_flag_values; // These are the default flag values for the ThreadPlanStepThrough.
67 lldb::addr_t m_step_from_insn;
68 StackID m_step_out_to_id;
69 StackID m_immediate_step_from_id;
70 lldb::break_id_t m_return_bp_id;
71 lldb::addr_t m_return_addr;
73 lldb::ThreadPlanSP m_step_out_to_inline_plan_sp; // This plan implements step out to the real function containing
74 // an inlined frame so we can then step out of that.
75 lldb::ThreadPlanSP m_step_through_inline_plan_sp; // This plan then steps past the inlined frame(s).
76 lldb::ThreadPlanSP m_step_out_further_plan_sp; // This plan keeps stepping out if ShouldStopHere told us to.
77 Function *m_immediate_step_from_function;
78 lldb::ValueObjectSP m_return_valobj_sp;
80 friend lldb::ThreadPlanSP
81 Thread::QueueThreadPlanForStepOut (bool abort_other_plans,
82 SymbolContext *addr_context,
88 LazyBool step_out_avoids_code_without_debug_info);
90 void SetupAvoidNoDebug(LazyBool step_out_avoids_code_without_debug_info);
91 // Need an appropriate marker for the current stack so we can tell step out
95 CalculateReturnValue();
97 DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepOut);
101 } // namespace lldb_private
103 #endif // liblldb_ThreadPlanStepOut_h_