diff options
author | Jonas Devlieghere <jonas@devlieghere.com> | 2019-04-26 17:58:19 +0000 |
---|---|---|
committer | Jonas Devlieghere <jonas@devlieghere.com> | 2019-04-26 17:58:19 +0000 |
commit | 8d1fb843274175022b21f348d69a91f3573e1514 (patch) | |
tree | 6d19e3bd8e4609ecdac89b08db383d2624c3fe1e /lldb/source/Core/PluginManager.cpp | |
parent | 1d30f0c93e7c30748d28bf3b916218bdd4124f20 (diff) | |
download | bcm5719-llvm-8d1fb843274175022b21f348d69a91f3573e1514.tar.gz bcm5719-llvm-8d1fb843274175022b21f348d69a91f3573e1514.zip |
[ScriptInterpreter] Pass the debugger instead of the command interpreter
As discussed in D61090, there's no good reason for the script
interpreter to depend on the command interpreter. When looking at the
code, it becomes clear that we mostly use the command interpreter as a
way to access the debugger. Hence, it makes more sense to just pass that
to the script interpreter directly.
This is part 1 out of 2. I have another patch in the pipeline that
changes the ownership of the script interpreter to the debugger as well,
but I didn't get around to finish that today.
Differential revision: https://reviews.llvm.org/D61172
llvm-svn: 359330
Diffstat (limited to 'lldb/source/Core/PluginManager.cpp')
-rw-r--r-- | lldb/source/Core/PluginManager.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lldb/source/Core/PluginManager.cpp b/lldb/source/Core/PluginManager.cpp index f69610cf246..cf940dd7034 100644 --- a/lldb/source/Core/PluginManager.cpp +++ b/lldb/source/Core/PluginManager.cpp @@ -1516,8 +1516,9 @@ PluginManager::GetScriptInterpreterCreateCallbackAtIndex(uint32_t idx) { return nullptr; } -lldb::ScriptInterpreterSP PluginManager::GetScriptInterpreterForLanguage( - lldb::ScriptLanguage script_lang, CommandInterpreter &interpreter) { +lldb::ScriptInterpreterSP +PluginManager::GetScriptInterpreterForLanguage(lldb::ScriptLanguage script_lang, + Debugger &debugger) { std::lock_guard<std::recursive_mutex> guard(GetScriptInterpreterMutex()); ScriptInterpreterInstances &instances = GetScriptInterpreterInstances(); @@ -1528,12 +1529,12 @@ lldb::ScriptInterpreterSP PluginManager::GetScriptInterpreterForLanguage( none_instance = pos->create_callback; if (script_lang == pos->language) - return pos->create_callback(interpreter); + return pos->create_callback(debugger); } // If we didn't find one, return the ScriptInterpreter for the null language. assert(none_instance != nullptr); - return none_instance(interpreter); + return none_instance(debugger); } #pragma mark - |