Target::EvaluateExpression should suppress stop hooks.

git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@131219 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Target.cpp b/source/Target/Target.cpp
index 942d081..387a336 100644
--- a/source/Target/Target.cpp
+++ b/source/Target/Target.cpp
@@ -59,7 +59,8 @@
     m_scratch_ast_context_ap (NULL),
     m_persistent_variables (),
     m_stop_hooks (),
-    m_stop_hook_next_id (0)
+    m_stop_hook_next_id (0),
+    m_suppress_stop_hooks (false)
 {
     SetEventName (eBroadcastBitBreakpointChanged, "breakpoint-changed");
     SetEventName (eBroadcastBitModulesLoaded, "modules-loaded");
@@ -900,6 +901,11 @@
     ExecutionResults execution_results = eExecutionSetupError;
 
     result_valobj_sp.reset();
+    
+    // We shouldn't run stop hooks in expressions.
+    // Be sure to reset this if you return anywhere within this function.
+    bool old_suppress_value = m_suppress_stop_hooks;
+    m_suppress_stop_hooks = true;
 
     ExecutionContext exe_ctx;
     if (frame)
@@ -1002,6 +1008,9 @@
                                                                result_valobj_sp);
         }
     }
+    
+    m_suppress_stop_hooks = old_suppress_value;
+    
     return execution_results;
 }
 
@@ -1068,6 +1077,9 @@
 void
 Target::RunStopHooks ()
 {
+    if (m_suppress_stop_hooks)
+        return;
+        
     if (!m_process_sp)
         return;