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