summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Debugger.cpp
diff options
context:
space:
mode:
authorSean Callanan <scallanan@apple.com>2015-10-21 19:31:17 +0000
committerSean Callanan <scallanan@apple.com>2015-10-21 19:31:17 +0000
commit97f84e870fe69a329dd6f5e92670647bc0cb7f03 (patch)
tree277b1fae1ac58ff793500ebfccb46992b1e66d59 /lldb/source/Core/Debugger.cpp
parent9ac7a6c51f8643e8a44af41efca0c8c148315bc5 (diff)
downloadbcm5719-llvm-97f84e870fe69a329dd6f5e92670647bc0cb7f03.tar.gz
bcm5719-llvm-97f84e870fe69a329dd6f5e92670647bc0cb7f03.zip
Fix error handling when there are no REPLs installed.
Before, in the absence of any configured REPLs, LLDB would act as if there were multiple possible REPL options, whereas actually no REPL language is supported. Now we make a better error. llvm-svn: 250931
Diffstat (limited to 'lldb/source/Core/Debugger.cpp')
-rw-r--r--lldb/source/Core/Debugger.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index 494b762e872..2b8e822c4a2 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -1806,6 +1806,28 @@ Debugger::RunREPL (LanguageType language, const char *repl_options)
Error err;
FileSpec repl_executable;
+ if (language == eLanguageTypeUnknown)
+ {
+ std::set<LanguageType> repl_languages;
+
+ Language::GetLanguagesSupportingREPLs(repl_languages);
+
+ if (repl_languages.size() == 1)
+ {
+ language = *repl_languages.begin();
+ }
+ else if (repl_languages.size() == 0)
+ {
+ err.SetErrorStringWithFormat("LLDB isn't configured with support support for any REPLs.");
+ return err;
+ }
+ else
+ {
+ err.SetErrorStringWithFormat("Multiple possible REPL languages. Please specify a language.");
+ return err;
+ }
+ }
+
Target *const target = nullptr; // passing in an empty target means the REPL must create one
REPLSP repl_sp(REPL::Create(err, language, this, target, repl_options));
OpenPOWER on IntegriCloud