Skip to content

Commit e668877

Browse files
[lldb][nfc] Remove unused parameters in ThreadPlanStepOut ctor
These have been unused for at least a decade.
1 parent 662baea commit e668877

13 files changed

+38
-75
lines changed

lldb/include/lldb/API/SBThreadPlan.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ class LLDB_API SBThreadPlan {
100100
lldb::addr_t range_size,
101101
SBError &error);
102102

103+
// Note: first_insn is not used.
103104
SBThreadPlan QueueThreadPlanForStepOut(uint32_t frame_idx_to_step_to,
104105
bool first_insn = false);
105106
SBThreadPlan QueueThreadPlanForStepOut(uint32_t frame_idx_to_step_to,

lldb/include/lldb/Target/Thread.h

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -843,18 +843,6 @@ class Thread : public std::enable_shared_from_this<Thread>,
843843
/// this one.
844844
/// Otherwise this plan will go on the end of the plan stack.
845845
///
846-
/// \param[in] addr_context
847-
/// When dealing with stepping through inlined functions the current PC is
848-
/// not enough information to know
849-
/// what "step" means. For instance a series of nested inline functions
850-
/// might start at the same address.
851-
// The \a addr_context provides the current symbol context the step
852-
/// is supposed to be out of.
853-
// FIXME: Currently unused.
854-
///
855-
/// \param[in] first_insn
856-
/// \b true if this is the first instruction of a function.
857-
///
858846
/// \param[in] stop_other_threads
859847
/// \b true if we will stop other threads while we single step this one.
860848
///
@@ -876,9 +864,8 @@ class Thread : public std::enable_shared_from_this<Thread>,
876864
/// A shared pointer to the newly queued thread plan, or nullptr if the
877865
/// plan could not be queued.
878866
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOut(
879-
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
880-
bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote,
881-
uint32_t frame_idx, Status &status,
867+
bool abort_other_plans, bool stop_other_threads, Vote report_stop_vote,
868+
Vote report_run_vote, uint32_t frame_idx, Status &status,
882869
LazyBool step_out_avoids_code_without_debug_info = eLazyBoolCalculate);
883870

884871
/// Queue the plan used to step out of the function at the current PC of
@@ -892,18 +879,6 @@ class Thread : public std::enable_shared_from_this<Thread>,
892879
/// this one.
893880
/// Otherwise this plan will go on the end of the plan stack.
894881
///
895-
/// \param[in] addr_context
896-
/// When dealing with stepping through inlined functions the current PC is
897-
/// not enough information to know
898-
/// what "step" means. For instance a series of nested inline functions
899-
/// might start at the same address.
900-
// The \a addr_context provides the current symbol context the step
901-
/// is supposed to be out of.
902-
// FIXME: Currently unused.
903-
///
904-
/// \param[in] first_insn
905-
/// \b true if this is the first instruction of a function.
906-
///
907882
/// \param[in] stop_other_threads
908883
/// \b true if we will stop other threads while we single step this one.
909884
///
@@ -940,9 +915,9 @@ class Thread : public std::enable_shared_from_this<Thread>,
940915
/// A shared pointer to the newly queued thread plan, or nullptr if the
941916
/// plan could not be queued.
942917
virtual lldb::ThreadPlanSP QueueThreadPlanForStepOutNoShouldStop(
943-
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
944-
bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote,
945-
uint32_t frame_idx, Status &status, bool continue_to_next_branch = false);
918+
bool abort_other_plans, bool stop_other_threads, Vote report_stop_vote,
919+
Vote report_run_vote, uint32_t frame_idx, Status &status,
920+
bool continue_to_next_branch = false);
946921

947922
/// Gets the plan used to step through the code that steps from a function
948923
/// call site at the current PC into the actual function call.

lldb/include/lldb/Target/ThreadPlanStepOut.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ namespace lldb_private {
1717

1818
class ThreadPlanStepOut : public ThreadPlan, public ThreadPlanShouldStopHere {
1919
public:
20-
ThreadPlanStepOut(Thread &thread, SymbolContext *addr_context,
21-
bool first_insn, bool stop_others, Vote report_stop_vote,
20+
ThreadPlanStepOut(Thread &thread, bool stop_others, Vote report_stop_vote,
2221
Vote report_run_vote, uint32_t frame_idx,
2322
LazyBool step_out_avoids_code_without_debug_info,
2423
bool continue_to_next_branch = false,
@@ -76,9 +75,8 @@ class ThreadPlanStepOut : public ThreadPlan, public ThreadPlanShouldStopHere {
7675
StreamString m_constructor_errors;
7776

7877
friend lldb::ThreadPlanSP Thread::QueueThreadPlanForStepOut(
79-
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
80-
bool stop_others, Vote report_stop_vote, Vote report_run_vote,
81-
uint32_t frame_idx, Status &status,
78+
bool abort_other_plans, bool stop_others, Vote report_stop_vote,
79+
Vote report_run_vote, uint32_t frame_idx, Status &status,
8280
LazyBool step_out_avoids_code_without_debug_info);
8381

8482
void SetupAvoidNoDebug(LazyBool step_out_avoids_code_without_debug_info);

lldb/source/API/SBThread.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -659,8 +659,8 @@ void SBThread::StepOut(SBError &error) {
659659
const LazyBool avoid_no_debug = eLazyBoolCalculate;
660660
Status new_plan_status;
661661
ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut(
662-
abort_other_plans, nullptr, false, stop_other_threads, eVoteYes,
663-
eVoteNoOpinion, 0, new_plan_status, avoid_no_debug));
662+
abort_other_plans, stop_other_threads, eVoteYes, eVoteNoOpinion, 0,
663+
new_plan_status, avoid_no_debug));
664664

665665
if (new_plan_status.Success())
666666
error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
@@ -703,8 +703,8 @@ void SBThread::StepOutOfFrame(SBFrame &sb_frame, SBError &error) {
703703

704704
Status new_plan_status;
705705
ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForStepOut(
706-
abort_other_plans, nullptr, false, stop_other_threads, eVoteYes,
707-
eVoteNoOpinion, frame_sp->GetFrameIndex(), new_plan_status));
706+
abort_other_plans, stop_other_threads, eVoteYes, eVoteNoOpinion,
707+
frame_sp->GetFrameIndex(), new_plan_status));
708708

709709
if (new_plan_status.Success())
710710
error = ResumeNewPlan(exe_ctx, new_plan_sp.get());

lldb/source/API/SBThreadPlan.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,8 @@ SBThreadPlan::QueueThreadPlanForStepOut(uint32_t frame_idx_to_step_to,
312312
Status plan_status;
313313
SBThreadPlan plan =
314314
SBThreadPlan(thread_plan_sp->GetThread().QueueThreadPlanForStepOut(
315-
false, &sc, first_insn, false, eVoteYes, eVoteNoOpinion,
316-
frame_idx_to_step_to, plan_status));
315+
false, false, eVoteYes, eVoteNoOpinion, frame_idx_to_step_to,
316+
plan_status));
317317

318318
if (plan_status.Fail())
319319
error.SetErrorString(plan_status.AsCString());

lldb/source/Commands/CommandObjectThread.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,8 +558,7 @@ class CommandObjectThreadStepWithTypeAndScope : public CommandObjectParsed {
558558
true, abort_other_plans, bool_stop_other_threads, new_plan_status);
559559
} else if (m_step_type == eStepTypeOut) {
560560
new_plan_sp = thread->QueueThreadPlanForStepOut(
561-
abort_other_plans, nullptr, false, bool_stop_other_threads, eVoteYes,
562-
eVoteNoOpinion,
561+
abort_other_plans, bool_stop_other_threads, eVoteYes, eVoteNoOpinion,
563562
thread->GetSelectedFrameIndex(DoNoSelectMostRelevantFrame),
564563
new_plan_status, m_options.m_step_out_avoid_no_debug);
565564
} else if (m_step_type == eStepTypeScripted) {

lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,10 @@ bool AppleThreadPlanStepThroughObjCTrampoline::ShouldStop(Event *event_ptr) {
161161
eSymbolContextEverything);
162162
Status status;
163163
const bool abort_other_plans = false;
164-
const bool first_insn = true;
165164
const uint32_t frame_idx = 0;
166165
m_run_to_sp = GetThread().QueueThreadPlanForStepOutNoShouldStop(
167-
abort_other_plans, &sc, first_insn, false, eVoteNoOpinion,
168-
eVoteNoOpinion, frame_idx, status);
166+
abort_other_plans, false, eVoteNoOpinion, eVoteNoOpinion, frame_idx,
167+
status);
169168
if (m_run_to_sp && status.Success())
170169
m_run_to_sp->SetPrivate(true);
171170
return false;
@@ -242,8 +241,7 @@ AppleThreadPlanStepThroughDirectDispatch ::
242241
AppleThreadPlanStepThroughDirectDispatch(
243242
Thread &thread, AppleObjCTrampolineHandler &handler,
244243
llvm::StringRef dispatch_func_name)
245-
: ThreadPlanStepOut(thread, nullptr, true /* first instruction */, false,
246-
eVoteNoOpinion, eVoteNoOpinion,
244+
: ThreadPlanStepOut(thread, false, eVoteNoOpinion, eVoteNoOpinion,
247245
0 /* Step out of zeroth frame */,
248246
eLazyBoolNo /* Our parent plan will decide this
249247
when we are done */

lldb/source/Target/Thread.cpp

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1341,28 +1341,26 @@ ThreadPlanSP Thread::QueueThreadPlanForStepInRange(
13411341
}
13421342

13431343
ThreadPlanSP Thread::QueueThreadPlanForStepOut(
1344-
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
1345-
bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote,
1346-
uint32_t frame_idx, Status &status,
1344+
bool abort_other_plans, bool stop_other_threads, Vote report_stop_vote,
1345+
Vote report_run_vote, uint32_t frame_idx, Status &status,
13471346
LazyBool step_out_avoids_code_without_debug_info) {
13481347
ThreadPlanSP thread_plan_sp(new ThreadPlanStepOut(
1349-
*this, addr_context, first_insn, stop_other_threads, report_stop_vote,
1350-
report_run_vote, frame_idx, step_out_avoids_code_without_debug_info));
1348+
*this, stop_other_threads, report_stop_vote, report_run_vote, frame_idx,
1349+
step_out_avoids_code_without_debug_info));
13511350

13521351
status = QueueThreadPlan(thread_plan_sp, abort_other_plans);
13531352
return thread_plan_sp;
13541353
}
13551354

13561355
ThreadPlanSP Thread::QueueThreadPlanForStepOutNoShouldStop(
1357-
bool abort_other_plans, SymbolContext *addr_context, bool first_insn,
1358-
bool stop_other_threads, Vote report_stop_vote, Vote report_run_vote,
1359-
uint32_t frame_idx, Status &status, bool continue_to_next_branch) {
1356+
bool abort_other_plans, bool stop_other_threads, Vote report_stop_vote,
1357+
Vote report_run_vote, uint32_t frame_idx, Status &status,
1358+
bool continue_to_next_branch) {
13601359
const bool calculate_return_value =
13611360
false; // No need to calculate the return value here.
13621361
ThreadPlanSP thread_plan_sp(new ThreadPlanStepOut(
1363-
*this, addr_context, first_insn, stop_other_threads, report_stop_vote,
1364-
report_run_vote, frame_idx, eLazyBoolNo, continue_to_next_branch,
1365-
calculate_return_value));
1362+
*this, stop_other_threads, report_stop_vote, report_run_vote, frame_idx,
1363+
eLazyBoolNo, continue_to_next_branch, calculate_return_value));
13661364

13671365
ThreadPlanStepOut *new_plan =
13681366
static_cast<ThreadPlanStepOut *>(thread_plan_sp.get());
@@ -2035,13 +2033,12 @@ Status Thread::StepOut(uint32_t frame_idx) {
20352033
Status error;
20362034
Process *process = GetProcess().get();
20372035
if (StateIsStoppedState(process->GetState(), true)) {
2038-
const bool first_instruction = false;
20392036
const bool stop_other_threads = false;
20402037
const bool abort_other_plans = false;
20412038

2042-
ThreadPlanSP new_plan_sp(QueueThreadPlanForStepOut(
2043-
abort_other_plans, nullptr, first_instruction, stop_other_threads,
2044-
eVoteYes, eVoteNoOpinion, frame_idx, error));
2039+
ThreadPlanSP new_plan_sp =
2040+
QueueThreadPlanForStepOut(abort_other_plans, stop_other_threads,
2041+
eVoteYes, eVoteNoOpinion, frame_idx, error);
20452042

20462043
new_plan_sp->SetIsControllingPlan(true);
20472044
new_plan_sp->SetOkayToDiscard(false);

lldb/source/Target/ThreadPlanCallOnFunctionExit.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ void ThreadPlanCallOnFunctionExit::DidPush() {
2929
Status status;
3030
m_step_out_threadplan_sp = GetThread().QueueThreadPlanForStepOut(
3131
false, // abort other plans
32-
nullptr, // addr_context
33-
true, // first instruction
3432
true, // stop other threads
3533
eVoteNo, // do not say "we're stopping"
3634
eVoteNoOpinion, // don't care about run state broadcasting

lldb/source/Target/ThreadPlanShouldStopHere.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,8 @@ ThreadPlanSP ThreadPlanShouldStopHere::DefaultStepFromHereCallback(
176176
if (!return_plan_sp)
177177
return_plan_sp =
178178
current_plan->GetThread().QueueThreadPlanForStepOutNoShouldStop(
179-
false, nullptr, true, stop_others, eVoteNo, eVoteNoOpinion,
180-
frame_index, status, true);
179+
false, stop_others, eVoteNo, eVoteNoOpinion, frame_index, status,
180+
true);
181181
return return_plan_sp;
182182
}
183183

lldb/source/Target/ThreadPlanStepInstruction.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ bool ThreadPlanStepInstruction::ShouldStop(Event *event_ptr) {
198198
// for now it is safer to run others.
199199
const bool stop_others = false;
200200
thread.QueueThreadPlanForStepOutNoShouldStop(
201-
false, nullptr, true, stop_others, eVoteNo, eVoteNoOpinion, 0,
202-
m_status);
201+
false, stop_others, eVoteNo, eVoteNoOpinion, 0, m_status);
203202
return false;
204203
} else {
205204
if (log) {

lldb/source/Target/ThreadPlanStepOut.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ ComputeTargetFrame(Thread &thread, uint32_t start_frame_idx,
5959

6060
// ThreadPlanStepOut: Step out of the current frame
6161
ThreadPlanStepOut::ThreadPlanStepOut(
62-
Thread &thread, SymbolContext *context, bool first_insn, bool stop_others,
63-
Vote report_stop_vote, Vote report_run_vote, uint32_t frame_idx,
62+
Thread &thread, bool stop_others, Vote report_stop_vote,
63+
Vote report_run_vote, uint32_t frame_idx,
6464
LazyBool step_out_avoids_code_without_debug_info,
6565
bool continue_to_next_branch, bool gather_return_value)
6666
: ThreadPlan(ThreadPlan::eKindStepOut, "Step out", thread, report_stop_vote,
@@ -101,7 +101,7 @@ void ThreadPlanStepOut::SetupReturnAddress(
101101
// First queue a plan that gets us to this inlined frame, and when we get
102102
// there we'll queue a second plan that walks us out of this frame.
103103
m_step_out_to_inline_plan_sp = std::make_shared<ThreadPlanStepOut>(
104-
GetThread(), nullptr, false, m_stop_others, eVoteNoOpinion, eVoteNoOpinion,
104+
GetThread(), m_stop_others, eVoteNoOpinion, eVoteNoOpinion,
105105
frame_idx - 1, eLazyBoolNo, continue_to_next_branch);
106106
static_cast<ThreadPlanStepOut *>(m_step_out_to_inline_plan_sp.get())
107107
->SetShouldStopHereCallbacks(nullptr, nullptr);
@@ -113,7 +113,6 @@ void ThreadPlanStepOut::SetupReturnAddress(
113113
}
114114
} else {
115115
// Find the return address and set a breakpoint there:
116-
// FIXME - can we do this more securely if we know first_insn?
117116

118117
Address return_address(return_frame_sp->GetFrameCodeAddress());
119118
if (continue_to_next_branch) {

lldb/source/Target/ThreadPlanStepOverRange.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,7 @@ bool ThreadPlanStepOverRange::ShouldStop(Event *event_ptr) {
192192
if (m_next_branch_bp_sp)
193193
return false;
194194
new_plan_sp = thread.QueueThreadPlanForStepOutNoShouldStop(
195-
false, nullptr, true, stop_others, eVoteNo, eVoteNoOpinion, 0,
196-
m_status, true);
195+
false, stop_others, eVoteNo, eVoteNoOpinion, 0, m_status, true);
197196
break;
198197
} else {
199198
new_plan_sp = thread.QueueThreadPlanForStepThrough(

0 commit comments

Comments
 (0)