From 2b29b432d206ee706538b8dad54806d7649fb378 Mon Sep 17 00:00:00 2001 From: Jonas Devlieghere Date: Fri, 26 Apr 2019 22:43:16 +0000 Subject: [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 --- .../Python/ScriptInterpreterPython.cpp | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp') diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp index eabbdcc..a495926 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp +++ b/lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp @@ -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(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(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; -- cgit v1.1