summaryrefslogtreecommitdiffstats
path: root/lldb
diff options
context:
space:
mode:
Diffstat (limited to 'lldb')
-rw-r--r--lldb/tools/driver/Driver.cpp11
-rw-r--r--lldb/tools/driver/Options.td16
2 files changed, 19 insertions, 8 deletions
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp
index 8a86fe0bf44..295273271e1 100644
--- a/lldb/tools/driver/Driver.cpp
+++ b/lldb/tools/driver/Driver.cpp
@@ -373,13 +373,14 @@ SBError Driver::ProcessArgs(const opt::InputArgList &args, bool &exiting) {
}
}
- if (auto *arg = args.getLastArg(OPT_repl)) {
- auto arg_value = arg->getValue();
+ if (args.hasArg(OPT_repl)) {
m_option_data.m_repl = true;
- if (arg_value && arg_value[0])
+ }
+
+ if (auto *arg = args.getLastArg(OPT_repl_)) {
+ m_option_data.m_repl = true;
+ if (auto arg_value = arg->getValue())
m_option_data.m_repl_options = arg_value;
- else
- m_option_data.m_repl_options.clear();
}
// We need to process the options below together as their relative order
diff --git a/lldb/tools/driver/Options.td b/lldb/tools/driver/Options.td
index 4a2ddfeefa3..563c0b54fb9 100644
--- a/lldb/tools/driver/Options.td
+++ b/lldb/tools/driver/Options.td
@@ -46,7 +46,8 @@ def: Flag<["-"], "P">,
HelpText<"Alias for --python-path">,
Group<grp_scripting>;
-def script_language: Separate<["--", "-"], "script-language">, MetaVarName<"<language>">,
+def script_language: Separate<["--", "-"], "script-language">,
+ MetaVarName<"<language>">,
HelpText<"Tells the debugger to use the specified scripting language for user-defined scripts.">,
Group<grp_scripting>;
def: Separate<["-"], "l">,
@@ -57,13 +58,22 @@ def: Separate<["-"], "l">,
// Repl options.
def grp_repl : OptionGroup<"repl">, HelpText<"REPL">;
-def repl: Separate<["--", "-"], "repl">,
+def repl: Flag<["--", "-"], "repl">,
HelpText<"Runs lldb in REPL mode with a stub process.">,
Group<grp_repl>;
-def: Separate<["-"], "r">,
+def: Flag<["-"], "r">,
Alias<repl>,
HelpText<"Alias for --repl">,
Group<grp_repl>;
+def repl_: Joined<["--", "-"], "repl=">,
+ MetaVarName<"<flags>">,
+ HelpText<"Runs lldb in REPL mode with a stub process with the given flags.">,
+ Group<grp_repl>;
+def: Joined<["-"], "r=">,
+ MetaVarName<"<flags>">,
+ Alias<repl_>,
+ HelpText<"Alias for --repl=<flags>">,
+ Group<grp_repl>;
def repl_language: Separate<["--", "-"], "repl-language">,
MetaVarName<"<language>">,
OpenPOWER on IntegriCloud