25 bool stop_other_threads,
26 Vote report_stop_vote,
29 "Step over single instruction", thread, report_stop_vote,
31 m_instruction_addr(0), m_stop_other_threads(stop_other_threads),
32 m_step_over(step_over) {
46 start_frame_sp->GetSymbolContext(eSymbolContextSymbol).symbol !=
nullptr;
55 auto PrintFailureIfAny = [&]() {
63 s->
Printf(
"instruction step over");
65 s->
Printf(
"instruction step into");
69 s->
Printf(
"Stepping one instruction past ");
72 s->
Printf(
" which has no symbol");
75 s->
Printf(
" stepping over calls");
77 s->
Printf(
" stepping into calls");
92 StopReason reason = stop_info_sp->GetStopReason();
105 uint32_t max_opcode_size =
109 if (next_instruction_reached) {
121 "ThreadPlanStepInstruction::IsPlanStale - Current frame is "
122 "older than start frame, plan is stale.");
136 "ThreadPlanStepInstruction couldn't get the 0th frame, stopping.");
141 StackID cur_frame_zero_id = cur_frame_sp->GetStackID();
166 if (cur_frame_sp->IsInlined()) {
170 if (parent_frame_sp &&
171 parent_frame_sp->GetConcreteFrameIndex() ==
172 cur_frame_sp->GetConcreteFrameIndex()) {
176 "Frame we stepped into is inlined into the frame "
177 "we were stepping from, stopping.");
189 GetTarget().GetArchitecture().GetAddressByteSize());
193 GetTarget().GetArchitecture().GetAddressByteSize());
199 const bool stop_others =
false;
207 "The stack id we are stepping in changed, but our parent frame "
208 "did not when stepping from code with no symbols. "
209 "We are probably just confused about where we are, stopping.");
215 LLDB_LOGF(log,
"Could not find previous frame, stopping.");
248 LLDB_LOGF(log,
"Completed single instruction step plan.");
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_LOGF(log,...)
uint32_t GetMaximumOpcodeByteSize() const
void PutCString(const char *cstr)
This base class provides an interface to stack frames.
lldb::RegisterContextSP GetRegisterContext()
Get the RegisterContext for this frame, if possible.
const char * AsCString(const char *default_error_str="unknown error") const
Get the error string associated with the current error.
bool Success() const
Test for success condition.
const char * GetData() const
A stream class that can stream formatted output to a file.
llvm::raw_ostream & AsRawOstream()
Returns a raw_ostream that forwards the data to this Stream object.
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
const ArchSpec & GetArchitecture() const
bool DoPlanExplainsStop(Event *event_ptr) override
~ThreadPlanStepInstruction() override
bool m_stop_other_threads
bool StopOthers() override
lldb::addr_t m_instruction_addr
ThreadPlanStepInstruction(Thread &thread, bool step_over, bool stop_others, Vote report_stop_vote, Vote report_run_vote)
void GetDescription(Stream *s, lldb::DescriptionLevel level) override
Print a description of this thread to the stream s.
StackID m_parent_frame_id
bool IsPlanStale() override
lldb::StateType GetPlanRunState() override
bool MischiefManaged() override
bool ValidatePlan(Stream *error) override
Returns whether this plan could be successfully created.
bool ShouldStop(Event *event_ptr) override
int32_t m_iteration_count
void SetPlanComplete(bool success=true)
Thread & GetThread()
Returns the Thread that is using this thread plan.
bool m_takes_iteration_count
virtual bool MischiefManaged()
lldb::StopInfoSP GetPrivateStopInfo()
virtual lldb::StackFrameSP GetStackFrameAtIndex(uint32_t idx)
virtual lldb::RegisterContextSP GetRegisterContext()=0
virtual lldb::StackFrameSP GetFrameWithStackID(const StackID &stack_id)
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOutNoShouldStop(bool abort_other_plans, SymbolContext *addr_context, bool first_insn, bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote, uint32_t frame_idx, Status &status, bool continue_to_next_branch=false)
Queue the plan used to step out of the function at the current PC of a thread.
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.
void DumpAddress(llvm::raw_ostream &s, uint64_t addr, uint32_t addr_size, const char *prefix=nullptr, const char *suffix=nullptr)
Output an address value to this stream.
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
StateType
Process and Thread States.
@ eStateStepping
Process or thread is in the process of stepping and can not be examined.
std::shared_ptr< lldb_private::StopInfo > StopInfoSP
StopReason
Thread stop reasons.