File indexing completed on 2026-05-10 08:42:56
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLDB_TARGET_THREADPLANSTEPRANGE_H
0010 #define LLDB_TARGET_THREADPLANSTEPRANGE_H
0011
0012 #include "lldb/Core/AddressRange.h"
0013 #include "lldb/Target/StackID.h"
0014 #include "lldb/Target/Thread.h"
0015 #include "lldb/Target/ThreadPlan.h"
0016 #include "lldb/Target/ThreadPlanShouldStopHere.h"
0017
0018 namespace lldb_private {
0019
0020 class ThreadPlanStepRange : public ThreadPlan {
0021 public:
0022 ThreadPlanStepRange(ThreadPlanKind kind, const char *name, Thread &thread,
0023 const AddressRange &range,
0024 const SymbolContext &addr_context,
0025 lldb::RunMode stop_others,
0026 bool given_ranges_only = false);
0027
0028 ~ThreadPlanStepRange() override;
0029
0030 void GetDescription(Stream *s, lldb::DescriptionLevel level) override = 0;
0031 bool ValidatePlan(Stream *error) override;
0032 bool ShouldStop(Event *event_ptr) override = 0;
0033 Vote ShouldReportStop(Event *event_ptr) override;
0034 bool StopOthers() override;
0035 lldb::StateType GetPlanRunState() override;
0036 bool WillStop() override;
0037 bool MischiefManaged() override;
0038 void DidPush() override;
0039 bool IsPlanStale() override;
0040
0041 void AddRange(const AddressRange &new_range);
0042
0043 protected:
0044 bool InRange();
0045 lldb::FrameComparison CompareCurrentFrameToStartFrame();
0046 bool InSymbol();
0047 void DumpRanges(Stream *s);
0048
0049 Disassembler *GetDisassembler();
0050
0051 InstructionList *GetInstructionsForAddress(lldb::addr_t addr,
0052 size_t &range_index,
0053 size_t &insn_offset);
0054
0055
0056
0057
0058
0059 bool SetNextBranchBreakpoint();
0060
0061
0062
0063
0064 bool IsNextBranchBreakpointStop(lldb::StopInfoSP stop_info_sp);
0065
0066 void ClearNextBranchBreakpoint();
0067
0068 void ClearNextBranchBreakpointExplainedStop();
0069
0070 bool NextRangeBreakpointExplainsStop(lldb::StopInfoSP stop_info_sp);
0071
0072 SymbolContext m_addr_context;
0073 std::vector<AddressRange> m_address_ranges;
0074 lldb::RunMode m_stop_others;
0075 StackID m_stack_id;
0076 StackID m_parent_stack_id;
0077
0078 bool m_no_more_plans;
0079
0080
0081 bool m_first_run_event;
0082
0083 lldb::BreakpointSP m_next_branch_bp_sp;
0084 bool m_use_fast_step;
0085 bool m_given_ranges_only;
0086 bool m_found_calls = false;
0087
0088
0089
0090
0091
0092
0093 private:
0094 std::vector<lldb::DisassemblerSP> m_instruction_ranges;
0095
0096 ThreadPlanStepRange(const ThreadPlanStepRange &) = delete;
0097 const ThreadPlanStepRange &operator=(const ThreadPlanStepRange &) = delete;
0098 };
0099
0100 }
0101
0102 #endif