aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2022-07-18 14:47:35 -0700
committerJim Ingham <jingham@apple.com>2022-07-18 14:49:07 -0700
commite83d47f6b7bd2f8dcf419e03b3a00d5db5bd61c4 (patch)
treef40e665177f12662dc7b85f17a1cae321786fee8 /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
parent5778ada8e54edb2bc2869505b88a959d1915c02f (diff)
downloadllvm-e83d47f6b7bd2f8dcf419e03b3a00d5db5bd61c4.zip
llvm-e83d47f6b7bd2f8dcf419e03b3a00d5db5bd61c4.tar.gz
llvm-e83d47f6b7bd2f8dcf419e03b3a00d5db5bd61c4.tar.bz2
When the module path for `command script import` is invalid, echo the path.
We were just emitting "invalid module" w/o saying which module. That's not particularly helpful. Differential Revision: https://reviews.llvm.org/D129338
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp')
-rw-r--r--lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
index 53e2bcac..a21adcfb 100644
--- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
+++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
@@ -2637,7 +2637,7 @@ bool ScriptInterpreterPythonImpl::LoadScriptingModule(
.SetSetLLDBGlobals(false);
if (!pathname || !pathname[0]) {
- error.SetErrorString("invalid pathname");
+ error.SetErrorString("empty path");
return false;
}
@@ -2707,14 +2707,14 @@ bool ScriptInterpreterPythonImpl::LoadScriptingModule(
// if not a valid file of any sort, check if it might be a filename still
// dot can't be used but / and \ can, and if either is found, reject
if (strchr(pathname, '\\') || strchr(pathname, '/')) {
- error.SetErrorString("invalid pathname");
+ error.SetErrorStringWithFormatv("invalid pathname '{0}'", pathname);
return false;
}
// Not a filename, probably a package of some sort, let it go through.
possible_package = true;
} else if (is_directory(st) || is_regular_file(st)) {
if (module_file.GetDirectory().IsEmpty()) {
- error.SetErrorString("invalid directory name");
+ error.SetErrorStringWithFormatv("invalid directory name '{0}'", pathname);
return false;
}
if (llvm::Error e =