diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-12-22 21:35:05 -0800 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-12-22 21:36:03 -0800 |
commit | 1562511275fe1f002458194c085216cf9ae36d1f (patch) | |
tree | 39e276d5747f75fde7160accbe63109df1ae1c6e /lldb/source/Plugins/ScriptInterpreter/Python | |
parent | b449d19e55888ab9554b04184c6d9716389820fd (diff) | |
download | bcm5719-llvm-1562511275fe1f002458194c085216cf9ae36d1f.tar.gz bcm5719-llvm-1562511275fe1f002458194c085216cf9ae36d1f.zip |
[lldb/ScriptInterpreter] Remove can_reload which is always true (NFC)
The `-r` option for `command script import` is there for legacy
compatibility, however the can_reload flag is always set to true. This
patch removes the flag and any code that relies on it being false.
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp | 12 | ||||
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h | 2 |
2 files changed, 4 insertions, 10 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index 282c6e391f0..1bb3cde7ab2 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -2057,8 +2057,7 @@ ScriptInterpreterPythonImpl::LoadPluginModule(const FileSpec &file_spec, StructuredData::ObjectSP module_sp; - if (LoadScriptingModule(file_spec.GetPath().c_str(), true, true, error, - &module_sp)) + if (LoadScriptingModule(file_spec.GetPath().c_str(), true, error, &module_sp)) return module_sp; return StructuredData::ObjectSP(); @@ -2737,8 +2736,8 @@ uint64_t replace_all(std::string &str, const std::string &oldStr, } bool ScriptInterpreterPythonImpl::LoadScriptingModule( - const char *pathname, bool can_reload, bool init_session, - lldb_private::Status &error, StructuredData::ObjectSP *module_sp) { + const char *pathname, bool init_session, lldb_private::Status &error, + StructuredData::ObjectSP *module_sp) { if (!pathname || !pathname[0]) { error.SetErrorString("invalid pathname"); return false; @@ -2838,11 +2837,6 @@ bool ScriptInterpreterPythonImpl::LoadScriptingModule( bool was_imported = (was_imported_globally || was_imported_locally); - if (was_imported && !can_reload) { - error.SetErrorString("module already imported"); - return false; - } - // now actually do the import command_stream.Clear(); diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h index 81c6eb0aa6c..1fa198b07e5 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h @@ -224,7 +224,7 @@ public: std::string &output, Status &error) override; bool - LoadScriptingModule(const char *filename, bool can_reload, bool init_session, + LoadScriptingModule(const char *filename, bool init_session, lldb_private::Status &error, StructuredData::ObjectSP *module_sp = nullptr) override; |