/// \param[in] stop_other_threads
/// \b true if we will stop other threads while we single step this one.
///
- /// \param[in] stop_vote
+ /// \param[in] report_stop_vote
/// See standard meanings for the stop & run votes in ThreadPlan.h.
///
- /// \param[in] run_vote
+ /// \param[in] report_run_vote
/// See standard meanings for the stop & run votes in ThreadPlan.h.
///
/// \param[out] status
/// plan could not be queued.
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOut(
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
- bool stop_other_threads, Vote stop_vote, Vote run_vote,
+ bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote,
uint32_t frame_idx, Status &status,
LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
/// \param[in] stop_other_threads
/// \b true if we will stop other threads while we single step this one.
///
- /// \param[in] stop_vote
+ /// \param[in] report_stop_vote
/// See standard meanings for the stop & run votes in ThreadPlan.h.
///
- /// \param[in] run_vote
+ /// \param[in] report_run_vote
/// See standard meanings for the stop & run votes in ThreadPlan.h.
///
/// \param[in] frame_idx
/// plan could not be queued.
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOutNoShouldStop(
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
- bool stop_other_threads, Vote stop_vote, Vote run_vote,
+ bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote,
uint32_t frame_idx, Status &status, bool continue_to_next_branch = false);
/// Gets the plan used to step through the code that steps from a function
// One other little detail here, sometimes a plan will push another plan onto
// the plan stack to do some part of the first plan's job, and it would be
// convenient to tell that plan how it should respond to ShouldReportStop.
-// You can do that by setting the stop_vote in the child plan when you create
-// it.
+// You can do that by setting the report_stop_vote in the child plan when you
+// create it.
//
// Suppressing the initial eStateRunning event:
//
// eVoteNo from ShouldReportStop, to force a running event to be reported
// return eVoteYes, in general though you should return eVoteNoOpinion which
// will allow the ThreadList to figure out the right thing to do. The
-// run_vote argument to the constructor works like stop_vote, and is a way for
-// a plan to instruct a sub-plan on how to respond to ShouldReportStop.
+// report_run_vote argument to the constructor works like report_stop_vote, and
+// is a way for a plan to instruct a sub-plan on how to respond to
+// ShouldReportStop.
class ThreadPlan : public std::enable_shared_from_this<ThreadPlan>,
public UserID {
protected:
// Constructors and Destructors
ThreadPlan(ThreadPlanKind kind, const char *name, Thread &thread,
- Vote stop_vote, Vote run_vote);
+ Vote report_stop_vote, Vote report_run_vote);
// Classes that inherit from ThreadPlan can see and modify these
Status m_status;
Process &m_process;
lldb::tid_t m_tid;
- Vote m_stop_vote;
- Vote m_run_vote;
+ Vote m_report_stop_vote;
+ Vote m_report_run_vote;
bool m_takes_iteration_count;
bool m_could_not_resolve_hw_bp;
int32_t m_iteration_count = 1;
class ThreadPlanStepInstruction : public ThreadPlan {
public:
ThreadPlanStepInstruction(Thread &thread, bool step_over, bool stop_others,
- Vote stop_vote, Vote run_vote);
+ Vote report_stop_vote, Vote report_run_vote);
~ThreadPlanStepInstruction() override;
class ThreadPlanStepOut : public ThreadPlan, public ThreadPlanShouldStopHere {
public:
ThreadPlanStepOut(Thread &thread, SymbolContext *addr_context,
- bool first_insn, bool stop_others, Vote stop_vote,
- Vote run_vote, uint32_t frame_idx,
+ bool first_insn, bool stop_others, Vote report_stop_vote,
+ Vote report_run_vote, uint32_t frame_idx,
LazyBool step_out_avoids_code_without_debug_info,
bool continue_to_next_branch = false,
bool gather_return_value = true);
friend lldb::ThreadPlanSP Thread::QueueThreadPlanForStepOut(
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
- bool stop_others, Vote stop_vote, Vote run_vote, uint32_t frame_idx,
- Status &status, LazyBool step_out_avoids_code_without_debug_info);
+ bool stop_others, Vote report_stop_vote, Vote report_run_vote,
+ uint32_t frame_idx, Status &status,
+ LazyBool step_out_avoids_code_without_debug_info);
void SetupAvoidNoDebug(LazyBool step_out_avoids_code_without_debug_info);
// Need an appropriate marker for the current stack so we can tell step out
should_resume = !m_thread_list.ShouldStop(event_ptr);
if (was_restarted || should_resume || m_resume_requested) {
- Vote stop_vote = m_thread_list.ShouldReportStop(event_ptr);
+ Vote report_stop_vote = m_thread_list.ShouldReportStop(event_ptr);
LLDB_LOGF(log,
"Process::ShouldBroadcastEvent: should_resume: %i state: "
- "%s was_restarted: %i stop_vote: %d.",
+ "%s was_restarted: %i report_stop_vote: %d.",
should_resume, StateAsCString(state), was_restarted,
- stop_vote);
+ report_stop_vote);
- switch (stop_vote) {
+ switch (report_stop_vote) {
case eVoteYes:
return_value = true;
break;
ThreadPlanSP Thread::QueueThreadPlanForStepOut(
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
- bool stop_other_threads, Vote stop_vote, Vote run_vote, uint32_t frame_idx,
- Status &status, LazyBool step_out_avoids_code_without_debug_info) {
+ bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote,
+ uint32_t frame_idx, Status &status,
+ LazyBool step_out_avoids_code_without_debug_info) {
ThreadPlanSP thread_plan_sp(new ThreadPlanStepOut(
- *this, addr_context, first_insn, stop_other_threads, stop_vote, run_vote,
- frame_idx, step_out_avoids_code_without_debug_info));
+ *this, addr_context, first_insn, stop_other_threads, report_stop_vote,
+ report_run_vote, frame_idx, step_out_avoids_code_without_debug_info));
status = QueueThreadPlan(thread_plan_sp, abort_other_plans);
return thread_plan_sp;
ThreadPlanSP Thread::QueueThreadPlanForStepOutNoShouldStop(
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
- bool stop_other_threads, Vote stop_vote, Vote run_vote, uint32_t frame_idx,
- Status &status, bool continue_to_next_branch) {
+ bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote,
+ uint32_t frame_idx, Status &status, bool continue_to_next_branch) {
const bool calculate_return_value =
false; // No need to calculate the return value here.
ThreadPlanSP thread_plan_sp(new ThreadPlanStepOut(
- *this, addr_context, first_insn, stop_other_threads, stop_vote, run_vote,
- frame_idx, eLazyBoolNo, continue_to_next_branch, calculate_return_value));
+ *this, addr_context, first_insn, stop_other_threads, report_stop_vote,
+ report_run_vote, frame_idx, eLazyBoolNo, continue_to_next_branch,
+ calculate_return_value));
ThreadPlanStepOut *new_plan =
static_cast<ThreadPlanStepOut *>(thread_plan_sp.get());
// ThreadPlan constructor
ThreadPlan::ThreadPlan(ThreadPlanKind kind, const char *name, Thread &thread,
- Vote stop_vote, Vote run_vote)
+ Vote report_stop_vote, Vote report_run_vote)
: m_process(*thread.GetProcess().get()), m_tid(thread.GetID()),
- m_stop_vote(stop_vote), m_run_vote(run_vote),
+ m_report_stop_vote(report_stop_vote), m_report_run_vote(report_run_vote),
m_takes_iteration_count(false), m_could_not_resolve_hw_bp(false),
m_thread(&thread), m_kind(kind), m_name(name), m_plan_complete_mutex(),
m_cached_plan_explains_stop(eLazyBoolCalculate), m_plan_complete(false),
Vote ThreadPlan::ShouldReportStop(Event *event_ptr) {
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
- if (m_stop_vote == eVoteNoOpinion) {
+ if (m_report_stop_vote == eVoteNoOpinion) {
ThreadPlan *prev_plan = GetPreviousPlan();
if (prev_plan) {
Vote prev_vote = prev_plan->ShouldReportStop(event_ptr);
return prev_vote;
}
}
- LLDB_LOG(log, "Returning vote: {0}", m_stop_vote);
- return m_stop_vote;
+ LLDB_LOG(log, "Returning vote: {0}", m_report_stop_vote);
+ return m_report_stop_vote;
}
Vote ThreadPlan::ShouldReportRun(Event *event_ptr) {
- if (m_run_vote == eVoteNoOpinion) {
+ if (m_report_run_vote == eVoteNoOpinion) {
ThreadPlan *prev_plan = GetPreviousPlan();
if (prev_plan)
return prev_plan->ShouldReportRun(event_ptr);
}
- return m_run_vote;
+ return m_report_run_vote;
}
void ThreadPlan::ClearThreadCache() { m_thread = nullptr; }
}
bool ThreadPlanBase::ShouldStop(Event *event_ptr) {
- m_stop_vote = eVoteYes;
- m_run_vote = eVoteYes;
+ m_report_stop_vote = eVoteYes;
+ m_report_run_vote = eVoteYes;
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
case eStopReasonInvalid:
case eStopReasonNone:
// This
- m_run_vote = eVoteNoOpinion;
- m_stop_vote = eVoteNo;
+ m_report_run_vote = eVoteNoOpinion;
+ m_report_stop_vote = eVoteNo;
return false;
case eStopReasonBreakpoint:
// with "restarted" so the UI will know to wait and expect the consequent
// "running".
if (stop_info_sp->ShouldNotify(event_ptr)) {
- m_stop_vote = eVoteYes;
- m_run_vote = eVoteYes;
+ m_report_stop_vote = eVoteYes;
+ m_report_run_vote = eVoteYes;
} else {
- m_stop_vote = eVoteNo;
- m_run_vote = eVoteNo;
+ m_report_stop_vote = eVoteNo;
+ m_report_run_vote = eVoteNo;
}
return false;
// We're not going to stop, but while we are here, let's figure out
// whether to report this.
if (stop_info_sp->ShouldNotify(event_ptr))
- m_stop_vote = eVoteYes;
+ m_report_stop_vote = eVoteYes;
else
- m_stop_vote = eVoteNo;
+ m_report_stop_vote = eVoteNo;
}
return false;
}
} else {
- m_run_vote = eVoteNoOpinion;
- m_stop_vote = eVoteNo;
+ m_report_run_vote = eVoteNoOpinion;
+ m_report_stop_vote = eVoteNo;
}
// If there's no explicit reason to stop, then we will continue.
bool current_plan) {
// Reset these to the default values so we don't set them wrong, then not get
// asked for a while, then return the wrong answer.
- m_run_vote = eVoteNoOpinion;
- m_stop_vote = eVoteNo;
+ m_report_run_vote = eVoteNoOpinion;
+ m_report_stop_vote = eVoteNo;
return true;
}
ThreadPlanStepInstruction::ThreadPlanStepInstruction(Thread &thread,
bool step_over,
bool stop_other_threads,
- Vote stop_vote,
- Vote run_vote)
+ Vote report_stop_vote,
+ Vote report_run_vote)
: ThreadPlan(ThreadPlan::eKindStepInstruction,
- "Step over single instruction", thread, stop_vote, run_vote),
+ "Step over single instruction", thread, report_stop_vote,
+ report_run_vote),
m_instruction_addr(0), m_stop_other_threads(stop_other_threads),
m_step_over(step_over) {
m_takes_iteration_count = true;
// ThreadPlanStepOut: Step out of the current frame
ThreadPlanStepOut::ThreadPlanStepOut(
Thread &thread, SymbolContext *context, bool first_insn, bool stop_others,
- Vote stop_vote, Vote run_vote, uint32_t frame_idx,
+ Vote report_stop_vote, Vote report_run_vote, uint32_t frame_idx,
LazyBool step_out_avoids_code_without_debug_info,
bool continue_to_next_branch, bool gather_return_value)
- : ThreadPlan(ThreadPlan::eKindStepOut, "Step out", thread, stop_vote,
- run_vote),
+ : ThreadPlan(ThreadPlan::eKindStepOut, "Step out", thread, report_stop_vote,
+ report_run_vote),
ThreadPlanShouldStopHere(this), m_step_from_insn(LLDB_INVALID_ADDRESS),
m_return_bp_id(LLDB_INVALID_BREAK_ID),
m_return_addr(LLDB_INVALID_ADDRESS), m_stop_others(stop_others),