[Lldb-commits] [lldb] [lldb][Windows] Report module paths the way the loader spelled them (PR #226492)

via lldb-commits lldb-commits at lists.llvm.org
Tue Sep 29 06:07:31 PDT 2026


================
@@ -747,7 +797,25 @@ DebuggerThread::HandleLoadDllEvent(const LOAD_DLL_DEBUG_INFO &info,
     action = m_debug_delegate->OnLoadDll(module_spec, load_addr, thread_id);
   };
 
-  std::optional<std::string> resolved_path;
+  HANDLE process = m_process.GetNativeProcess().GetSystemHandle();
+
+  // Prefer the path the loader used for the DLL, which keeps the subst drive,
+  // junction or symbolic link it was reached through.
+  std::optional<std::string> loader_path =
+      GetFileNameFromImageNameField(process, info);
+  if (loader_path && !llvm::sys::path::is_absolute(
+                         *loader_path, llvm::sys::path::Style::windows))
+    loader_path.reset();
+  if (!loader_path)
+    loader_path = GetLoaderModuleName(process, info.lpBaseOfDll);
+  if (loader_path) {
+    llvm::StringRef path_ref = *loader_path;
+    path_ref.consume_front("\\\\?\\");
----------------
Nerixyz wrote:

Are these paths DOS drive paths? If so, `\\?\UNC` needs to be handled as well. Maybe we should have some utility function for that.

https://github.com/llvm/llvm-project/pull/226492


More information about the lldb-commits mailing list