Skip to content

Commit

Permalink
[lldb] Delete StepScope enum whose values are ignored. (llvm#101981)
Browse files Browse the repository at this point in the history
StepScope enum is a type whose values are passed around, but they are
ultimately ignored.

---------

Co-authored-by: Matej Košík <matej.kosik@codasip.com>
  • Loading branch information
sedymrak and Matej Košík authored Aug 5, 2024
1 parent ddb9869 commit 248c534
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions lldb/source/Commands/CommandObjectThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,6 @@ class CommandObjectThreadBacktrace : public CommandObjectIterateOverThreads {
CommandOptions m_options;
};

enum StepScope { eStepScopeSource, eStepScopeInstruction };

#define LLDB_OPTIONS_thread_step_scope
#include "CommandOptions.inc"

Expand Down Expand Up @@ -374,15 +372,13 @@ class CommandObjectThreadStepWithTypeAndScope : public CommandObjectParsed {
CommandObjectThreadStepWithTypeAndScope(CommandInterpreter &interpreter,
const char *name, const char *help,
const char *syntax,
StepType step_type,
StepScope step_scope)
StepType step_type)
: CommandObjectParsed(interpreter, name, help, syntax,
eCommandRequiresProcess | eCommandRequiresThread |
eCommandTryTargetAPILock |
eCommandProcessMustBeLaunched |
eCommandProcessMustBePaused),
m_step_type(step_type), m_step_scope(step_scope),
m_class_options("scripted step") {
m_step_type(step_type), m_class_options("scripted step") {
AddSimpleArgumentList(eArgTypeThreadIndex, eArgRepeatOptional);

if (step_type == eStepTypeScripted) {
Expand Down Expand Up @@ -621,7 +617,6 @@ class CommandObjectThreadStepWithTypeAndScope : public CommandObjectParsed {
}

StepType m_step_type;
StepScope m_step_scope;
ThreadStepScopeOptionGroup m_options;
OptionGroupPythonClassWithDict m_class_options;
OptionGroupOptions m_all_options;
Expand Down Expand Up @@ -2561,35 +2556,35 @@ CommandObjectMultiwordThread::CommandObjectMultiwordThread(
interpreter, "thread step-in",
"Source level single step, stepping into calls. Defaults "
"to current thread unless specified.",
nullptr, eStepTypeInto, eStepScopeSource)));
nullptr, eStepTypeInto)));

LoadSubCommand("step-out",
CommandObjectSP(new CommandObjectThreadStepWithTypeAndScope(
interpreter, "thread step-out",
"Finish executing the current stack frame and stop after "
"returning. Defaults to current thread unless specified.",
nullptr, eStepTypeOut, eStepScopeSource)));
nullptr, eStepTypeOut)));

LoadSubCommand("step-over",
CommandObjectSP(new CommandObjectThreadStepWithTypeAndScope(
interpreter, "thread step-over",
"Source level single step, stepping over calls. Defaults "
"to current thread unless specified.",
nullptr, eStepTypeOver, eStepScopeSource)));
nullptr, eStepTypeOver)));

LoadSubCommand("step-inst",
CommandObjectSP(new CommandObjectThreadStepWithTypeAndScope(
interpreter, "thread step-inst",
"Instruction level single step, stepping into calls. "
"Defaults to current thread unless specified.",
nullptr, eStepTypeTrace, eStepScopeInstruction)));
nullptr, eStepTypeTrace)));

LoadSubCommand("step-inst-over",
CommandObjectSP(new CommandObjectThreadStepWithTypeAndScope(
interpreter, "thread step-inst-over",
"Instruction level single step, stepping over calls. "
"Defaults to current thread unless specified.",
nullptr, eStepTypeTraceOver, eStepScopeInstruction)));
nullptr, eStepTypeTraceOver)));

LoadSubCommand(
"step-scripted",
Expand All @@ -2600,7 +2595,7 @@ CommandObjectMultiwordThread::CommandObjectMultiwordThread(
"that will be used to populate an SBStructuredData Dictionary, which "
"will be passed to the constructor of the class implementing the "
"scripted step. See the Python Reference for more details.",
nullptr, eStepTypeScripted, eStepScopeSource)));
nullptr, eStepTypeScripted)));

LoadSubCommand("plan", CommandObjectSP(new CommandObjectMultiwordThreadPlan(
interpreter)));
Expand Down

0 comments on commit 248c534

Please sign in to comment.