Synthetic values are now automatically enabled and active by default. SBValue is set up to always wrap a synthetic value when one is available.
A new setting enable-synthetic-value is provided on the target to disable this behavior.
There also is a new GetNonSyntheticValue() API call on SBValue to go back from synthetic to non-synthetic. There is no call to go from non-synthetic to synthetic.
The test suite has been changed accordingly.
Fallout from changes to type searching: an hack has to be played to make it possible to use maps that contain std::string due to the special name replacement operated by clang
Fixing a test case that was using libstdcpp instead of libc++ - caught as a consequence of said changes to type searching


git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@153495 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Target.cpp b/source/Target/Target.cpp
index 6648d4c..34fb4b8 100644
--- a/source/Target/Target.cpp
+++ b/source/Target/Target.cpp
@@ -73,7 +73,8 @@
     m_source_manager(*this),
     m_stop_hooks (),
     m_stop_hook_next_id (0),
-    m_suppress_stop_hooks (false)
+    m_suppress_stop_hooks (false),
+    m_suppress_synthetic_value(false)
 {
     SetEventName (eBroadcastBitBreakpointChanged, "breakpoint-changed");
     SetEventName (eBroadcastBitModulesLoaded, "modules-loaded");
@@ -183,6 +184,7 @@
     m_stop_hooks.clear();
     m_stop_hook_next_id = 0;
     m_suppress_stop_hooks = false;
+    m_suppress_synthetic_value = false;
 }
 
 
@@ -2106,6 +2108,7 @@
 #define TSC_DEFAULT_ARCH        "default-arch"
 #define TSC_EXPR_PREFIX         "expr-prefix"
 #define TSC_PREFER_DYNAMIC      "prefer-dynamic-value"
+#define TSC_ENABLE_SYNTHETIC    "enable-synthetic-value"
 #define TSC_SKIP_PROLOGUE       "skip-prologue"
 #define TSC_SOURCE_MAP          "source-map"
 #define TSC_EXE_SEARCH_PATHS    "exec-search-paths"
@@ -2144,6 +2147,13 @@
 }
 
 static const ConstString &
+GetSettingNameForEnableSyntheticValue ()
+{
+    static ConstString g_const_string (TSC_ENABLE_SYNTHETIC);
+    return g_const_string;
+}
+
+static const ConstString &
 GetSettingNameForSourcePathMap ()
 {
     static ConstString g_const_string (TSC_SOURCE_MAP);
@@ -2291,6 +2301,7 @@
     m_expr_prefix_file (),
     m_expr_prefix_contents (),
     m_prefer_dynamic_value (2),
+    m_enable_synthetic_value(true, true),
     m_skip_prologue (true, true),
     m_source_map (NULL, NULL),
     m_exe_search_paths (),
@@ -2330,6 +2341,7 @@
     m_expr_prefix_file (rhs.m_expr_prefix_file),
     m_expr_prefix_contents (rhs.m_expr_prefix_contents),
     m_prefer_dynamic_value (rhs.m_prefer_dynamic_value),
+    m_enable_synthetic_value(rhs.m_enable_synthetic_value),
     m_skip_prologue (rhs.m_skip_prologue),
     m_source_map (rhs.m_source_map),
     m_exe_search_paths (rhs.m_exe_search_paths),
@@ -2365,6 +2377,7 @@
         m_expr_prefix_file = rhs.m_expr_prefix_file;
         m_expr_prefix_contents = rhs.m_expr_prefix_contents;
         m_prefer_dynamic_value = rhs.m_prefer_dynamic_value;
+        m_enable_synthetic_value = rhs.m_enable_synthetic_value;
         m_skip_prologue = rhs.m_skip_prologue;
         m_source_map = rhs.m_source_map;
         m_exe_search_paths = rhs.m_exe_search_paths;
@@ -2442,6 +2455,13 @@
         if (err.Success())
             m_prefer_dynamic_value = new_value;
     }
+    else if (var_name == GetSettingNameForEnableSyntheticValue())
+    {
+        bool ok;
+        bool new_value = Args::StringToBoolean(value, true, &ok);
+        if (ok)
+            m_enable_synthetic_value.SetCurrentValue(new_value);
+    }
     else if (var_name == GetSettingNameForSkipPrologue())
     {
         err = UserSettingsController::UpdateBooleanOptionValue (value, op, m_skip_prologue);
@@ -2626,6 +2646,13 @@
     {
         value.AppendString (g_dynamic_value_types[m_prefer_dynamic_value].string_value);
     }
+    else if (var_name == GetSettingNameForEnableSyntheticValue())
+    {
+        if (m_skip_prologue)
+            value.AppendString ("true");
+        else
+            value.AppendString ("false");
+    }
     else if (var_name == GetSettingNameForSkipPrologue())
     {
         if (m_skip_prologue)
@@ -2824,6 +2851,7 @@
     // =================    ==================  =============== ======================= ====== ====== =========================================================================
     { TSC_EXPR_PREFIX       , eSetVarTypeString , NULL          , NULL,                  false, false, "Path to a file containing expressions to be prepended to all expressions." },
     { TSC_PREFER_DYNAMIC    , eSetVarTypeEnum   , NULL          , g_dynamic_value_types, false, false, "Should printed values be shown as their dynamic value." },
+    { TSC_ENABLE_SYNTHETIC  , eSetVarTypeBoolean, "true"        , NULL,                  false, false, "Should synthetic values be used by default whenever available." },
     { TSC_SKIP_PROLOGUE     , eSetVarTypeBoolean, "true"        , NULL,                  false, false, "Skip function prologues when setting breakpoints by name." },
     { TSC_SOURCE_MAP        , eSetVarTypeArray  , NULL          , NULL,                  false, false, "Source path remappings to use when locating source files from debug information." },
     { TSC_EXE_SEARCH_PATHS  , eSetVarTypeArray  , NULL          , NULL,                  false, false, "Executable search paths to use when locating executable files whose paths don't match the local file system." },