summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
diff options
context:
space:
mode:
authorJonas Devlieghere <jonas@devlieghere.com>2019-04-26 17:58:19 +0000
committerJonas Devlieghere <jonas@devlieghere.com>2019-04-26 17:58:19 +0000
commit8d1fb843274175022b21f348d69a91f3573e1514 (patch)
tree6d19e3bd8e4609ecdac89b08db383d2624c3fe1e /lldb/source/Interpreter
parent1d30f0c93e7c30748d28bf3b916218bdd4124f20 (diff)
downloadbcm5719-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/Interpreter')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp2
-rw-r--r--lldb/source/Interpreter/ScriptInterpreter.cpp8
2 files changed, 3 insertions, 7 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index 78241233432..84707156871 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -2507,7 +2507,7 @@ ScriptInterpreter *CommandInterpreter::GetScriptInterpreter(bool can_create) {
return nullptr;
lldb::ScriptLanguage script_lang = GetDebugger().GetScriptLanguage();
m_script_interpreter_sp =
- PluginManager::GetScriptInterpreterForLanguage(script_lang, *this);
+ PluginManager::GetScriptInterpreterForLanguage(script_lang, m_debugger);
}
return m_script_interpreter_sp.get();
}
diff --git a/lldb/source/Interpreter/ScriptInterpreter.cpp b/lldb/source/Interpreter/ScriptInterpreter.cpp
index 52fd77e3739..d04baec76e6 100644
--- a/lldb/source/Interpreter/ScriptInterpreter.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreter.cpp
@@ -21,16 +21,12 @@
using namespace lldb;
using namespace lldb_private;
-ScriptInterpreter::ScriptInterpreter(CommandInterpreter &interpreter,
+ScriptInterpreter::ScriptInterpreter(Debugger &debugger,
lldb::ScriptLanguage script_lang)
- : m_interpreter(interpreter), m_script_lang(script_lang) {}
+ : m_debugger(debugger), m_script_lang(script_lang) {}
ScriptInterpreter::~ScriptInterpreter() {}
-CommandInterpreter &ScriptInterpreter::GetCommandInterpreter() {
- return m_interpreter;
-}
-
void ScriptInterpreter::CollectDataForBreakpointCommandCallback(
std::vector<BreakpointOptions *> &bp_options_vec,
CommandReturnObject &result) {
OpenPOWER on IntegriCloud