25 bool stop_other_threads,
26 Vote report_stop_vote,
29 "Step over single instruction", thread, report_stop_vote,
42 StackFrameSP start_frame_sp(thread.GetStackFrameAtIndex(0));
46 start_frame_sp->GetSymbolContext(eSymbolContextSymbol).symbol !=
nullptr;
48 StackFrameSP parent_frame_sp = thread.GetStackFrameAtIndex(1);
55 auto PrintFailureIfAny = [&]() {
69 s->
PutCString(
"Stepping one instruction past ");
92 StopReason reason = stop_info_sp->GetStopReason();
101 StackID cur_frame_id = thread.GetStackFrameAtIndex(0)->GetStackID();
104 uint64_t
pc = thread.GetRegisterContext()->GetPC(0);
105 uint32_t max_opcode_size =
109 if (next_instruction_reached) {
119 LLDB_LOGF(log,
"ThreadPlanStepInstruction::IsPlanStale - Current frame is "
120 "older than start frame, plan is stale.");
129 StackFrameSP cur_frame_sp = thread.GetStackFrameAtIndex(0);
133 "ThreadPlanStepInstruction couldn't get the 0th frame, stopping.");
138 StackID cur_frame_zero_id = cur_frame_sp->GetStackID();
141 m_stack_id.IsYoungerThan(cur_frame_zero_id)) {
156 StackFrame *return_frame = thread.GetStackFrameAtIndex(1).get();
164 if (cur_frame_sp->IsInlined()) {
168 if (parent_frame_sp &&
169 parent_frame_sp->GetConcreteFrameIndex() ==
170 cur_frame_sp->GetConcreteFrameIndex()) {
172 LLDB_LOGF(log,
"Frame we stepped into is inlined into the frame "
173 "we were stepping from, stopping.");
182 thread.GetStackFrameAtIndex(0)->GetRegisterContext()->GetPC();
184 GetTarget().GetArchitecture().GetAddressByteSize());
188 GetTarget().GetArchitecture().GetAddressByteSize());
194 const bool stop_others =
false;
195 thread.QueueThreadPlanForStepOutNoShouldStop(
202 "The stack id we are stepping in changed, but our parent frame "
203 "did not when stepping from code with no symbols. "
204 "We are probably just confused about where we are, stopping.");
210 LLDB_LOGF(log,
"Could not find previous frame, stopping.");
216 lldb::addr_t pc_addr = thread.GetRegisterContext()->GetPC(0);
243 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.
virtual lldb::RegisterContextSP GetRegisterContext()
Get the RegisterContext for this frame, if possible.
virtual StackID & GetStackID()
bool IsYoungerThan(const StackID &other) const
Returns true if this StackID corresponds to a frame younger (i.e.
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
ThreadPlan(ThreadPlanKind kind, const char *name, Thread &thread, Vote report_stop_vote, Vote report_run_vote)
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()
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.