ThreadPlanStepThrough.h revision 008f3dc79c762b7d240b5ad6d4fb148c5cb039ca
1//===-- ThreadPlanStepThrough.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_ThreadPlanStepThrough_h_
11#define liblldb_ThreadPlanStepThrough_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 ThreadPlanStepThrough : public ThreadPlan
23{
24public:
25    virtual ~ThreadPlanStepThrough ();
26
27    virtual void GetDescription (Stream *s, lldb::DescriptionLevel level);
28    virtual bool ValidatePlan (Stream *error);
29    virtual bool ShouldStop (Event *event_ptr);
30    virtual bool StopOthers ();
31    virtual lldb::StateType GetPlanRunState ();
32    virtual bool WillStop ();
33    virtual bool MischiefManaged ();
34    virtual void DidPush();
35
36protected:
37    virtual bool DoPlanExplainsStop (Event *event_ptr);
38    virtual bool DoWillResume (lldb::StateType resume_state, bool current_plan);
39
40    ThreadPlanStepThrough (Thread &thread,
41                           StackID &return_stack_id,
42                           bool stop_others);
43
44    void
45    LookForPlanToStepThroughFromCurrentPC ();
46
47    bool
48    HitOurBackstopBreakpoint();
49
50private:
51    friend lldb::ThreadPlanSP
52    Thread::QueueThreadPlanForStepThrough (StackID &return_stack_id,
53                                           bool abort_other_plans,
54                                           bool stop_others);
55
56    void ClearBackstopBreakpoint();
57
58    lldb::ThreadPlanSP m_sub_plan_sp;
59    lldb::addr_t      m_start_address;
60    lldb::break_id_t  m_backstop_bkpt_id;
61    lldb::addr_t      m_backstop_addr;
62    StackID           m_return_stack_id;
63    bool              m_stop_others;
64
65    DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepThrough);
66
67};
68
69} // namespace lldb_private
70
71#endif  // liblldb_ThreadPlanStepThrough_h_
72