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/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.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/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp')
-rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp b/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp index 8129af0b833..7b959837955 100644 --- a/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.cpp @@ -10,7 +10,6 @@ #include "lldb/Core/Debugger.h" #include "lldb/Core/PluginManager.h" #include "lldb/Core/StreamFile.h" -#include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Utility/Stream.h" #include "lldb/Utility/StringList.h" @@ -21,21 +20,21 @@ using namespace lldb; using namespace lldb_private; -ScriptInterpreterNone::ScriptInterpreterNone(CommandInterpreter &interpreter) - : ScriptInterpreter(interpreter, eScriptLanguageNone) {} +ScriptInterpreterNone::ScriptInterpreterNone(Debugger &debugger) + : ScriptInterpreter(debugger, eScriptLanguageNone) {} ScriptInterpreterNone::~ScriptInterpreterNone() {} bool ScriptInterpreterNone::ExecuteOneLine(llvm::StringRef command, CommandReturnObject *, const ExecuteScriptOptions &) { - m_interpreter.GetDebugger().GetErrorFile()->PutCString( + m_debugger.GetErrorFile()->PutCString( "error: there is no embedded script interpreter in this mode.\n"); return false; } void ScriptInterpreterNone::ExecuteInterpreterLoop() { - m_interpreter.GetDebugger().GetErrorFile()->PutCString( + m_debugger.GetErrorFile()->PutCString( "error: there is no embedded script interpreter in this mode.\n"); } @@ -52,8 +51,8 @@ void ScriptInterpreterNone::Initialize() { void ScriptInterpreterNone::Terminate() {} lldb::ScriptInterpreterSP -ScriptInterpreterNone::CreateInstance(CommandInterpreter &interpreter) { - return std::make_shared<ScriptInterpreterNone>(interpreter); +ScriptInterpreterNone::CreateInstance(Debugger &debugger) { + return std::make_shared<ScriptInterpreterNone>(debugger); } lldb_private::ConstString ScriptInterpreterNone::GetPluginNameStatic() { |