[Lldb-commits] [lldb] [lldb][PlatformDarwin] Reword warning when locating scripting resources from dSYM (PR #185666)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Fri Mar 13 01:46:36 PDT 2026


https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/185666

>From 20292ed0dbb83ed7a444c0d39dd4046248e4aaab Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Tue, 10 Mar 2026 12:58:25 +0000
Subject: [PATCH 1/6] [lldb][PlatformDarwin] Reword warning when locating
 scripting resources from dSYM

This patch makes the warning message more concise (in my opinion). We would duplicate the file path multiple times in the message. I'm planning on factoring this logic into a standalone function, and having it rely on fewer parameters helps with that.

Before:
```
warning: the symbol file '/var/folders/r8/d92r4cgj32qfg84671c1974h0000gn/T/lit-tmp-o6d4yrjx/locate-scripts-from-dsym-test-77d136/.dSYM/Contents/Resources/DWARF/import' contains a debug script. However, its name '/var/folders/r8/d92r4cgj32qfg84671c1974h0000gn/T/lit-tmp-o6d4yrjx/locate-scripts-from-dsym-test-77d136/.dSYM/Contents/Resources/DWARF/../Python/import.py' conflicts with a keyword and as such cannot be loaded. LLDB will load '/var/folders/r8/d92r4cgj32qfg84671c1974h0000gn/T/lit-tmp-o6d4yrjx/locate-scripts-from-dsym-test-77d136/.dSYM/Contents/Resources/DWARF/../Python/_import.py' instead. Consider removing the file with the malformed name to eliminate this warning.
```

After:
```
warning: found a debug script '/var/folders/r8/d92r4cgj32qfg84671c1974h0000gn/T/lit-tmp-c2ftoatb/locate-scripts-from-dsym-test-01f130/.dSYM/Contents/Resources/DWARF/../Python/import.py'. However, its name conflicts with a keyword and as such cannot be loaded. LLDB will load '/var/folders/r8/d92r4cgj32qfg84671c1974h0000gn/T/lit-tmp-c2ftoatb/locate-scripts-from-dsym-test-01f130/.dSYM/Contents/Resources/DWARF/../Python/_import.py' instead. Consider removing the file with the malformed name to eliminate this warning.
```

Before:
```
warning: the symbol file '/var/folders/r8/d92r4cgj32qfg84671c1974h0000gn/T/lit-tmp-o6d4yrjx/locate-scripts-from-dsym-test-01765f/.dSYM/Contents/Resources/DWARF/import' contains a debug script. However, its name conflicts with a keyword and as such cannot be loaded. If you intend to have this script loaded, please rename '/var/folders/r8/d92r4cgj32qfg84671c1974h0000gn/T/lit-tmp-o6d4yrjx/locate-scripts-from-dsym-test-01765f/.dSYM/Contents/Resources/DWARF/../Python/import.py' to '/var/folders/r8/d92r4cgj32qfg84671c1974h0000gn/T/lit-tmp-o6d4yrjx/locate-scripts-from-dsym-test-01765f/.dSYM/Contents/Resources/DWARF/../Python/_import.py' and retry."
```

After:
```
warning: found a debug script '/var/folders/r8/d92r4cgj32qfg84671c1974h0000gn/T/lit-tmp-c2ftoatb/locate-scripts-from-dsym-test-0766c6/.dSYM/Contents/Resources/DWARF/../Python/import.py'. However, its name conflicts with a keyword and as such cannot be loaded. If you intend to have this script loaded, please rename it to '/var/folders/r8/d92r4cgj32qfg84671c1974h0000gn/T/lit-tmp-c2ftoatb/locate-scripts-from-dsym-test-0766c6/.dSYM/Contents/Resources/DWARF/../Python/_import.py' and retry.
```
---
 .../Platform/MacOSX/PlatformDarwin.cpp        | 25 ++++++++---------
 .../unittests/Platform/PlatformDarwinTest.cpp | 28 +++++++++----------
 2 files changed, 25 insertions(+), 28 deletions(-)

diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index 436dc5aa0f684..01b527e5ad8a9 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -286,23 +286,20 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResourcesFromDSYM(
                                              : "contains reserved characters";
       if (FileSystem::Instance().Exists(script_fspec))
         feedback_stream.Format(
-            "warning: the symbol file '{0}' contains a debug "
-            "script. However, its name"
-            " '{1}' {2} and as such cannot be loaded. LLDB will"
-            " load '{3}' instead. Consider removing the file with "
-            "the malformed name to"
-            " eliminate this warning.\n",
-            symfile_spec.GetPath(), original_path_string.GetString(),
-            reason_for_complaint, path_string.GetString());
+            "warning: found a debug script '{0}'. However, its name"
+            " {1} and as such cannot be loaded. LLDB will"
+            " load '{2}' instead. Consider removing the file with"
+            " the malformed name to eliminate this warning.\n",
+            original_path_string.GetString(), reason_for_complaint,
+            path_string.GetString());
       else
         feedback_stream.Format(
-            "warning: the symbol file '{0}' contains a debug "
-            "script. However, its name"
+            "warning: found a debug script '{0}'. However, its name"
             " {1} and as such cannot be loaded. If you intend"
-            " to have this script loaded, please rename '{2}' to "
-            "'{3}' and retry.\n",
-            symfile_spec.GetPath(), reason_for_complaint,
-            original_path_string.GetString(), path_string.GetString());
+            " to have this script loaded, please rename it to "
+            "'{2}' and retry.\n",
+            original_path_string.GetString(), reason_for_complaint,
+            path_string.GetString());
     }
 
     if (FileSystem::Instance().Exists(script_fspec)) {
diff --git a/lldb/unittests/Platform/PlatformDarwinTest.cpp b/lldb/unittests/Platform/PlatformDarwinTest.cpp
index f5fd6660069ea..7e17cb66cbd8d 100644
--- a/lldb/unittests/Platform/PlatformDarwinTest.cpp
+++ b/lldb/unittests/Platform/PlatformDarwinTest.cpp
@@ -354,11 +354,11 @@ TEST_F(PlatformDarwinLocateTest,
   std::string fixed_script =
       (m_tmp_dsym_dwarf_dir + "/../Python/_import.py").str();
   std::string expected = llvm::formatv(
-      "warning: the symbol file '{0}' contains a debug script. However, its "
+      "warning: found a debug script '{0}'. However, its "
       "name conflicts with a keyword and as such cannot be loaded. If you "
-      "intend to have this script loaded, please rename '{1}' to '{2}' and "
+      "intend to have this script loaded, please rename it to '{1}' and "
       "retry.\n",
-      dsym_module_fpec.GetPath(), orig_script, fixed_script);
+      orig_script, fixed_script);
   EXPECT_EQ(ss.GetString(), expected);
 }
 
@@ -394,11 +394,11 @@ TEST_F(PlatformDarwinLocateTest,
   std::string fixed_script =
       (m_tmp_dsym_dwarf_dir + "/../Python/_import.py").str();
   std::string expected = llvm::formatv(
-      "warning: the symbol file '{0}' contains a debug script. However, its "
-      "name '{1}' conflicts with a keyword and as such cannot be loaded. LLDB "
-      "will load '{2}' instead. Consider removing the file with the malformed "
+      "warning: found a debug script '{0}'. However, its "
+      "name conflicts with a keyword and as such cannot be loaded. LLDB "
+      "will load '{1}' instead. Consider removing the file with the malformed "
       "name to eliminate this warning.\n",
-      dsym_module_fpec.GetPath(), orig_script, fixed_script);
+      orig_script, fixed_script);
   EXPECT_EQ(ss.GetString(), expected);
 }
 
@@ -461,11 +461,11 @@ TEST_F(
   std::string fixed_script =
       (m_tmp_dsym_dwarf_dir + "/../Python/TestModule_1_1_1.py").str();
   std::string expected = llvm::formatv(
-      "warning: the symbol file '{0}' contains a debug script. However, its "
+      "warning: found a debug script '{0}'. However, its "
       "name contains reserved characters and as such cannot be loaded. If you "
-      "intend to have this script loaded, please rename '{1}' to '{2}' and "
+      "intend to have this script loaded, please rename it to '{1}' and "
       "retry.\n",
-      dsym_module_fpec.GetPath(), orig_script, fixed_script);
+      orig_script, fixed_script);
   EXPECT_EQ(ss.GetString(), expected);
 }
 
@@ -502,11 +502,11 @@ TEST_F(
   std::string fixed_script =
       (m_tmp_dsym_dwarf_dir + "/../Python/TestModule_1_1_1.py").str();
   std::string expected = llvm::formatv(
-      "warning: the symbol file '{0}' contains a debug script. However, its "
-      "name '{1}' contains reserved characters and as such cannot be loaded. "
-      "LLDB will load '{2}' instead. Consider removing the file with the "
+      "warning: found a debug script '{0}'. However, its "
+      "name contains reserved characters and as such cannot be loaded. "
+      "LLDB will load '{1}' instead. Consider removing the file with the "
       "malformed name to eliminate this warning.\n",
-      dsym_module_fpec.GetPath(), orig_script, fixed_script);
+      orig_script, fixed_script);
   EXPECT_EQ(ss.GetString(), expected);
 }
 

>From c62c7bb0164e54144ac626ef3449b832edba5e40 Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Wed, 11 Mar 2026 09:13:26 +0000
Subject: [PATCH 2/6] fixup! use filename without path in warning

---
 .../Platform/MacOSX/PlatformDarwin.cpp        | 22 ++++-----
 .../unittests/Platform/PlatformDarwinTest.cpp | 48 +++++++------------
 2 files changed, 28 insertions(+), 42 deletions(-)

diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index 01b527e5ad8a9..3015acfd5783a 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -286,20 +286,18 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResourcesFromDSYM(
                                              : "contains reserved characters";
       if (FileSystem::Instance().Exists(script_fspec))
         feedback_stream.Format(
-            "warning: found a debug script '{0}'. However, its name"
-            " {1} and as such cannot be loaded. LLDB will"
-            " load '{2}' instead. Consider removing the file with"
-            " the malformed name to eliminate this warning.\n",
-            original_path_string.GetString(), reason_for_complaint,
-            path_string.GetString());
+            "warning: debug script '{0}' cannot be loaded because '{1}' {2}. "
+            "Loading '{3}' instead. Consider removing the file with the "
+            "malformed name to eliminate this warning.\n",
+            original_path_string.GetString(), orig_script_fspec.GetFilename(),
+            reason_for_complaint, script_fspec.GetFilename());
       else
         feedback_stream.Format(
-            "warning: found a debug script '{0}'. However, its name"
-            " {1} and as such cannot be loaded. If you intend"
-            " to have this script loaded, please rename it to "
-            "'{2}' and retry.\n",
-            original_path_string.GetString(), reason_for_complaint,
-            path_string.GetString());
+            "warning: debug script '{0}' cannot be loaded because '{1}' {2}. "
+            "If you intend to have this script loaded, please rename it to "
+            "'{3}' and retry.\n",
+            original_path_string.GetString(), orig_script_fspec.GetFilename(),
+            reason_for_complaint, script_fspec.GetFilename());
     }
 
     if (FileSystem::Instance().Exists(script_fspec)) {
diff --git a/lldb/unittests/Platform/PlatformDarwinTest.cpp b/lldb/unittests/Platform/PlatformDarwinTest.cpp
index 7e17cb66cbd8d..641f6478f78c0 100644
--- a/lldb/unittests/Platform/PlatformDarwinTest.cpp
+++ b/lldb/unittests/Platform/PlatformDarwinTest.cpp
@@ -351,14 +351,11 @@ TEST_F(PlatformDarwinLocateTest,
 
   std::string orig_script =
       (m_tmp_dsym_dwarf_dir + "/../Python/import.py").str();
-  std::string fixed_script =
-      (m_tmp_dsym_dwarf_dir + "/../Python/_import.py").str();
   std::string expected = llvm::formatv(
-      "warning: found a debug script '{0}'. However, its "
-      "name conflicts with a keyword and as such cannot be loaded. If you "
-      "intend to have this script loaded, please rename it to '{1}' and "
-      "retry.\n",
-      orig_script, fixed_script);
+      "warning: debug script '{0}' cannot be loaded because 'import.py' "
+      "conflicts with a keyword. If you intend to have this script loaded, "
+      "please rename it to '_import.py' and retry.\n",
+      orig_script);
   EXPECT_EQ(ss.GetString(), expected);
 }
 
@@ -391,14 +388,11 @@ TEST_F(PlatformDarwinLocateTest,
 
   std::string orig_script =
       (m_tmp_dsym_dwarf_dir + "/../Python/import.py").str();
-  std::string fixed_script =
-      (m_tmp_dsym_dwarf_dir + "/../Python/_import.py").str();
   std::string expected = llvm::formatv(
-      "warning: found a debug script '{0}'. However, its "
-      "name conflicts with a keyword and as such cannot be loaded. LLDB "
-      "will load '{1}' instead. Consider removing the file with the malformed "
-      "name to eliminate this warning.\n",
-      orig_script, fixed_script);
+      "warning: debug script '{0}' cannot be loaded because 'import.py' "
+      "conflicts with a keyword. Loading '_import.py' instead. Consider "
+      "removing the file with the malformed name to eliminate this warning.\n",
+      orig_script);
   EXPECT_EQ(ss.GetString(), expected);
 }
 
@@ -458,14 +452,11 @@ TEST_F(
 
   std::string orig_script =
       (m_tmp_dsym_dwarf_dir + "/../Python/TestModule-1.1 1.py").str();
-  std::string fixed_script =
-      (m_tmp_dsym_dwarf_dir + "/../Python/TestModule_1_1_1.py").str();
   std::string expected = llvm::formatv(
-      "warning: found a debug script '{0}'. However, its "
-      "name contains reserved characters and as such cannot be loaded. If you "
-      "intend to have this script loaded, please rename it to '{1}' and "
-      "retry.\n",
-      orig_script, fixed_script);
+      "warning: debug script '{0}' cannot be loaded because 'TestModule-1.1 "
+      "1.py' contains reserved characters. If you intend to have this script "
+      "loaded, please rename it to 'TestModule_1_1_1.py' and retry.\n",
+      orig_script);
   EXPECT_EQ(ss.GetString(), expected);
 }
 
@@ -499,14 +490,12 @@ TEST_F(
 
   std::string orig_script =
       (m_tmp_dsym_dwarf_dir + "/../Python/TestModule-1.1 1.py").str();
-  std::string fixed_script =
-      (m_tmp_dsym_dwarf_dir + "/../Python/TestModule_1_1_1.py").str();
   std::string expected = llvm::formatv(
-      "warning: found a debug script '{0}'. However, its "
-      "name contains reserved characters and as such cannot be loaded. "
-      "LLDB will load '{1}' instead. Consider removing the file with the "
-      "malformed name to eliminate this warning.\n",
-      orig_script, fixed_script);
+      "warning: debug script '{0}' cannot be loaded because 'TestModule-1.1 "
+      "1.py' contains reserved characters. Loading 'TestModule_1_1_1.py' "
+      "instead. Consider removing the file with the malformed name to "
+      "eliminate this warning.\n",
+      orig_script);
   EXPECT_EQ(ss.GetString(), expected);
 }
 
@@ -564,8 +553,7 @@ TEST_F(
           ->LocateExecutableScriptingResourcesFromDSYM(
               ss, module_fspec, *m_target_sp, dsym_module_fpec);
   EXPECT_EQ(fspecs.GetSize(), 0u);
-  EXPECT_TRUE(ss.GetString().contains(
-      "its name conflicts with a keyword and as such cannot be loaded"));
+  EXPECT_TRUE(ss.GetString().contains("conflicts with a keyword"));
 }
 
 TEST_F(

>From eb30539a7c7e0799d0e3e897cb0112e4d6f751de Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Wed, 11 Mar 2026 09:22:24 +0000
Subject: [PATCH 3/6] fixup! print conflicting keyword in error message

---
 .../Platform/MacOSX/PlatformDarwin.cpp        | 26 ++++++++++++-------
 .../unittests/Platform/PlatformDarwinTest.cpp |  9 ++++---
 2 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index 3015acfd5783a..ef697982e5162 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -105,14 +105,14 @@ class SanitizedScriptingModuleName {
 
     if (script_interpreter &&
         script_interpreter->IsReservedWord(m_sanitized_name.c_str())) {
+      m_conflicting_keyword = m_sanitized_name;
       m_sanitized_name.insert(m_sanitized_name.begin(), '_');
-      m_name_is_keyword = true;
     }
   }
 
   /// Returns \c true if this name is a keyword in the associated scripting
   /// language.
-  bool IsKeyword() const { return m_name_is_keyword; }
+  bool IsKeyword() const { return !m_conflicting_keyword.empty(); }
 
   /// Returns \c true if the original name has been sanitized (i.e., required
   /// changes).
@@ -122,14 +122,16 @@ class SanitizedScriptingModuleName {
 
   llvm::StringRef GetSanitizedName() const { return m_sanitized_name; }
   llvm::StringRef GetOriginalName() const { return m_original_name; }
+  llvm::StringRef GetConflictingKeyword() const { return m_conflicting_keyword; }
 
 private:
   llvm::StringRef m_original_name;
   std::string m_sanitized_name;
 
-  /// \c true if m_sanitized_name is a keyword for the ScriptInterpreter
-  /// language associated with this SanitizedScriptingModuleName.
-  bool m_name_is_keyword = false;
+  /// If the m_sanitized_name conflicts with a keyword for the ScriptInterpreter
+  /// language associated with this SanitizedScriptingModuleName, is set to the
+  /// conflicting keyword. Empty otherwise.
+  std::string m_conflicting_keyword;
 };
 } // namespace
 
@@ -281,23 +283,27 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResourcesFromDSYM(
     // that the file as-is shall not be loaded
     if (sanitized_name.RequiredSanitization() &&
         FileSystem::Instance().Exists(orig_script_fspec)) {
-      const char *reason_for_complaint = sanitized_name.IsKeyword()
-                                             ? "conflicts with a keyword"
-                                             : "contains reserved characters";
+      std::string reason_for_complaint =
+          sanitized_name.IsKeyword()
+              ? llvm::formatv("conflicts with the keyword '{0}'",
+                              sanitized_name.GetConflictingKeyword())
+                    .str()
+              : "contains reserved characters";
+
       if (FileSystem::Instance().Exists(script_fspec))
         feedback_stream.Format(
             "warning: debug script '{0}' cannot be loaded because '{1}' {2}. "
             "Loading '{3}' instead. Consider removing the file with the "
             "malformed name to eliminate this warning.\n",
             original_path_string.GetString(), orig_script_fspec.GetFilename(),
-            reason_for_complaint, script_fspec.GetFilename());
+            std::move(reason_for_complaint), script_fspec.GetFilename());
       else
         feedback_stream.Format(
             "warning: debug script '{0}' cannot be loaded because '{1}' {2}. "
             "If you intend to have this script loaded, please rename it to "
             "'{3}' and retry.\n",
             original_path_string.GetString(), orig_script_fspec.GetFilename(),
-            reason_for_complaint, script_fspec.GetFilename());
+            std::move(reason_for_complaint), script_fspec.GetFilename());
     }
 
     if (FileSystem::Instance().Exists(script_fspec)) {
diff --git a/lldb/unittests/Platform/PlatformDarwinTest.cpp b/lldb/unittests/Platform/PlatformDarwinTest.cpp
index 641f6478f78c0..1b9f70bd46eea 100644
--- a/lldb/unittests/Platform/PlatformDarwinTest.cpp
+++ b/lldb/unittests/Platform/PlatformDarwinTest.cpp
@@ -353,7 +353,8 @@ TEST_F(PlatformDarwinLocateTest,
       (m_tmp_dsym_dwarf_dir + "/../Python/import.py").str();
   std::string expected = llvm::formatv(
       "warning: debug script '{0}' cannot be loaded because 'import.py' "
-      "conflicts with a keyword. If you intend to have this script loaded, "
+      "conflicts with the keyword 'import'. If you intend to have this script "
+      "loaded, "
       "please rename it to '_import.py' and retry.\n",
       orig_script);
   EXPECT_EQ(ss.GetString(), expected);
@@ -390,7 +391,8 @@ TEST_F(PlatformDarwinLocateTest,
       (m_tmp_dsym_dwarf_dir + "/../Python/import.py").str();
   std::string expected = llvm::formatv(
       "warning: debug script '{0}' cannot be loaded because 'import.py' "
-      "conflicts with a keyword. Loading '_import.py' instead. Consider "
+      "conflicts with the keyword 'import'. Loading '_import.py' instead. "
+      "Consider "
       "removing the file with the malformed name to eliminate this warning.\n",
       orig_script);
   EXPECT_EQ(ss.GetString(), expected);
@@ -553,7 +555,8 @@ TEST_F(
           ->LocateExecutableScriptingResourcesFromDSYM(
               ss, module_fspec, *m_target_sp, dsym_module_fpec);
   EXPECT_EQ(fspecs.GetSize(), 0u);
-  EXPECT_TRUE(ss.GetString().contains("conflicts with a keyword"));
+  EXPECT_TRUE(
+      ss.GetString().contains("conflicts with the keyword 'mykeyword_1_1_1'"));
 }
 
 TEST_F(

>From e22641cc919146b0fd03920a0ed1930309f44e0f Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Wed, 11 Mar 2026 09:29:45 +0000
Subject: [PATCH 4/6] fixup! formatting

---
 lldb/unittests/Platform/PlatformDarwinTest.cpp | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lldb/unittests/Platform/PlatformDarwinTest.cpp b/lldb/unittests/Platform/PlatformDarwinTest.cpp
index 1b9f70bd46eea..0abb7a56cdaef 100644
--- a/lldb/unittests/Platform/PlatformDarwinTest.cpp
+++ b/lldb/unittests/Platform/PlatformDarwinTest.cpp
@@ -354,8 +354,7 @@ TEST_F(PlatformDarwinLocateTest,
   std::string expected = llvm::formatv(
       "warning: debug script '{0}' cannot be loaded because 'import.py' "
       "conflicts with the keyword 'import'. If you intend to have this script "
-      "loaded, "
-      "please rename it to '_import.py' and retry.\n",
+      "loaded, please rename it to '_import.py' and retry.\n",
       orig_script);
   EXPECT_EQ(ss.GetString(), expected);
 }
@@ -392,8 +391,8 @@ TEST_F(PlatformDarwinLocateTest,
   std::string expected = llvm::formatv(
       "warning: debug script '{0}' cannot be loaded because 'import.py' "
       "conflicts with the keyword 'import'. Loading '_import.py' instead. "
-      "Consider "
-      "removing the file with the malformed name to eliminate this warning.\n",
+      "Consider removing the file with the malformed name to eliminate this "
+      "warning.\n",
       orig_script);
   EXPECT_EQ(ss.GetString(), expected);
 }

>From 5c25049aca78f1eb4b79ccaad9336d5e0b0fe9ec Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Wed, 11 Mar 2026 09:51:16 +0000
Subject: [PATCH 5/6] fixup! clang-format

---
 lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index ef697982e5162..a1de158610c41 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -122,7 +122,9 @@ class SanitizedScriptingModuleName {
 
   llvm::StringRef GetSanitizedName() const { return m_sanitized_name; }
   llvm::StringRef GetOriginalName() const { return m_original_name; }
-  llvm::StringRef GetConflictingKeyword() const { return m_conflicting_keyword; }
+  llvm::StringRef GetConflictingKeyword() const {
+    return m_conflicting_keyword;
+  }
 
 private:
   llvm::StringRef m_original_name;

>From eed7cc9660776fb9033a9d19bed3f1a484970e68 Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Fri, 13 Mar 2026 08:46:20 +0000
Subject: [PATCH 6/6] fixup! don't tell users to remove file

---
 .../Plugins/Platform/MacOSX/PlatformDarwin.cpp  |  3 +--
 lldb/unittests/Platform/PlatformDarwinTest.cpp  | 17 +++++++----------
 2 files changed, 8 insertions(+), 12 deletions(-)

diff --git a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
index a1de158610c41..ae6705212c380 100644
--- a/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
+++ b/lldb/source/Plugins/Platform/MacOSX/PlatformDarwin.cpp
@@ -295,8 +295,7 @@ FileSpecList PlatformDarwin::LocateExecutableScriptingResourcesFromDSYM(
       if (FileSystem::Instance().Exists(script_fspec))
         feedback_stream.Format(
             "warning: debug script '{0}' cannot be loaded because '{1}' {2}. "
-            "Loading '{3}' instead. Consider removing the file with the "
-            "malformed name to eliminate this warning.\n",
+            "Ignoring '{1}' and loading '{3}' instead.\n",
             original_path_string.GetString(), orig_script_fspec.GetFilename(),
             std::move(reason_for_complaint), script_fspec.GetFilename());
       else
diff --git a/lldb/unittests/Platform/PlatformDarwinTest.cpp b/lldb/unittests/Platform/PlatformDarwinTest.cpp
index 0abb7a56cdaef..bf9dd561775a7 100644
--- a/lldb/unittests/Platform/PlatformDarwinTest.cpp
+++ b/lldb/unittests/Platform/PlatformDarwinTest.cpp
@@ -390,9 +390,8 @@ TEST_F(PlatformDarwinLocateTest,
       (m_tmp_dsym_dwarf_dir + "/../Python/import.py").str();
   std::string expected = llvm::formatv(
       "warning: debug script '{0}' cannot be loaded because 'import.py' "
-      "conflicts with the keyword 'import'. Loading '_import.py' instead. "
-      "Consider removing the file with the malformed name to eliminate this "
-      "warning.\n",
+      "conflicts with the keyword 'import'. Ignoring 'import.py' and loading "
+      "'_import.py' instead.\n",
       orig_script);
   EXPECT_EQ(ss.GetString(), expected);
 }
@@ -492,10 +491,9 @@ TEST_F(
   std::string orig_script =
       (m_tmp_dsym_dwarf_dir + "/../Python/TestModule-1.1 1.py").str();
   std::string expected = llvm::formatv(
-      "warning: debug script '{0}' cannot be loaded because 'TestModule-1.1 "
-      "1.py' contains reserved characters. Loading 'TestModule_1_1_1.py' "
-      "instead. Consider removing the file with the malformed name to "
-      "eliminate this warning.\n",
+      "warning: debug script '{0}' cannot be loaded because"
+      " 'TestModule-1.1 1.py' contains reserved characters. Ignoring"
+      " 'TestModule-1.1 1.py' and loading 'TestModule_1_1_1.py' instead.\n",
       orig_script);
   EXPECT_EQ(ss.GetString(), expected);
 }
@@ -586,9 +584,8 @@ TEST_F(
               ss, module_fspec, *m_target_sp, dsym_module_fpec);
   EXPECT_EQ(fspecs.GetSize(), 1u);
   EXPECT_EQ(fspecs.GetFileSpecAtIndex(0).GetFilename(), "_mykeyword_1_1_1.py");
-  EXPECT_TRUE(
-      ss.GetString().contains("Consider removing the file with the malformed "
-                              "name to eliminate this warning."));
+  EXPECT_TRUE(ss.GetString().contains("Ignoring 'mykeyword-1.1 1.py' and "
+                                      "loading '_mykeyword_1_1_1.py' instead"));
 }
 
 TEST_F(



More information about the lldb-commits mailing list