Skip to content

Commit bc00c8f

Browse files
committed
[lldb] Improve error message for script commands when there's no interpreter
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 lanugage 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.
1 parent 28f62d7 commit bc00c8f

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,19 @@ ScriptInterpreterNone::ScriptInterpreterNone(Debugger &debugger)
2626

2727
ScriptInterpreterNone::~ScriptInterpreterNone() = default;
2828

29+
static const char *no_interpreter_err_msg =
30+
"error: Embedded script interpreter unavailable. LLDB was built without "
31+
"scripting language support.\n";
32+
2933
bool ScriptInterpreterNone::ExecuteOneLine(llvm::StringRef command,
3034
CommandReturnObject *,
3135
const ExecuteScriptOptions &) {
32-
m_debugger.GetErrorStream().PutCString(
33-
"error: there is no embedded script interpreter in this mode.\n");
36+
m_debugger.GetErrorStream().PutCString(no_interpreter_err_msg);
3437
return false;
3538
}
3639

3740
void ScriptInterpreterNone::ExecuteInterpreterLoop() {
38-
m_debugger.GetErrorStream().PutCString(
39-
"error: there is no embedded script interpreter in this mode.\n");
41+
m_debugger.GetErrorStream().PutCString(no_interpreter_err_msg);
4042
}
4143

4244
void ScriptInterpreterNone::Initialize() {

0 commit comments

Comments
 (0)