Add a setting to allow users to enable expressions that crash LLDB to show up in crash logs.

<rdar://problem/11549320> 

llvm-svn: 196613
diff --git a/lldb/source/API/SBFrame.cpp b/lldb/source/API/SBFrame.cpp
index 1a1a63b..cff4602 100644
--- a/lldb/source/API/SBFrame.cpp
+++ b/lldb/source/API/SBFrame.cpp
@@ -1386,20 +1386,22 @@
             frame = exe_ctx.GetFramePtr();
             if (frame)
             {
-#ifdef LLDB_CONFIGURATION_DEBUG
-                StreamString frame_description;
-                frame->DumpUsingSettingsFormat (&frame_description);
-                Host::SetCrashDescriptionWithFormat ("SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value = %u) %s",
-                                                     expr, options.GetFetchDynamicValue(), frame_description.GetString().c_str());
-#endif
-                exe_results = target->EvaluateExpression (expr, 
+                if (target->GetDisplayExpressionsInCrashlogs())
+                {
+                    StreamString frame_description;
+                    frame->DumpUsingSettingsFormat (&frame_description);
+                    Host::SetCrashDescriptionWithFormat ("SBFrame::EvaluateExpression (expr = \"%s\", fetch_dynamic_value = %u) %s",
+                                                         expr, options.GetFetchDynamicValue(), frame_description.GetString().c_str());
+                }
+                
+                exe_results = target->EvaluateExpression (expr,
                                                           frame,
                                                           expr_value_sp,
                                                           options.ref());
                 expr_result.SetSP(expr_value_sp, options.GetFetchDynamicValue());
-#ifdef LLDB_CONFIGURATION_DEBUG
-                Host::SetCrashDescription (NULL);
-#endif
+
+                if (target->GetDisplayExpressionsInCrashlogs())
+                    Host::SetCrashDescription (NULL);
             }
             else
             {