Decoupled Options from CommandInterpreter.
Options used to store a reference to the CommandInterpreter instance
in the base Options class. This made it impossible to parse options
independent of a CommandInterpreter.
This change removes the reference from the base class. Instead, it
modifies the options-parsing-related methods to take an
ExecutionContext pointer, which the options may inspect if they need
to do so.
Closes https://reviews.llvm.org/D23416
Reviewers: clayborg, jingham
llvm-svn: 278440
diff --git a/lldb/source/Commands/CommandObjectArgs.cpp b/lldb/source/Commands/CommandObjectArgs.cpp
index 206a26f..303563c 100644
--- a/lldb/source/Commands/CommandObjectArgs.cpp
+++ b/lldb/source/Commands/CommandObjectArgs.cpp
@@ -37,16 +37,18 @@
//
CommandObjectArgs::CommandOptions::CommandOptions (CommandInterpreter &interpreter) :
- Options(interpreter)
+ Options()
{
// Keep only one place to reset the values to their defaults
- OptionParsingStarting();
+ OptionParsingStarting(nullptr);
}
CommandObjectArgs::CommandOptions::~CommandOptions() = default;
Error
-CommandObjectArgs::CommandOptions::SetOptionValue (uint32_t option_idx, const char *option_arg)
+CommandObjectArgs::CommandOptions::SetOptionValue(uint32_t option_idx,
+ const char *option_arg,
+ ExecutionContext *execution_context)
{
Error error;
@@ -57,7 +59,8 @@
}
void
-CommandObjectArgs::CommandOptions::OptionParsingStarting ()
+CommandObjectArgs::CommandOptions::OptionParsingStarting(
+ ExecutionContext *execution_context)
{
}