[Lldb-commits] [lldb] 52568a5 - [lldb] Keep the existing behavior for untrusted dSYMs (#190407)

via lldb-commits lldb-commits at lists.llvm.org
Fri Apr 3 15:11:41 PDT 2026


Author: Jonas Devlieghere
Date: 2026-04-03T22:11:35Z
New Revision: 52568a54d98b6c12b0cbc062ff24f5d7b986ffdc

URL: https://github.com/llvm/llvm-project/commit/52568a54d98b6c12b0cbc062ff24f5d7b986ffdc
DIFF: https://github.com/llvm/llvm-project/commit/52568a54d98b6c12b0cbc062ff24f5d7b986ffdc.diff

LOG: [lldb] Keep the existing behavior for untrusted dSYMs (#190407)

This patch does two thing:

- It reverts to the previous behavior of warning for untrusted dSYMs.
- It includes whether a dSYM is trusted or untrusted in the warning
output.

My reasoning is that there's no tooling for automatically signing dSYMs
and therefore we shouldn't change the behavior until this is more
common. The inclusion of whether the dSYM is signed or not is the first
step towards advertising the existence of the feature.

This now also means the release note I added in #189444 is correct
(again).

Added: 
    

Modified: 
    lldb/source/Core/ModuleList.cpp
    lldb/test/Shell/Platform/AutoLoad/Darwin/dsym-python-script-name-warnings.test

Removed: 
    


################################################################################
diff  --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp
index fae42cb90a7fb..d3c52cfe7d8f3 100644
--- a/lldb/source/Core/ModuleList.cpp
+++ b/lldb/source/Core/ModuleList.cpp
@@ -1373,26 +1373,31 @@ bool ModuleList::LoadScriptingResourceInTargetForModule(Module &module,
   if (!feedback_stream.Empty())
     debugger.ReportWarning(feedback_stream.GetString().str(), debugger.GetID());
 
+  const bool trusted = platform_sp->IsSymbolFileTrusted(module);
+
   for (const auto &[scripting_fspec, load_style] : file_specs) {
+    if (load_style == eLoadScriptFromSymFileFalse)
+      continue;
+
     if (!FileSystem::Instance().Exists(scripting_fspec))
       continue;
 
     switch (load_style) {
     case eLoadScriptFromSymFileFalse:
-      continue;
+      llvm_unreachable("case already handled");
     case eLoadScriptFromSymFileTrue:
       break;
     case eLoadScriptFromSymFileTrusted:
-      if (!platform_sp->IsSymbolFileTrusted(module))
-        continue;
-      break;
+      if (trusted)
+        break;
+      LLVM_FALLTHROUGH;
     case eLoadScriptFromSymFileWarn:
       debugger.ReportWarning(
           llvm::formatv(
               // clang-format off
-R"('{0}' contains a debug script. To run this script in this debug session:
+R"('{0}' contains {1} debug script. To run this script in this debug session:
 
-    command script import "{1}"
+    command script import "{2}"
 
 To run all discovered debug scripts in this session:
 
@@ -1400,10 +1405,11 @@ To run all discovered debug scripts in this session:
 )",
               // clang-format on
               module.GetFileSpec().GetFileNameStrippingExtension(),
+              trusted ? "a trusted" : "an untrusted",
               scripting_fspec.GetPath()),
           debugger.GetID());
 
-      return false;
+      continue;
     }
 
     LLDB_LOG(log, "Auto-loading {0}", scripting_fspec.GetPath());

diff  --git a/lldb/test/Shell/Platform/AutoLoad/Darwin/dsym-python-script-name-warnings.test b/lldb/test/Shell/Platform/AutoLoad/Darwin/dsym-python-script-name-warnings.test
index 9c84045d75932..07fa3c0d6e679 100644
--- a/lldb/test/Shell/Platform/AutoLoad/Darwin/dsym-python-script-name-warnings.test
+++ b/lldb/test/Shell/Platform/AutoLoad/Darwin/dsym-python-script-name-warnings.test
@@ -33,7 +33,7 @@
 
 ## Also confirm that the warning message about auto-loading scripts is printed afterwards.
 
-# CHECK-REMOVE: warning: 'Test-Module2' contains a debug script. To run this script in this
+# CHECK-REMOVE: warning: 'Test-Module2' contains an untrusted debug script. To run this script in this
 
 #--- main.c
 int main() { return 0; }


        


More information about the lldb-commits mailing list