Go to the documentation of this file.
32 ThreadPlanStepRange::ThreadPlanStepRange(
ThreadPlanKind kind,
const char *name,
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++) {
127 const bool include_inlined_functions =
130 include_inlined_functions));
140 "Step range plan stepped to another range of same line: %s",
146 const bool include_inlined_functions =
149 include_inlined_functions));
158 "Step range plan stepped to a range at linenumber 0 "
159 "stepping through that range: %s",
181 "Step range plan stepped to the middle of new "
182 "line(%d): %s, continuing to clear this line.",
190 if (!ret_value && log)
191 LLDB_LOGF(log,
"Step range plan out of range to 0x%" PRIx64, pc_load_addr);
228 if (cur_parent_frame)
229 cur_parent_id = cur_parent_frame->GetStackID();
252 llvm_unreachable(
"Unhandled run mode!");
256 lldb::addr_t addr,
size_t &range_index,
size_t &insn_offset) {
258 for (
size_t i = 0; i < num_ranges; i++) {
266 const char *plugin_name =
nullptr;
267 const char *flavor =
nullptr;
281 ->GetInstructionList()
282 .GetIndexOfInstructionAtLoadAddress(addr,
GetTarget());
298 LLDB_LOGF(log,
"Removing next branch breakpoint: %d.",
327 if (instructions ==
nullptr)
338 if (last_index - pc_index > 1) {
339 InstructionSP last_inst =
341 size_t last_inst_size = last_inst->GetOpcode().GetByteSize();
342 run_to_address = last_inst->GetAddress();
343 run_to_address.
Slide(last_inst_size);
345 }
else if (branch_index - pc_index > 1) {
350 if (run_to_address.
IsValid()) {
351 const bool is_internal =
true;
362 BreakpointLocationSP bp_loc =
365 BreakpointSiteSP bp_site = bp_loc->GetBreakpointSite();
367 bp_site_id = bp_site->GetID();
371 "ThreadPlanStepRange::SetNextBranchBreakpoint - Setting "
372 "breakpoint %d (site %d) to run to address 0x%" PRIx64,
389 lldb::StopInfoSP stop_info_sp) {
394 break_id_t bp_site_id = stop_info_sp->GetValue();
395 BreakpointSiteSP bp_site_sp =
403 size_t num_owners = bp_site_sp->GetNumberOfOwners();
404 bool explains_stop =
true;
409 for (
size_t i = 0; i < num_owners; i++) {
410 if (!bp_site_sp->GetOwnerAtIndex(i)->GetBreakpoint().IsInternal()) {
411 explains_stop =
false;
416 "ThreadPlanStepRange::NextRangeBreakpointExplainsStop - Hit "
417 "next range breakpoint which has %" PRIu64
418 " owners - explains stop: %u.",
419 (uint64_t)num_owners, explains_stop);
421 return explains_stop;
458 LLDB_LOGF(log,
"Completed step through range plan.");
473 LLDB_LOGF(log,
"ThreadPlanStepRange::IsPlanStale returning true, we've "
485 for (
size_t i = 0; i < num_ranges; i++) {
Address & GetBaseAddress()
Get accessor for the base address of the range.
Thread & GetThread()
Returns the Thread that is using this thread plan.
FrameComparison
This is the return value for frame comparisons.
bool IsValid() const
Check if the object state is valid.
bool IsValid() const
Check if a line entry object is valid.
const AddressRange & GetAddressRange()
bool ValueIsAddress() const
lldb::StateType GetPlanRunState() override
SymbolContext m_addr_context
#define LLDB_LOGF(log,...)
ThreadPlanKind GetKind() const
bool SetNextBranchBreakpoint()
lldb::BreakpointSP m_next_branch_bp_sp
BreakpointSiteList & GetBreakpointSiteList()
bool IsPlanStale() override
Target & GetTarget()
Get the target object pointer for this module.
AddressRange GetSameLineContiguousAddressRange(bool include_inlined_functions) const
Give the range for this LineEntry + any additional LineEntries for this same source line that are con...
lldb::InstructionSP GetInstructionAtIndex(size_t idx) const
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)
std::vector< lldb::DisassemblerSP > m_instruction_ranges
bool NextRangeBreakpointExplainsStop(lldb::StopInfoSP stop_info_sp)
static llvm::raw_ostream & error(Stream &strm)
Symbol * symbol
The Symbol for a given query.
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.
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)
@ DumpStyleLoadAddress
Display as the load address (if resolved).
StackID m_parent_stack_id
virtual bool MischiefManaged()
@ eFrameCompareSameParent
const char * GetData() const
Function * function
The Function for a given query.
Address & GetAddressRef()
lldb::BreakpointSiteSP FindByID(lldb::break_id_t breakID)
Returns a shared pointer to the breakpoint site with id breakID.
void AddRange(const AddressRange &new_range)
uint32_t GetIndexOfNextBranchInstruction(uint32_t start, bool ignore_calls, bool *found_calls) const
Get the index of the next branch instruction.
void ClearNextBranchBreakpoint()
InstructionList * GetInstructionsForAddress(lldb::addr_t addr, size_t &range_index, size_t &insn_offset)
FileSpec original_file
The original source file, from debug info.
uint32_t line
The source line number, or zero if there is no line number information.
#define LLDB_INVALID_BREAK_ID
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
void SetPlanComplete(bool success=true)
~ThreadPlanStepRange() override
Vote ShouldReportStop(Event *event_ptr) override
bool m_could_not_resolve_hw_bp
lldb::FrameComparison CompareCurrentFrameToStartFrame()
void DumpRanges(Stream *s)
lldb::addr_t GetLoadAddress(Target *target) const
Get the load address.
lldb::addr_t GetByteSize() const
AddressRange range
The section offset address range for this line entry.
bool GetUseFastStepping() const
bool RemoveBreakpointByID(lldb::break_id_t break_id)
bool ValidatePlan(Stream *error) override
Returns whether this plan could be successfully created.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
lldb::RunMode m_stop_others
A class that represents a running process on the host machine.
std::vector< AddressRange > m_address_ranges
StateType
Process and Thread States.
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
LineEntry line_entry
The LineEntry for a given query.
bool MischiefManaged() override
virtual lldb::RegisterContextSP GetRegisterContext()=0
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
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'...
bool StopOthers() override
bool Slide(int64_t offset)
@ eStateRunning
Process or thread is running and can't be examined.
const SymbolContext & GetSymbolContext(lldb::SymbolContextItem resolve_scope)
Provide a SymbolContext for this StackFrame's current pc value.