Skip to content

Commit 9d3b9e5

Browse files
committed
[lldb] Rename {stop,run}_vote to report_{stop,run}_vote
Rename `stop_vote` and `run_vote` to `report_stop_vote` and `report_run_vote` respectively. These variables are limited to logic involving (event) reporting only. This naming is intended to make their context more clear. Differential Revision: https://reviews.llvm.org/D96917
1 parent 7e3183d commit 9d3b9e5

File tree

10 files changed

+62
-57
lines changed

10 files changed

+62
-57
lines changed

lldb/include/lldb/Target/Thread.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -781,10 +781,10 @@ class Thread : public std::enable_shared_from_this<Thread>,
781781
/// \param[in] stop_other_threads
782782
/// \b true if we will stop other threads while we single step this one.
783783
///
784-
/// \param[in] stop_vote
784+
/// \param[in] report_stop_vote
785785
/// See standard meanings for the stop & run votes in ThreadPlan.h.
786786
///
787-
/// \param[in] run_vote
787+
/// \param[in] report_run_vote
788788
/// See standard meanings for the stop & run votes in ThreadPlan.h.
789789
///
790790
/// \param[out] status
@@ -800,7 +800,7 @@ class Thread : public std::enable_shared_from_this<Thread>,
800800
/// plan could not be queued.
801801
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOut(
802802
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
803-
bool stop_other_threads, Vote stop_vote, Vote run_vote,
803+
bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote,
804804
uint32_t frame_idx, Status &status,
805805
LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
806806

@@ -830,10 +830,10 @@ class Thread : public std::enable_shared_from_this<Thread>,
830830
/// \param[in] stop_other_threads
831831
/// \b true if we will stop other threads while we single step this one.
832832
///
833-
/// \param[in] stop_vote
833+
/// \param[in] report_stop_vote
834834
/// See standard meanings for the stop & run votes in ThreadPlan.h.
835835
///
836-
/// \param[in] run_vote
836+
/// \param[in] report_run_vote
837837
/// See standard meanings for the stop & run votes in ThreadPlan.h.
838838
///
839839
/// \param[in] frame_idx
@@ -864,7 +864,7 @@ class Thread : public std::enable_shared_from_this<Thread>,
864864
/// plan could not be queued.
865865
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOutNoShouldStop(
866866
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
867-
bool stop_other_threads, Vote stop_vote, Vote run_vote,
867+
bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote,
868868
uint32_t frame_idx, Status &status, bool continue_to_next_branch = false);
869869

870870
/// Gets the plan used to step through the code that steps from a function

lldb/include/lldb/Target/ThreadPlan.h

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -260,8 +260,8 @@ namespace lldb_private {
260260
// One other little detail here, sometimes a plan will push another plan onto
261261
// the plan stack to do some part of the first plan's job, and it would be
262262
// convenient to tell that plan how it should respond to ShouldReportStop.
263-
// You can do that by setting the stop_vote in the child plan when you create
264-
// it.
263+
// You can do that by setting the report_stop_vote in the child plan when you
264+
// create it.
265265
//
266266
// Suppressing the initial eStateRunning event:
267267
//
@@ -275,8 +275,9 @@ namespace lldb_private {
275275
// eVoteNo from ShouldReportStop, to force a running event to be reported
276276
// return eVoteYes, in general though you should return eVoteNoOpinion which
277277
// will allow the ThreadList to figure out the right thing to do. The
278-
// run_vote argument to the constructor works like stop_vote, and is a way for
279-
// a plan to instruct a sub-plan on how to respond to ShouldReportStop.
278+
// report_run_vote argument to the constructor works like report_stop_vote, and
279+
// is a way for a plan to instruct a sub-plan on how to respond to
280+
// ShouldReportStop.
280281

281282
class ThreadPlan : public std::enable_shared_from_this<ThreadPlan>,
282283
public UserID {
@@ -472,7 +473,7 @@ class ThreadPlan : public std::enable_shared_from_this<ThreadPlan>,
472473
protected:
473474
// Constructors and Destructors
474475
ThreadPlan(ThreadPlanKind kind, const char *name, Thread &thread,
475-
Vote stop_vote, Vote run_vote);
476+
Vote report_stop_vote, Vote report_run_vote);
476477

477478
// Classes that inherit from ThreadPlan can see and modify these
478479

@@ -515,8 +516,8 @@ class ThreadPlan : public std::enable_shared_from_this<ThreadPlan>,
515516
Status m_status;
516517
Process &m_process;
517518
lldb::tid_t m_tid;
518-
Vote m_stop_vote;
519-
Vote m_run_vote;
519+
Vote m_report_stop_vote;
520+
Vote m_report_run_vote;
520521
bool m_takes_iteration_count;
521522
bool m_could_not_resolve_hw_bp;
522523
int32_t m_iteration_count = 1;

lldb/include/lldb/Target/ThreadPlanStepInstruction.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace lldb_private {
1818
class ThreadPlanStepInstruction : public ThreadPlan {
1919
public:
2020
ThreadPlanStepInstruction(Thread &thread, bool step_over, bool stop_others,
21-
Vote stop_vote, Vote run_vote);
21+
Vote report_stop_vote, Vote report_run_vote);
2222

2323
~ThreadPlanStepInstruction() override;
2424

lldb/include/lldb/Target/ThreadPlanStepOut.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ namespace lldb_private {
1818
class ThreadPlanStepOut : public ThreadPlan, public ThreadPlanShouldStopHere {
1919
public:
2020
ThreadPlanStepOut(Thread &thread, SymbolContext *addr_context,
21-
bool first_insn, bool stop_others, Vote stop_vote,
22-
Vote run_vote, uint32_t frame_idx,
21+
bool first_insn, bool stop_others, Vote report_stop_vote,
22+
Vote report_run_vote, uint32_t frame_idx,
2323
LazyBool step_out_avoids_code_without_debug_info,
2424
bool continue_to_next_branch = false,
2525
bool gather_return_value = true);
@@ -76,8 +76,9 @@ class ThreadPlanStepOut : public ThreadPlan, public ThreadPlanShouldStopHere {
7676

7777
friend lldb::ThreadPlanSP Thread::QueueThreadPlanForStepOut(
7878
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
79-
bool stop_others, Vote stop_vote, Vote run_vote, uint32_t frame_idx,
80-
Status &status, LazyBool step_out_avoids_code_without_debug_info);
79+
bool stop_others, Vote report_stop_vote, Vote report_run_vote,
80+
uint32_t frame_idx, Status &status,
81+
LazyBool step_out_avoids_code_without_debug_info);
8182

8283
void SetupAvoidNoDebug(LazyBool step_out_avoids_code_without_debug_info);
8384
// Need an appropriate marker for the current stack so we can tell step out

lldb/source/Target/Process.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3374,14 +3374,14 @@ bool Process::ShouldBroadcastEvent(Event *event_ptr) {
33743374
should_resume = !m_thread_list.ShouldStop(event_ptr);
33753375

33763376
if (was_restarted || should_resume || m_resume_requested) {
3377-
Vote stop_vote = m_thread_list.ShouldReportStop(event_ptr);
3377+
Vote report_stop_vote = m_thread_list.ShouldReportStop(event_ptr);
33783378
LLDB_LOGF(log,
33793379
"Process::ShouldBroadcastEvent: should_resume: %i state: "
3380-
"%s was_restarted: %i stop_vote: %d.",
3380+
"%s was_restarted: %i report_stop_vote: %d.",
33813381
should_resume, StateAsCString(state), was_restarted,
3382-
stop_vote);
3382+
report_stop_vote);
33833383

3384-
switch (stop_vote) {
3384+
switch (report_stop_vote) {
33853385
case eVoteYes:
33863386
return_value = true;
33873387
break;

lldb/source/Target/Thread.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,25 +1306,27 @@ ThreadPlanSP Thread::QueueThreadPlanForStepInRange(
13061306

13071307
ThreadPlanSP Thread::QueueThreadPlanForStepOut(
13081308
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
1309-
bool stop_other_threads, Vote stop_vote, Vote run_vote, uint32_t frame_idx,
1310-
Status &status, LazyBool step_out_avoids_code_without_debug_info) {
1309+
bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote,
1310+
uint32_t frame_idx, Status &status,
1311+
LazyBool step_out_avoids_code_without_debug_info) {
13111312
ThreadPlanSP thread_plan_sp(new ThreadPlanStepOut(
1312-
*this, addr_context, first_insn, stop_other_threads, stop_vote, run_vote,
1313-
frame_idx, step_out_avoids_code_without_debug_info));
1313+
*this, addr_context, first_insn, stop_other_threads, report_stop_vote,
1314+
report_run_vote, frame_idx, step_out_avoids_code_without_debug_info));
13141315

13151316
status = QueueThreadPlan(thread_plan_sp, abort_other_plans);
13161317
return thread_plan_sp;
13171318
}
13181319

13191320
ThreadPlanSP Thread::QueueThreadPlanForStepOutNoShouldStop(
13201321
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
1321-
bool stop_other_threads, Vote stop_vote, Vote run_vote, uint32_t frame_idx,
1322-
Status &status, bool continue_to_next_branch) {
1322+
bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote,
1323+
uint32_t frame_idx, Status &status, bool continue_to_next_branch) {
13231324
const bool calculate_return_value =
13241325
false; // No need to calculate the return value here.
13251326
ThreadPlanSP thread_plan_sp(new ThreadPlanStepOut(
1326-
*this, addr_context, first_insn, stop_other_threads, stop_vote, run_vote,
1327-
frame_idx, eLazyBoolNo, continue_to_next_branch, calculate_return_value));
1327+
*this, addr_context, first_insn, stop_other_threads, report_stop_vote,
1328+
report_run_vote, frame_idx, eLazyBoolNo, continue_to_next_branch,
1329+
calculate_return_value));
13281330

13291331
ThreadPlanStepOut *new_plan =
13301332
static_cast<ThreadPlanStepOut *>(thread_plan_sp.get());

lldb/source/Target/ThreadPlan.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ using namespace lldb_private;
2020

2121
// ThreadPlan constructor
2222
ThreadPlan::ThreadPlan(ThreadPlanKind kind, const char *name, Thread &thread,
23-
Vote stop_vote, Vote run_vote)
23+
Vote report_stop_vote, Vote report_run_vote)
2424
: m_process(*thread.GetProcess().get()), m_tid(thread.GetID()),
25-
m_stop_vote(stop_vote), m_run_vote(run_vote),
25+
m_report_stop_vote(report_stop_vote), m_report_run_vote(report_run_vote),
2626
m_takes_iteration_count(false), m_could_not_resolve_hw_bp(false),
2727
m_thread(&thread), m_kind(kind), m_name(name), m_plan_complete_mutex(),
2828
m_cached_plan_explains_stop(eLazyBoolCalculate), m_plan_complete(false),
@@ -78,25 +78,25 @@ bool ThreadPlan::MischiefManaged() {
7878
Vote ThreadPlan::ShouldReportStop(Event *event_ptr) {
7979
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
8080

81-
if (m_stop_vote == eVoteNoOpinion) {
81+
if (m_report_stop_vote == eVoteNoOpinion) {
8282
ThreadPlan *prev_plan = GetPreviousPlan();
8383
if (prev_plan) {
8484
Vote prev_vote = prev_plan->ShouldReportStop(event_ptr);
8585
LLDB_LOG(log, "returning previous thread plan vote: {0}", prev_vote);
8686
return prev_vote;
8787
}
8888
}
89-
LLDB_LOG(log, "Returning vote: {0}", m_stop_vote);
90-
return m_stop_vote;
89+
LLDB_LOG(log, "Returning vote: {0}", m_report_stop_vote);
90+
return m_report_stop_vote;
9191
}
9292

9393
Vote ThreadPlan::ShouldReportRun(Event *event_ptr) {
94-
if (m_run_vote == eVoteNoOpinion) {
94+
if (m_report_run_vote == eVoteNoOpinion) {
9595
ThreadPlan *prev_plan = GetPreviousPlan();
9696
if (prev_plan)
9797
return prev_plan->ShouldReportRun(event_ptr);
9898
}
99-
return m_run_vote;
99+
return m_report_run_vote;
100100
}
101101

102102
void ThreadPlan::ClearThreadCache() { m_thread = nullptr; }

lldb/source/Target/ThreadPlanBase.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ Vote ThreadPlanBase::ShouldReportStop(Event *event_ptr) {
7070
}
7171

7272
bool ThreadPlanBase::ShouldStop(Event *event_ptr) {
73-
m_stop_vote = eVoteYes;
74-
m_run_vote = eVoteYes;
73+
m_report_stop_vote = eVoteYes;
74+
m_report_run_vote = eVoteYes;
7575

7676
Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_STEP));
7777

@@ -82,8 +82,8 @@ bool ThreadPlanBase::ShouldStop(Event *event_ptr) {
8282
case eStopReasonInvalid:
8383
case eStopReasonNone:
8484
// This
85-
m_run_vote = eVoteNoOpinion;
86-
m_stop_vote = eVoteNo;
85+
m_report_run_vote = eVoteNoOpinion;
86+
m_report_stop_vote = eVoteNo;
8787
return false;
8888

8989
case eStopReasonBreakpoint:
@@ -106,11 +106,11 @@ bool ThreadPlanBase::ShouldStop(Event *event_ptr) {
106106
// with "restarted" so the UI will know to wait and expect the consequent
107107
// "running".
108108
if (stop_info_sp->ShouldNotify(event_ptr)) {
109-
m_stop_vote = eVoteYes;
110-
m_run_vote = eVoteYes;
109+
m_report_stop_vote = eVoteYes;
110+
m_report_run_vote = eVoteYes;
111111
} else {
112-
m_stop_vote = eVoteNo;
113-
m_run_vote = eVoteNo;
112+
m_report_stop_vote = eVoteNo;
113+
m_report_run_vote = eVoteNo;
114114
}
115115
return false;
116116

@@ -156,9 +156,9 @@ bool ThreadPlanBase::ShouldStop(Event *event_ptr) {
156156
// We're not going to stop, but while we are here, let's figure out
157157
// whether to report this.
158158
if (stop_info_sp->ShouldNotify(event_ptr))
159-
m_stop_vote = eVoteYes;
159+
m_report_stop_vote = eVoteYes;
160160
else
161-
m_stop_vote = eVoteNo;
161+
m_report_stop_vote = eVoteNo;
162162
}
163163
return false;
164164

@@ -167,8 +167,8 @@ bool ThreadPlanBase::ShouldStop(Event *event_ptr) {
167167
}
168168

169169
} else {
170-
m_run_vote = eVoteNoOpinion;
171-
m_stop_vote = eVoteNo;
170+
m_report_run_vote = eVoteNoOpinion;
171+
m_report_stop_vote = eVoteNo;
172172
}
173173

174174
// If there's no explicit reason to stop, then we will continue.
@@ -185,8 +185,8 @@ bool ThreadPlanBase::DoWillResume(lldb::StateType resume_state,
185185
bool current_plan) {
186186
// Reset these to the default values so we don't set them wrong, then not get
187187
// asked for a while, then return the wrong answer.
188-
m_run_vote = eVoteNoOpinion;
189-
m_stop_vote = eVoteNo;
188+
m_report_run_vote = eVoteNoOpinion;
189+
m_report_stop_vote = eVoteNo;
190190
return true;
191191
}
192192

lldb/source/Target/ThreadPlanStepInstruction.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ using namespace lldb_private;
2323
ThreadPlanStepInstruction::ThreadPlanStepInstruction(Thread &thread,
2424
bool step_over,
2525
bool stop_other_threads,
26-
Vote stop_vote,
27-
Vote run_vote)
26+
Vote report_stop_vote,
27+
Vote report_run_vote)
2828
: ThreadPlan(ThreadPlan::eKindStepInstruction,
29-
"Step over single instruction", thread, stop_vote, run_vote),
29+
"Step over single instruction", thread, report_stop_vote,
30+
report_run_vote),
3031
m_instruction_addr(0), m_stop_other_threads(stop_other_threads),
3132
m_step_over(step_over) {
3233
m_takes_iteration_count = true;

lldb/source/Target/ThreadPlanStepOut.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ uint32_t ThreadPlanStepOut::s_default_flag_values = 0;
3333
// ThreadPlanStepOut: Step out of the current frame
3434
ThreadPlanStepOut::ThreadPlanStepOut(
3535
Thread &thread, SymbolContext *context, bool first_insn, bool stop_others,
36-
Vote stop_vote, Vote run_vote, uint32_t frame_idx,
36+
Vote report_stop_vote, Vote report_run_vote, uint32_t frame_idx,
3737
LazyBool step_out_avoids_code_without_debug_info,
3838
bool continue_to_next_branch, bool gather_return_value)
39-
: ThreadPlan(ThreadPlan::eKindStepOut, "Step out", thread, stop_vote,
40-
run_vote),
39+
: ThreadPlan(ThreadPlan::eKindStepOut, "Step out", thread, report_stop_vote,
40+
report_run_vote),
4141
ThreadPlanShouldStopHere(this), m_step_from_insn(LLDB_INVALID_ADDRESS),
4242
m_return_bp_id(LLDB_INVALID_BREAK_ID),
4343
m_return_addr(LLDB_INVALID_ADDRESS), m_stop_others(stop_others),

0 commit comments

Comments
 (0)