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 #include "lldb/Target/Thread.h"
14 #include "lldb/Target/ThreadPlan.h"
15 
16 namespace lldb_private {
17 
18 class ThreadPlanStepThrough : public ThreadPlan {
19 public:
20   ~ThreadPlanStepThrough() override;
21 
22   void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
23   bool ValidatePlan(Stream *error) override;
24   bool ShouldStop(Event *event_ptr) override;
25   bool StopOthers() override;
26   lldb::StateType GetPlanRunState() override;
27   bool WillStop() override;
28   bool MischiefManaged() override;
29   void DidPush() override;
30 
31 protected:
32   bool DoPlanExplainsStop(Event *event_ptr) override;
33   bool DoWillResume(lldb::StateType resume_state, bool current_plan) override;
34 
35   ThreadPlanStepThrough(Thread &thread, StackID &return_stack_id,
36                         bool stop_others);
37 
38   void LookForPlanToStepThroughFromCurrentPC();
39 
40   bool HitOurBackstopBreakpoint();
41 
42 private:
43   friend lldb::ThreadPlanSP
44   Thread::QueueThreadPlanForStepThrough(StackID &return_stack_id,
45                                         bool abort_other_plans,
46                                         bool stop_others, Status &status);
47 
48   void ClearBackstopBreakpoint();
49 
50   lldb::ThreadPlanSP m_sub_plan_sp;
51   lldb::addr_t m_start_address;
52   lldb::break_id_t m_backstop_bkpt_id;
53   lldb::addr_t m_backstop_addr;
54   StackID m_return_stack_id;
55   bool m_stop_others;
56 
57   DISALLOW_COPY_AND_ASSIGN(ThreadPlanStepThrough);
58 };
59 
60 } // namespace lldb_private
61 
62 #endif // liblldb_ThreadPlanStepThrough_h_
63