summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter/CommandObjectScript.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-02-19 22:34:01 +0000
committerEnrico Granata <egranata@apple.com>2013-02-19 22:34:01 +0000
commit4af6bf63ca5e1636b8d3cb51b78f23a947228fb9 (patch)
tree6847b8e541360262a058bb4db71ceea17095d542 /lldb/source/Interpreter/CommandObjectScript.cpp
parent10c97e5ca0d9214ac2296b1f07a50fbaf9477b04 (diff)
downloadbcm5719-llvm-4af6bf63ca5e1636b8d3cb51b78f23a947228fb9.tar.gz
bcm5719-llvm-4af6bf63ca5e1636b8d3cb51b78f23a947228fb9.zip
<rdar://problem/13147878>
Be more user-friendly about not having scripting enabled: a) if Python was built-out then tell people about it explicitly b) if we are told to use none as a scripting language, then tell people about that too This should limit the cases where the semi-cryptic error message "there is no embedded script interpreter in this mode." actually shows llvm-svn: 175570
Diffstat (limited to 'lldb/source/Interpreter/CommandObjectScript.cpp')
-rw-r--r--lldb/source/Interpreter/CommandObjectScript.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/CommandObjectScript.cpp b/lldb/source/Interpreter/CommandObjectScript.cpp
index a757817e935..e74c1f9ff99 100644
--- a/lldb/source/Interpreter/CommandObjectScript.cpp
+++ b/lldb/source/Interpreter/CommandObjectScript.cpp
@@ -51,6 +51,19 @@ CommandObjectScript::DoExecute
CommandReturnObject &result
)
{
+#ifdef LLDB_DISABLE_PYTHON
+ // if we ever support languages other than Python this simple #ifdef won't work
+ result.AppendError("your copy of LLDB does not support scripting.")
+ result.SetStatus (eReturnStatusFailed);
+ return false;
+#else
+ if (m_interpreter.GetDebugger().GetScriptLanguage() == lldb::eScriptLanguageNone)
+ {
+ result.AppendError("the script-lang setting is set to none - scripting not available");
+ result.SetStatus (eReturnStatusFailed);
+ return false;
+ }
+
ScriptInterpreter *script_interpreter = m_interpreter.GetScriptInterpreter ();
if (script_interpreter == NULL)
@@ -76,4 +89,5 @@ CommandObjectScript::DoExecute
result.SetStatus(eReturnStatusFailed);
return result.Succeeded();
+#endif
}
OpenPOWER on IntegriCloud