[Lldb-commits] [lldb] [lldb][Module] Add logging when script import fails (PR #189695)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 31 08:45:15 PDT 2026


https://github.com/Michael137 created https://github.com/llvm/llvm-project/pull/189695

We already log the import attempt. This patch logs the failure to load the script since otherwise the log may be misleading. Didn't think it was worth adding a test-case for this.

>From e32e343d441dddcf2c7fe2b3cbec4f1505099c58 Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Tue, 31 Mar 2026 14:07:14 +0200
Subject: [PATCH] [lldb][Module] Add logging when script import fails

We already log the import attempt. This patch logs the failure to load the script since otherwise the log may be misleading. Didn't think it was worth adding a test-case for this.
---
 lldb/source/Core/Module.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Core/Module.cpp b/lldb/source/Core/Module.cpp
index 3d33a5011fb5e..802964bfad160 100644
--- a/lldb/source/Core/Module.cpp
+++ b/lldb/source/Core/Module.cpp
@@ -1503,8 +1503,12 @@ To run all discovered debug scripts in this session:
              scripting_fspec.GetPath());
 
     if (!LoadScriptingModule(scripting_fspec, *script_interpreter, *target,
-                             error))
+                             error)) {
+      LLDB_LOG(GetLog(LLDBLog::Modules),
+               "Failed to load '{0}'. Remaining scripts won't be loaded.",
+               scripting_fspec.GetPath());
       return false;
+    }
   }
 
   return true;



More information about the lldb-commits mailing list