diff options
author | Greg Clayton <gclayton@apple.com> | 2011-09-22 04:58:26 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-09-22 04:58:26 +0000 |
commit | c14ee32db561671a16759c8307d5391646cb87c4 (patch) | |
tree | 33eea53e3b30461a2452c79eca2e668aa9537500 /lldb/source/Interpreter/ScriptInterpreterPython.cpp | |
parent | 3d10b95bf7f72dd7abbb1bb6a8412708a579d315 (diff) | |
download | bcm5719-llvm-c14ee32db561671a16759c8307d5391646cb87c4.tar.gz bcm5719-llvm-c14ee32db561671a16759c8307d5391646cb87c4.zip |
Converted the lldb_private::Process over to use the intrusive
shared pointers.
Changed the ExecutionContext over to use shared pointers for
the target, process, thread and frame since these objects can
easily go away at any time and any object that was holding onto
an ExecutionContext was running the risk of using a bad object.
Now that the shared pointers for target, process, thread and
frame are just a single pointer (they all use the instrusive
shared pointers) the execution context is much safer and still
the same size.
Made the shared pointers in the the ExecutionContext class protected
and made accessors for all of the various ways to get at the pointers,
references, and shared pointers.
llvm-svn: 140298
Diffstat (limited to 'lldb/source/Interpreter/ScriptInterpreterPython.cpp')
-rw-r--r-- | lldb/source/Interpreter/ScriptInterpreterPython.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
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) { |