ThreadPlanStepOut.h revision 43d390617a5a03ff42894fa0ad121b9335fa4dbc
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
20namespace lldb_private {
21
22class ThreadPlanStepOverRange;
23
24class ThreadPlanStepOut : public ThreadPlan
25{
26public:
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
35    virtual ~ThreadPlanStepOut ();
36
37    virtual void GetDescription (Stream *s, lldb::DescriptionLevel level);
38    virtual bool ValidatePlan (Stream *error);
39    virtual bool PlanExplainsStop ();
40    virtual bool ShouldStop (Event *event_ptr);
41    virtual bool StopOthers ();
42    virtual lldb::StateType GetPlanRunState ();
43    virtual bool WillResume (lldb::StateType resume_state, bool current_plan);
44    virtual bool WillStop ();
45    virtual bool MischiefManaged ();
46    virtual void DidPush();
47
48protected:
49    bool QueueInlinedStepPlan (bool queue_now);
50
51private:
52    SymbolContext *m_step_from_context;
53    lldb::addr_t m_step_from_insn;
54    uint32_t m_stack_depth;
55    lldb::break_id_t m_return_bp_id;
56    lldb::addr_t m_return_addr;
57    bool m_first_insn;
58    bool m_stop_others;
59    lldb::ThreadPlanSP m_step_through_inline_plan_sp;
60    lldb::ThreadPlanSP m_step_out_plan_sp;
61
62    friend ThreadPlan *
63    Thread::QueueThreadPlanForStepOut (bool abort_other_plans,
64                                       SymbolContext *addr_context,
65                                       bool first_insn,
66                                       bool stop_others,
67                                       Vote stop_vote,
68                                       Vote run_vote,
69                                       uint32_t frame_idx);
70
71    // Need an appropriate marker for the current stack so we can tell step out
72    // from step in.
73
74    DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepOut);
75
76};
77
78} // namespace lldb_private
79
80#endif  // liblldb_ThreadPlanStepOut_h_
81