]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/llvm/tools/lldb/include/lldb/Target/ThreadPlanStepUntil.h
MFV r329774:
[FreeBSD/FreeBSD.git] / contrib / llvm / tools / lldb / include / lldb / Target / ThreadPlanStepUntil.h
1 //===-- ThreadPlanStepUntil.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_ThreadPlanStepUntil_h_
11 #define liblldb_ThreadPlanStepUntil_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
20 namespace lldb_private {
21
22 class ThreadPlanStepUntil : public ThreadPlan {
23 public:
24   ~ThreadPlanStepUntil() override;
25
26   void GetDescription(Stream *s, lldb::DescriptionLevel level) override;
27   bool ValidatePlan(Stream *error) override;
28   bool ShouldStop(Event *event_ptr) override;
29   bool StopOthers() override;
30   lldb::StateType GetPlanRunState() override;
31   bool WillStop() override;
32   bool MischiefManaged() override;
33
34 protected:
35   bool DoWillResume(lldb::StateType resume_state, bool current_plan) override;
36   bool DoPlanExplainsStop(Event *event_ptr) override;
37
38   ThreadPlanStepUntil(Thread &thread, lldb::addr_t *address_list,
39                       size_t num_addresses, bool stop_others,
40                       uint32_t frame_idx = 0);
41
42   void AnalyzeStop();
43
44 private:
45   StackID m_stack_id;
46   lldb::addr_t m_step_from_insn;
47   lldb::break_id_t m_return_bp_id;
48   lldb::addr_t m_return_addr;
49   bool m_stepped_out;
50   bool m_should_stop;
51   bool m_ran_analyze;
52   bool m_explains_stop;
53
54   typedef std::map<lldb::addr_t, lldb::break_id_t> until_collection;
55   until_collection m_until_points;
56   bool m_stop_others;
57
58   void Clear();
59
60   friend lldb::ThreadPlanSP Thread::QueueThreadPlanForStepUntil(
61       bool abort_other_plans, lldb::addr_t *address_list, size_t num_addresses,
62       bool stop_others, uint32_t frame_idx);
63
64   // Need an appropriate marker for the current stack so we can tell step out
65   // from step in.
66
67   DISALLOW_COPY_AND_ASSIGN(ThreadPlanStepUntil);
68 };
69
70 } // namespace lldb_private
71
72 #endif // liblldb_ThreadPlanStepUntil_h_