Author: David Spickett
Date: 2023-11-27T09:10:39Z
New Revision: 8167934480a7b6a8e122aa6233aa8ed2e2683d6a

URL: 
https://github.com/llvm/llvm-project/commit/8167934480a7b6a8e122aa6233aa8ed2e2683d6a
DIFF: 
https://github.com/llvm/llvm-project/commit/8167934480a7b6a8e122aa6233aa8ed2e2683d6a.diff

LOG: [lldb] Improve error message for script commands when there's no 
interpreter (#73321)

It was:
```
error: there is no embedded script interpreter in this mode.
```

1. What does "mode" mean?
2. It implies there might be an embedded script interpreter for some
other "mode", whatever that would be.

So I'm simplifying it and noting the most common reason for this which
is that lldb wasn't built with a scripting language enabled in the first
place.

There are other tips for dealing with this, but I'm not sure this
message is the best place for them.

Added: 
    

Modified: 
    lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp

Removed: 
    


################################################################################
diff  --git 
a/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp 
b/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
index 7df8b55fc7f55b1..7aeee6e40395432 100644
--- a/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp
@@ -26,17 +26,19 @@ ScriptInterpreterNone::ScriptInterpreterNone(Debugger 
&debugger)
 
 ScriptInterpreterNone::~ScriptInterpreterNone() = default;
 
+static const char *no_interpreter_err_msg =
+    "error: Embedded script interpreter unavailable. LLDB was built without "
+    "scripting language support.\n";
+
 bool ScriptInterpreterNone::ExecuteOneLine(llvm::StringRef command,
                                            CommandReturnObject *,
                                            const ExecuteScriptOptions &) {
-  m_debugger.GetErrorStream().PutCString(
-      "error: there is no embedded script interpreter in this mode.\n");
+  m_debugger.GetErrorStream().PutCString(no_interpreter_err_msg);
   return false;
 }
 
 void ScriptInterpreterNone::ExecuteInterpreterLoop() {
-  m_debugger.GetErrorStream().PutCString(
-      "error: there is no embedded script interpreter in this mode.\n");
+  m_debugger.GetErrorStream().PutCString(no_interpreter_err_msg);
 }
 
 void ScriptInterpreterNone::Initialize() {


        
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to