aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Interpreter/ScriptInterpreter.cpp
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2020-10-27 09:14:40 -0700
committerJonas Devlieghere <jonas@devlieghere.com>2020-10-27 09:20:45 -0700
commit00bb397b0dc79fcad27bfe63456a2100039706f2 (patch)
treec1b5cddc681cb2104a68409abcafe6fce70d1c6e /lldb/source/Interpreter/ScriptInterpreter.cpp
parentd028d2b376a1a01404e9766f9303a24771baab1f (diff)
downloadllvm-00bb397b0dc79fcad27bfe63456a2100039706f2.zip
llvm-00bb397b0dc79fcad27bfe63456a2100039706f2.tar.gz
llvm-00bb397b0dc79fcad27bfe63456a2100039706f2.tar.bz2
[lldb] Support Python imports relative the to the current file being sourced
Make it possible to use a relative path in command script import to the location of the file being sourced. This allows the user to put Python scripts next to LLDB command files and importing them without having to specify an absolute path. To enable this behavior pass `-c` to `command script import`. The argument can only be used when sourcing the command from a file. rdar://68310384 Differential revision: https://reviews.llvm.org/D89334
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreter.cpp')
-rw-r--r--lldb/source/Interpreter/ScriptInterpreter.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp
index 8662044..013ed6a 100644
--- a/lldb/source/Interpreter/ScriptInterpreter.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreter.cpp
@@ -47,9 +47,11 @@ void ScriptInterpreter::CollectDataForWatchpointCommandCallback(
"This script interpreter does not support watchpoint callbacks.");
}
-bool ScriptInterpreter::LoadScriptingModule(
- const char *filename, bool init_session, lldb_private::Status &error,
- StructuredData::ObjectSP *module_sp) {
+bool ScriptInterpreter::LoadScriptingModule(const char *filename,
+ bool init_session,
+ lldb_private::Status &error,
+ StructuredData::ObjectSP *module_sp,
+ FileSpec extra_search_dir) {
error.SetErrorString(
"This script interpreter does not support importing modules.");
return false;