There is no need to hold onto an ExecutionContext as a member variable. 
ExecutionContext objects have shared pointers to Target, Process, Thread
and Frame objects and they can end up being held onto for too long.



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@149133 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectExpression.cpp b/source/Commands/CommandObjectExpression.cpp
index 301ce82..262d0b5 100644
--- a/source/Commands/CommandObjectExpression.cpp
+++ b/source/Commands/CommandObjectExpression.cpp
@@ -282,7 +282,7 @@
     CommandReturnObject *result
 )
 {
-    Target *target = m_exe_ctx.GetTargetPtr();
+    Target *target = m_interpreter.GetExecutionContext().GetTargetPtr();
     
     if (!target)
         target = Host::GetDummyTarget(m_interpreter.GetDebugger()).get();
@@ -310,7 +310,7 @@
         }
         
         exe_results = target->EvaluateExpression (expr, 
-                                                  m_exe_ctx.GetFramePtr(),
+                                                  m_interpreter.GetExecutionContext().GetFramePtr(),
                                                   eExecutionPolicyOnlyWhenNeeded,
                                                   m_command_options.print_object,
                                                   m_command_options.unwind_on_error,
@@ -323,7 +323,7 @@
             uint32_t start_frame = 0;
             uint32_t num_frames = 1;
             uint32_t num_frames_with_source = 0;
-            Thread *thread = m_exe_ctx.GetThreadPtr();
+            Thread *thread = m_interpreter.GetExecutionContext().GetThreadPtr();
             if (thread)
             {
                 thread->GetStatus (result->GetOutputStream(), 
@@ -333,7 +333,7 @@
             }
             else 
             {
-                Process *process = m_exe_ctx.GetProcessPtr();
+                Process *process = m_interpreter.GetExecutionContext().GetProcessPtr();
                 if (process)
                 {
                     bool only_threads_with_stop_reason = true;
@@ -422,8 +422,6 @@
     CommandReturnObject &result
 )
 {
-    m_exe_ctx = m_interpreter.GetExecutionContext();
-
     m_option_group.NotifyOptionParsingStarting();
 
     const char * expr = NULL;