<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
llvm-svn: 181709
diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index b5874da..de39a98 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1243,6 +1243,8 @@
return false;
}
+ bool shoud_load = target->TargetProperties::GetLoadScriptFromSymbolFile();
+
Debugger &debugger = target->GetDebugger();
const ScriptLanguage script_language = debugger.GetScriptLanguage();
if (script_language != eScriptLanguageNone)
@@ -1271,7 +1273,11 @@
FileSpec scripting_fspec (file_specs.GetFileSpecAtIndex(i));
if (scripting_fspec && scripting_fspec.Exists())
{
-
+ if (!shoud_load)
+ {
+ error.SetErrorString("Target doesn't allow loading scripting resource. Please set target.load-script-from-symbol-file and retry.");
+ return false;
+ }
StreamString scripting_stream;
scripting_fspec.Dump(&scripting_stream);
const bool can_reload = false;