diff options
Diffstat (limited to 'lldb/source/Target/ThreadPlanPython.cpp')
-rw-r--r-- | lldb/source/Target/ThreadPlanPython.cpp | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/lldb/source/Target/ThreadPlanPython.cpp b/lldb/source/Target/ThreadPlanPython.cpp index df432a0af3dae..8171186319f5c 100644 --- a/lldb/source/Target/ThreadPlanPython.cpp +++ b/lldb/source/Target/ThreadPlanPython.cpp @@ -1,4 +1,4 @@ -//===-- ThreadPlanPython.cpp ------------------------------------*- C++ -*-===// +//===-- ThreadPlanPython.cpp ----------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -55,15 +55,16 @@ bool ThreadPlanPython::ValidatePlan(Stream *error) { return true; } +ScriptInterpreter *ThreadPlanPython::GetScriptInterpreter() { + return m_process.GetTarget().GetDebugger().GetScriptInterpreter(); +} + void ThreadPlanPython::DidPush() { // We set up the script side in DidPush, so that it can push other plans in // the constructor, and doesn't have to care about the details of DidPush. m_did_push = true; if (!m_class_name.empty()) { - ScriptInterpreter *script_interp = m_thread.GetProcess() - ->GetTarget() - .GetDebugger() - .GetScriptInterpreter(); + ScriptInterpreter *script_interp = GetScriptInterpreter(); if (script_interp) { m_implementation_sp = script_interp->CreateScriptedThreadPlan( m_class_name.c_str(), m_args_data, m_error_str, @@ -79,10 +80,7 @@ bool ThreadPlanPython::ShouldStop(Event *event_ptr) { bool should_stop = true; if (m_implementation_sp) { - ScriptInterpreter *script_interp = m_thread.GetProcess() - ->GetTarget() - .GetDebugger() - .GetScriptInterpreter(); + ScriptInterpreter *script_interp = GetScriptInterpreter(); if (script_interp) { bool script_error; should_stop = script_interp->ScriptedThreadPlanShouldStop( @@ -101,10 +99,7 @@ bool ThreadPlanPython::IsPlanStale() { bool is_stale = true; if (m_implementation_sp) { - ScriptInterpreter *script_interp = m_thread.GetProcess() - ->GetTarget() - .GetDebugger() - .GetScriptInterpreter(); + ScriptInterpreter *script_interp = GetScriptInterpreter(); if (script_interp) { bool script_error; is_stale = script_interp->ScriptedThreadPlanIsStale(m_implementation_sp, @@ -123,10 +118,7 @@ bool ThreadPlanPython::DoPlanExplainsStop(Event *event_ptr) { bool explains_stop = true; if (m_implementation_sp) { - ScriptInterpreter *script_interp = m_thread.GetProcess() - ->GetTarget() - .GetDebugger() - .GetScriptInterpreter(); + ScriptInterpreter *script_interp = GetScriptInterpreter(); if (script_interp) { bool script_error; explains_stop = script_interp->ScriptedThreadPlanExplainsStop( @@ -159,10 +151,7 @@ lldb::StateType ThreadPlanPython::GetPlanRunState() { m_class_name.c_str()); lldb::StateType run_state = eStateRunning; if (m_implementation_sp) { - ScriptInterpreter *script_interp = m_thread.GetProcess() - ->GetTarget() - .GetDebugger() - .GetScriptInterpreter(); + ScriptInterpreter *script_interp = GetScriptInterpreter(); if (script_interp) { bool script_error; run_state = script_interp->ScriptedThreadPlanGetRunState( |