diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2020-10-27 09:14:40 -0700 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2020-10-27 09:20:45 -0700 |
commit | 00bb397b0dc79fcad27bfe63456a2100039706f2 (patch) | |
tree | c1b5cddc681cb2104a68409abcafe6fce70d1c6e /lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h | |
parent | d028d2b376a1a01404e9766f9303a24771baab1f (diff) | |
download | llvm-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/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h index f89c3d4..45dad42 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h @@ -231,10 +231,10 @@ public: bool RunScriptFormatKeyword(const char *impl_function, ValueObject *value, std::string &output, Status &error) override; - bool - LoadScriptingModule(const char *filename, bool init_session, - lldb_private::Status &error, - StructuredData::ObjectSP *module_sp = nullptr) override; + bool LoadScriptingModule(const char *filename, bool init_session, + lldb_private::Status &error, + StructuredData::ObjectSP *module_sp = nullptr, + FileSpec extra_search_dir = {}) override; bool IsReservedWord(const char *word) override; |