1 //===-- ThreadPlanStepRange.h -----------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 #ifndef liblldb_ThreadPlanStepRange_h_
11 #define liblldb_ThreadPlanStepRange_h_
15 // Other libraries and framework includes
17 #include "lldb/Core/AddressRange.h"
18 #include "lldb/Target/StackID.h"
19 #include "lldb/Target/Thread.h"
20 #include "lldb/Target/ThreadPlan.h"
21 #include "lldb/Target/ThreadPlanShouldStopHere.h"
23 namespace lldb_private {
25 class ThreadPlanStepRange : public ThreadPlan
28 ThreadPlanStepRange (ThreadPlanKind kind,
31 const AddressRange &range,
32 const SymbolContext &addr_context,
33 lldb::RunMode stop_others);
35 virtual ~ThreadPlanStepRange ();
37 virtual void GetDescription (Stream *s, lldb::DescriptionLevel level) = 0;
38 virtual bool ValidatePlan (Stream *error);
39 virtual bool ShouldStop (Event *event_ptr) = 0;
40 virtual Vote ShouldReportStop (Event *event_ptr);
41 virtual bool StopOthers ();
42 virtual lldb::StateType GetPlanRunState ();
43 virtual bool WillStop ();
44 virtual bool MischiefManaged ();
45 virtual void DidPush ();
46 virtual bool IsPlanStale ();
49 void AddRange(const AddressRange &new_range);
54 lldb::FrameComparison CompareCurrentFrameToStartFrame();
56 void DumpRanges (Stream *s);
62 GetInstructionsForAddress(lldb::addr_t addr, size_t &range_index, size_t &insn_offset);
64 // Pushes a plan to proceed through the next section of instructions in the range - usually just a RunToAddress
65 // plan to run to the next branch. Returns true if it pushed such a plan. If there was no available 'quick run'
66 // plan, then just single step.
68 SetNextBranchBreakpoint ();
71 ClearNextBranchBreakpoint();
74 NextRangeBreakpointExplainsStop (lldb::StopInfoSP stop_info_sp);
76 SymbolContext m_addr_context;
77 std::vector<AddressRange> m_address_ranges;
78 lldb::RunMode m_stop_others;
79 StackID m_stack_id; // Use the stack ID so we can tell step out from step in.
80 bool m_no_more_plans; // Need this one so we can tell if we stepped into a call,
81 // but can't continue, in which case we are done.
82 bool m_first_run_event; // We want to broadcast only one running event, our first.
83 lldb::BreakpointSP m_next_branch_bp_sp;
87 std::vector<lldb::DisassemblerSP> m_instruction_ranges;
88 DISALLOW_COPY_AND_ASSIGN (ThreadPlanStepRange);
92 } // namespace lldb_private
94 #endif // liblldb_ThreadPlanStepRange_h_