<rdar://problem/13183720>

Provide a mechanism through which users can disable loading the Python scripts from dSYM files
This relies on a target setting: target.load-script-from-symbol-file which defaults to false ("do NOT load the script")
You need to set it to true before creating your target (or in your lldbinit file if you constantly rely on this feature) to allow the scripts to load



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@181709 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Target/Target.cpp b/source/Target/Target.cpp
index c54cc15..f1a09a7 100644
--- a/source/Target/Target.cpp
+++ b/source/Target/Target.cpp
@@ -2301,6 +2301,7 @@
     // FIXME: This is the wrong way to do per-architecture settings, but we don't have a general per architecture settings system in place yet.
     { "x86-disassembly-flavor"             , OptionValue::eTypeEnum      , false, eX86DisFlavorDefault,       NULL, g_x86_dis_flavor_value_types, "The default disassembly flavor to use for x86 or x86-64 targets." },
     { "use-fast-stepping"                  , OptionValue::eTypeBoolean   , false, true,                       NULL, NULL, "Use a fast stepping algorithm based on running from branch to branch rather than instruction single-stepping." },
+    { "load-script-from-symbol-file"       , OptionValue::eTypeBoolean   , false, false,                      NULL, NULL, "Allow LLDB to load scripting resources embedded in symbol files when available." },
     { NULL                                 , OptionValue::eTypeInvalid   , false, 0                         , NULL, NULL, NULL }
 };
 enum
@@ -2326,7 +2327,8 @@
     ePropertyDisableSTDIO,
     ePropertyInlineStrategy,
     ePropertyDisassemblyFlavor,
-    ePropertyUseFastStepping
+    ePropertyUseFastStepping,
+    ePropertyLoadScriptFromSymbolFile
 };
 
 
@@ -2672,6 +2674,20 @@
     return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
 }
 
+bool
+TargetProperties::GetLoadScriptFromSymbolFile () const
+{
+    const uint32_t idx = ePropertyLoadScriptFromSymbolFile;
+    return m_collection_sp->GetPropertyAtIndexAsBoolean (NULL, idx, g_properties[idx].default_uint_value != 0);
+}
+
+void
+TargetProperties::SetLoadScriptFromSymbolFile (bool b)
+{
+    const uint32_t idx = ePropertyLoadScriptFromSymbolFile;
+    m_collection_sp->SetPropertyAtIndexAsBoolean(NULL, idx, b);
+}
+
 const TargetPropertiesSP &
 Target::GetGlobalProperties()
 {