37 bool given_ranges_only)
39 m_addr_context(addr_context), m_address_ranges(),
40 m_stop_others(stop_others), m_stack_id(), m_parent_stack_id(),
41 m_no_more_plans(false), m_first_run_event(true), m_use_fast_step(false),
42 m_given_ranges_only(given_ranges_only) {
62 "Could not create hardware breakpoint for thread plan.");
72 LLDB_LOGF(log,
"ThreadPlanStepRange::ShouldReportStop() returning vote %i\n",
91 if (num_ranges == 1) {
94 for (
size_t i = 0; i < num_ranges; i++) {
95 s->
Printf(
" %" PRIu64
": ", uint64_t(i));
103 bool ret_value =
false;
108 for (
size_t i = 0; i < num_ranges; i++) {
128 const bool include_inlined_functions =
131 include_inlined_functions));
141 "Step range plan stepped to another range of same line: %s",
147 const bool include_inlined_functions =
150 include_inlined_functions));
159 "Step range plan stepped to a range at linenumber 0 "
160 "stepping through that range: %s",
182 "Step range plan stepped to the middle of new "
183 "line(%d): %s, continuing to clear this line.",
191 if (!ret_value && log)
192 LLDB_LOGF(log,
"Step range plan out of range to 0x%" PRIx64, pc_load_addr);
229 if (cur_parent_frame)
230 cur_parent_id = cur_parent_frame->GetStackID();
253 llvm_unreachable(
"Unhandled run mode!");
257 lldb::addr_t addr,
size_t &range_index,
size_t &insn_offset) {
259 for (
size_t i = 0; i < num_ranges; i++) {
267 const char *plugin_name =
nullptr;
268 const char *flavor =
nullptr;
282 ->GetInstructionList()
283 .GetIndexOfInstructionAtLoadAddress(addr,
GetTarget());
300 break_id_t bp_site_id = stop_info_sp->GetValue();
313 LLDB_LOGF(log,
"Removing next branch breakpoint: %d.",
347 if (instructions ==
nullptr)
357 uint32_t last_index = instructions->
GetSize() - 1;
358 if (last_index - pc_index > 1) {
361 size_t last_inst_size = last_inst->GetOpcode().GetByteSize();
362 run_to_address = last_inst->GetAddress();
363 run_to_address.
Slide(last_inst_size);
365 }
else if (branch_index - pc_index > 1) {
369 if (branch_index == pc_index)
370 LLDB_LOGF(log,
"ThreadPlanStepRange::SetNextBranchBreakpoint - skipping "
371 "because current is branch instruction");
372 if (run_to_address.
IsValid()) {
373 const bool is_internal =
true;
389 bp_site_id = bp_site->GetID();
393 "ThreadPlanStepRange::SetNextBranchBreakpoint - Setting "
394 "breakpoint %d (site %d) to run to address 0x%" PRIx64,
406 LLDB_LOGF(log,
"ThreadPlanStepRange::SetNextBranchBreakpoint - skipping "
407 "invalid run_to_address");
417 break_id_t bp_site_id = stop_info_sp->GetValue();
424 size_t num_constituents = bp_site_sp->GetNumberOfConstituents();
425 bool explains_stop =
true;
430 for (
size_t i = 0; i < num_constituents; i++) {
431 if (!bp_site_sp->GetConstituentAtIndex(i)->GetBreakpoint().IsInternal()) {
432 explains_stop =
false;
438 "ThreadPlanStepRange::NextRangeBreakpointExplainsStop - Hit "
439 "next range breakpoint which has %" PRIu64
440 " constituents - explains stop: %u.",
441 (uint64_t)num_constituents, explains_stop);
442 return explains_stop;
478 LLDB_LOGF(log,
"Completed step through range plan.");
493 LLDB_LOGF(log,
"ThreadPlanStepRange::IsPlanStale returning true, we've "
505 for (
size_t i = 0; i < num_ranges; i++) {
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOGF(log,...)
A section + offset based address range class.
Address & GetBaseAddress()
Get accessor for the base address of the range.
bool ContainsLoadAddress(const Address &so_addr, Target *target) const
Check if a section offset so_addr when represented as a load address is contained within this object'...
A section + offset based address class.
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
@ DumpStyleLoadAddress
Display as the load address (if resolved).
bool Slide(int64_t offset)
bool IsValid() const
Check if the object state is valid.
static lldb::DisassemblerSP DisassembleRange(const ArchSpec &arch, const char *plugin_name, const char *flavor, Target &target, const AddressRange &disasm_range, bool force_live_memory=false)
const AddressRange & GetAddressRange()
lldb::InstructionSP GetInstructionAtIndex(size_t idx) const
uint32_t GetIndexOfNextBranchInstruction(uint32_t start, bool ignore_calls, bool *found_calls) const
Get the index of the next branch instruction.
StopPointSiteList< lldb_private::BreakpointSite > & GetBreakpointSiteList()
Target & GetTarget()
Get the target object pointer for this module.
This base class provides an interface to stack frames.
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.
StopPointSiteSP FindByID(typename StopPointSite::SiteID site_id)
Returns a shared pointer to the site with id site_id.
const char * GetData() const
A stream class that can stream formatted output to a file.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
@ eEqualFileSpecAndChecksumIfSet
Defines a symbol context baton that can be handed other debug core functions.
Function * function
The Function for a given query.
Symbol * symbol
The Symbol for a given query.
LineEntry line_entry
The LineEntry for a given query.
bool ValueIsAddress() const
Address & GetAddressRef()
lldb::addr_t GetByteSize() const
bool GetUseFastStepping() const
bool RemoveBreakpointByID(lldb::break_id_t break_id)
lldb::BreakpointSP CreateBreakpoint(const FileSpecList *containingModules, const FileSpec &file, uint32_t line_no, uint32_t column, lldb::addr_t offset, LazyBool check_inlines, LazyBool skip_prologue, bool internal, bool request_hardware, LazyBool move_to_nearest_code)
bool NextRangeBreakpointExplainsStop(lldb::StopInfoSP stop_info_sp)
void DumpRanges(Stream *s)
Vote ShouldReportStop(Event *event_ptr) override
bool ValidatePlan(Stream *error) override
Returns whether this plan could be successfully created.
lldb::BreakpointSP m_next_branch_bp_sp
bool MischiefManaged() override
SymbolContext m_addr_context
~ThreadPlanStepRange() override
lldb::FrameComparison CompareCurrentFrameToStartFrame()
bool StopOthers() override
bool SetNextBranchBreakpoint()
bool IsNextBranchBreakpointStop(lldb::StopInfoSP stop_info_sp)
ThreadPlanStepRange(ThreadPlanKind kind, const char *name, Thread &thread, const AddressRange &range, const SymbolContext &addr_context, lldb::RunMode stop_others, bool given_ranges_only=false)
lldb::RunMode m_stop_others
StackID m_parent_stack_id
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
void ClearNextBranchBreakpointExplainedStop()
void ClearNextBranchBreakpoint()
std::vector< AddressRange > m_address_ranges
bool IsPlanStale() override
void AddRange(const AddressRange &new_range)
ThreadPlanKind GetKind() const
void SetPlanComplete(bool success=true)
Thread & GetThread()
Returns the Thread that is using this thread plan.
virtual bool MischiefManaged()
bool m_could_not_resolve_hw_bp
lldb::StopInfoSP GetPrivateStopInfo()
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
virtual lldb::RegisterContextSP GetRegisterContext()=0
#define LLDB_INVALID_BREAK_ID
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::BreakpointSite > BreakpointSiteSP
std::shared_ptr< lldb_private::BreakpointLocation > BreakpointLocationSP
FrameComparison
This is the return value for frame comparisons.
@ eFrameCompareSameParent
StateType
Process and Thread States.
@ eStateRunning
Process or thread is running and can't be examined.
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
std::shared_ptr< lldb_private::Instruction > InstructionSP
std::shared_ptr< lldb_private::Disassembler > DisassemblerSP
std::shared_ptr< lldb_private::StopInfo > StopInfoSP
bool Dump(Stream *s, Target *target, bool show_file, Address::DumpStyle style, Address::DumpStyle fallback_style, bool show_range) const
Dump a description of this object to a Stream.
lldb::SupportFileSP original_file_sp
The original source file, from debug info.
AddressRange GetSameLineContiguousAddressRange(bool include_inlined_functions) const
Give the range for this LineEntry + any additional LineEntries for this same source line that are con...
bool IsValid() const
Check if a line entry object is valid.
AddressRange range
The section offset address range for this line entry.
uint32_t line
The source line number, or LLDB_INVALID_LINE_NUMBER if there is no line number information.