[ScriptInterpreter] Move ownership into debugger (NFC)

This is part two of the change started in r359330. This patch moves the
ownership of the script interpreter from the command interpreter into
the debugger. I would've preferred to remove the lazy initialization,
however the fact that the scripting language is set after the debugger
is created makes that tricky. So for now this does exactly the same
thing as when it was under the command interpreter. The result is that
this patch is fully NFC.

Differential revision: https://reviews.llvm.org/D61211

llvm-svn: 359354
This commit is contained in:
Jonas Devlieghere
2019-04-26 22:43:16 +00:00
parent 3bf116c1a4
commit 2b29b432d2
29 changed files with 76 additions and 104 deletions

View File

@@ -1285,9 +1285,8 @@ void ScriptInterpreterPythonImpl::SetBreakpointCommandCallbackFunction(
std::string oneliner("return ");
oneliner += function_name;
oneliner += "(frame, bp_loc, internal_dict)";
m_debugger.GetCommandInterpreter()
.GetScriptInterpreter()
->SetBreakpointCommandCallback(bp_options, oneliner.c_str());
m_debugger.GetScriptInterpreter()->SetBreakpointCommandCallback(
bp_options, oneliner.c_str());
}
Status ScriptInterpreterPythonImpl::SetBreakpointCommandCallback(
@@ -1862,8 +1861,7 @@ StructuredData::ObjectSP ScriptInterpreterPythonImpl::CreateScriptedThreadPlan(
return StructuredData::ObjectSP();
Debugger &debugger = thread_plan_sp->GetTarget().GetDebugger();
ScriptInterpreter *script_interpreter =
debugger.GetCommandInterpreter().GetScriptInterpreter();
ScriptInterpreter *script_interpreter = debugger.GetScriptInterpreter();
ScriptInterpreterPythonImpl *python_interpreter =
static_cast<ScriptInterpreterPythonImpl *>(script_interpreter);
@@ -1967,8 +1965,7 @@ ScriptInterpreterPythonImpl::CreateScriptedBreakpointResolver(
return StructuredData::GenericSP();
Debugger &debugger = bkpt_sp->GetTarget().GetDebugger();
ScriptInterpreter *script_interpreter =
debugger.GetCommandInterpreter().GetScriptInterpreter();
ScriptInterpreter *script_interpreter = debugger.GetScriptInterpreter();
ScriptInterpreterPythonImpl *python_interpreter =
static_cast<ScriptInterpreterPythonImpl *>(script_interpreter);
@@ -2083,8 +2080,7 @@ ScriptInterpreterPythonImpl::CreateSyntheticScriptedProvider(
return StructuredData::ObjectSP();
Debugger &debugger = target->GetDebugger();
ScriptInterpreter *script_interpreter =
debugger.GetCommandInterpreter().GetScriptInterpreter();
ScriptInterpreter *script_interpreter = debugger.GetScriptInterpreter();
ScriptInterpreterPythonImpl *python_interpreter =
(ScriptInterpreterPythonImpl *)script_interpreter;
@@ -2262,8 +2258,7 @@ bool ScriptInterpreterPythonImpl::BreakpointCallbackFunction(
return true;
Debugger &debugger = target->GetDebugger();
ScriptInterpreter *script_interpreter =
debugger.GetCommandInterpreter().GetScriptInterpreter();
ScriptInterpreter *script_interpreter = debugger.GetScriptInterpreter();
ScriptInterpreterPythonImpl *python_interpreter =
(ScriptInterpreterPythonImpl *)script_interpreter;
@@ -2313,8 +2308,7 @@ bool ScriptInterpreterPythonImpl::WatchpointCallbackFunction(
return true;
Debugger &debugger = target->GetDebugger();
ScriptInterpreter *script_interpreter =
debugger.GetCommandInterpreter().GetScriptInterpreter();
ScriptInterpreter *script_interpreter = debugger.GetScriptInterpreter();
ScriptInterpreterPythonImpl *python_interpreter =
(ScriptInterpreterPythonImpl *)script_interpreter;