LLDB mainline
ThreadPlanStepRange.h
Go to the documentation of this file.
1//===-- ThreadPlanStepRange.h -----------------------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef LLDB_TARGET_THREADPLANSTEPRANGE_H
10#define LLDB_TARGET_THREADPLANSTEPRANGE_H
11
13#include "lldb/Target/StackID.h"
14#include "lldb/Target/Thread.h"
17
18namespace lldb_private {
19
21public:
22 ThreadPlanStepRange(ThreadPlanKind kind, const char *name, Thread &thread,
23 const AddressRange &range,
24 const SymbolContext &addr_context,
25 lldb::RunMode stop_others,
26 bool given_ranges_only = false);
27
28 ~ThreadPlanStepRange() override;
29
30 void GetDescription(Stream *s, lldb::DescriptionLevel level) override = 0;
31 bool ValidatePlan(Stream *error) override;
32 bool ShouldStop(Event *event_ptr) override = 0;
33 Vote ShouldReportStop(Event *event_ptr) override;
34 bool StopOthers() override;
36 bool WillStop() override;
37 bool MischiefManaged() override;
38 void DidPush() override;
39 bool IsPlanStale() override;
40
41 void AddRange(const AddressRange &new_range);
42
43protected:
44 bool InRange();
46 bool InSymbol();
47 void DumpRanges(Stream *s);
48
50
52 size_t &range_index,
53 size_t &insn_offset);
54
55 // Pushes a plan to proceed through the next section of instructions in the
56 // range - usually just a RunToAddress plan to run to the next branch.
57 // Returns true if it pushed such a plan. If there was no available 'quick
58 // run' plan, then just single step.
60
61 // Whether the input stop info is caused by the next branch breakpoint.
62 // Note: this does not check if branch breakpoint site is shared by other
63 // breakpoints or not.
65
67
69
71
73 std::vector<AddressRange> m_address_ranges;
75 StackID m_stack_id; // Use the stack ID so we can tell step out from step in.
76 StackID m_parent_stack_id; // Use the parent stack ID so we can identify tail
77 // calls and the like.
78 bool m_no_more_plans; // Need this one so we can tell if we stepped into a
79 // call,
80 // but can't continue, in which case we are done.
81 bool m_first_run_event; // We want to broadcast only one running event, our
82 // first.
86 bool m_found_calls = false; // When we set the next branch breakpoint for
87 // step over, we now extend them past call insns
88 // that directly return. But if we do that we
89 // need to run all threads, or we might cause
90 // deadlocks. This tells us whether we found
91 // any calls in setting the next branch breakpoint.
92
93private:
94 std::vector<lldb::DisassemblerSP> m_instruction_ranges;
95
98};
99
100} // namespace lldb_private
101
102#endif // LLDB_TARGET_THREADPLANSTEPRANGE_H
static llvm::raw_ostream & error(Stream &strm)
A section + offset based address range class.
Definition: AddressRange.h:25
A stream class that can stream formatted output to a file.
Definition: Stream.h:28
Defines a symbol context baton that can be handed other debug core functions.
Definition: SymbolContext.h:34
bool NextRangeBreakpointExplainsStop(lldb::StopInfoSP stop_info_sp)
ThreadPlanStepRange(const ThreadPlanStepRange &)=delete
Vote ShouldReportStop(Event *event_ptr) override
const ThreadPlanStepRange & operator=(const ThreadPlanStepRange &)=delete
bool ValidatePlan(Stream *error) override
Returns whether this plan could be successfully created.
void GetDescription(Stream *s, lldb::DescriptionLevel level) override=0
Print a description of this thread to the stream s.
lldb::FrameComparison CompareCurrentFrameToStartFrame()
bool IsNextBranchBreakpointStop(lldb::StopInfoSP stop_info_sp)
InstructionList * GetInstructionsForAddress(lldb::addr_t addr, size_t &range_index, size_t &insn_offset)
std::vector< lldb::DisassemblerSP > m_instruction_ranges
lldb::StateType GetPlanRunState() override
std::vector< AddressRange > m_address_ranges
void AddRange(const AddressRange &new_range)
bool ShouldStop(Event *event_ptr) override=0
A class that represents a running process on the host machine.
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
FrameComparison
This is the return value for frame comparisons.
StateType
Process and Thread States.
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
Definition: lldb-forward.h:321
std::shared_ptr< lldb_private::StopInfo > StopInfoSP
Definition: lldb-forward.h:431
uint64_t addr_t
Definition: lldb-types.h:80
RunMode
Thread Run Modes.