summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Interpreter')
-rw-r--r--lldb/source/Interpreter/CommandInterpreter.cpp37
-rw-r--r--lldb/source/Interpreter/CommandObject.cpp2
-rw-r--r--lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp2
-rw-r--r--lldb/source/Interpreter/ScriptInterpreterPython.cpp15
4 files changed, 30 insertions, 26 deletions
diff --git a/lldb/source/Interpreter/CommandInterpreter.cpp b/lldb/source/Interpreter/CommandInterpreter.cpp
index d2aa0ddbc13..4b4c79a5587 100644
--- a/lldb/source/Interpreter/CommandInterpreter.cpp
+++ b/lldb/source/Interpreter/CommandInterpreter.cpp
@@ -1856,8 +1856,12 @@ PlatformSP
CommandInterpreter::GetPlatform (bool prefer_target_platform)
{
PlatformSP platform_sp;
- if (prefer_target_platform && m_exe_ctx.target)
- platform_sp = m_exe_ctx.target->GetPlatform();
+ if (prefer_target_platform)
+ {
+ Target *target = m_exe_ctx.GetTargetPtr();
+ if (target)
+ platform_sp = target->GetPlatform();
+ }
if (!platform_sp)
platform_sp = m_debugger.GetPlatformList().GetSelectedPlatform();
@@ -2222,31 +2226,32 @@ CommandInterpreter::UpdateExecutionContext (ExecutionContext *override_context)
if (override_context != NULL)
{
- m_exe_ctx.target = override_context->target;
- m_exe_ctx.process = override_context->process;
- m_exe_ctx.thread = override_context->thread;
- m_exe_ctx.frame = override_context->frame;
+ m_exe_ctx = *override_context;
}
else
{
TargetSP target_sp (m_debugger.GetSelectedTarget());
if (target_sp)
{
- m_exe_ctx.target = target_sp.get();
- m_exe_ctx.process = target_sp->GetProcessSP().get();
- if (m_exe_ctx.process && m_exe_ctx.process->IsAlive() && !m_exe_ctx.process->IsRunning())
+ m_exe_ctx.SetTargetSP (target_sp);
+ ProcessSP process_sp (target_sp->GetProcessSP());
+ m_exe_ctx.SetProcessSP (process_sp);
+ if (process_sp && process_sp->IsAlive() && !process_sp->IsRunning())
{
- m_exe_ctx.thread = m_exe_ctx.process->GetThreadList().GetSelectedThread().get();
- if (m_exe_ctx.thread)
+ ThreadSP thread_sp (process_sp->GetThreadList().GetSelectedThread().get());
+ if (thread_sp)
{
- m_exe_ctx.frame = m_exe_ctx.thread->GetSelectedFrame().get();
- if (m_exe_ctx.frame == NULL)
+ m_exe_ctx.SetThreadSP (thread_sp);
+ StackFrameSP frame_sp (thread_sp->GetSelectedFrame());
+ if (!frame_sp)
{
- m_exe_ctx.frame = m_exe_ctx.thread->GetStackFrameAtIndex (0).get();
+ frame_sp = thread_sp->GetStackFrameAtIndex (0);
// If we didn't have a selected frame select one here.
- if (m_exe_ctx.frame != NULL)
- m_exe_ctx.thread->SetSelectedFrame(m_exe_ctx.frame);
+ if (frame_sp)
+ thread_sp->SetSelectedFrame(frame_sp.get());
}
+ if (frame_sp)
+ m_exe_ctx.SetFrameSP (frame_sp);
}
}
}
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp
index eb1c9218492..56f9eecf70c 100644
--- a/lldb/source/Interpreter/CommandObject.cpp
+++ b/lldb/source/Interpreter/CommandObject.cpp
@@ -232,7 +232,7 @@ CommandObject::ExecuteWithOptions (Args& args, CommandReturnObject &result)
if (GetFlags().AnySet (CommandObject::eFlagProcessMustBeLaunched | CommandObject::eFlagProcessMustBePaused))
{
- Process *process = m_interpreter.GetExecutionContext().process;
+ Process *process = m_interpreter.GetExecutionContext().GetProcessPtr();
if (process == NULL)
{
// A process that is not running is considered paused.
diff --git a/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp b/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp
index 4557883ecc0..e4c2b6634fa 100644
--- a/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp
+++ b/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp
@@ -138,7 +138,7 @@ OptionGroupValueObjectDisplay::OptionParsingStarting (CommandInterpreter &interp
be_raw = false;
ignore_cap = false;
- Target *target = interpreter.GetExecutionContext().target;
+ Target *target = interpreter.GetExecutionContext().GetTargetPtr();
if (target != NULL)
use_dynamic = target->GetPreferDynamicValue();
else
diff --git a/lldb/source/Interpreter/ScriptInterpreterPython.cpp b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
index 6b5fe714e9e..634f76d60f6 100644
--- a/lldb/source/Interpreter/ScriptInterpreterPython.cpp
+++ b/lldb/source/Interpreter/ScriptInterpreterPython.cpp
@@ -314,9 +314,9 @@ ScriptInterpreterPython::EnterSession ()
run_string.Clear();
- ExecutionContext exe_ctx = m_interpreter.GetDebugger().GetSelectedExecutionContext();
+ ExecutionContext exe_ctx (m_interpreter.GetDebugger().GetSelectedExecutionContext());
- if (exe_ctx.target)
+ if (exe_ctx.GetTargetPtr())
run_string.Printf ("run_one_line (%s, 'lldb.target = lldb.debugger.GetSelectedTarget()')",
m_dictionary_name.c_str());
else
@@ -324,14 +324,14 @@ ScriptInterpreterPython::EnterSession ()
PyRun_SimpleString (run_string.GetData());
run_string.Clear();
- if (exe_ctx.process)
+ if (exe_ctx.GetProcessPtr())
run_string.Printf ("run_one_line (%s, 'lldb.process = lldb.target.GetProcess()')", m_dictionary_name.c_str());
else
run_string.Printf ("run_one_line (%s, 'lldb.process = None')", m_dictionary_name.c_str());
PyRun_SimpleString (run_string.GetData());
run_string.Clear();
- if (exe_ctx.thread)
+ if (exe_ctx.GetThreadPtr())
run_string.Printf ("run_one_line (%s, 'lldb.thread = lldb.process.GetSelectedThread ()')",
m_dictionary_name.c_str());
else
@@ -339,7 +339,7 @@ ScriptInterpreterPython::EnterSession ()
PyRun_SimpleString (run_string.GetData());
run_string.Clear();
- if (exe_ctx.frame)
+ if (exe_ctx.GetFramePtr())
run_string.Printf ("run_one_line (%s, 'lldb.frame = lldb.thread.GetSelectedFrame ()')",
m_dictionary_name.c_str());
else
@@ -1560,7 +1560,7 @@ ScriptInterpreterPython::BreakpointCallbackFunction
if (!context)
return true;
- Target *target = context->exe_ctx.target;
+ Target *target = context->exe_ctx.GetTargetPtr();
if (!target)
return true;
@@ -1575,8 +1575,7 @@ ScriptInterpreterPython::BreakpointCallbackFunction
if (python_function_name != NULL
&& python_function_name[0] != '\0')
{
- Thread *thread = context->exe_ctx.thread;
- const StackFrameSP stop_frame_sp (thread->GetStackFrameSPForStackFramePtr (context->exe_ctx.frame));
+ const StackFrameSP stop_frame_sp (context->exe_ctx.GetFrameSP());
BreakpointSP breakpoint_sp = target->GetBreakpointByID (break_id);
if (breakpoint_sp)
{
OpenPOWER on IntegriCloud