[all-commits] [llvm/llvm-project] 06a094: [lldb][Windows] Report module paths the way the lo...

Charles Zablit via All-commits all-commits at lists.llvm.org
Wed Sep 30 05:33:36 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 06a09420732f5b4aecbedbee97c5d14888cf3bf0
      https://github.com/llvm/llvm-project/commit/06a09420732f5b4aecbedbee97c5d14888cf3bf0
  Author: Charles Zablit <c_zablit at apple.com>
  Date:   2026-09-30 (Wed, 30 Sep 2026)

  Changed paths:
    M lldb/source/Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.cpp
    M lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp
    M lldb/source/Plugins/Process/Windows/Common/DebuggerThread.cpp
    M lldb/source/Plugins/Process/Windows/Common/DebuggerThread.h
    M lldb/source/Plugins/Process/Windows/Common/NativeProcessWindows.cpp
    A lldb/test/API/functionalities/module_aliased_path/Makefile
    A lldb/test/API/functionalities/module_aliased_path/TestModuleAliasedPath.py
    A lldb/test/API/functionalities/module_aliased_path/foo.c
    A lldb/test/API/functionalities/module_aliased_path/main.c

  Log Message:
  -----------
  [lldb][Windows] Report module paths the way the loader spelled them (#226492)

On Windows, when creating a target, the path gets canonicalized: 
Consider a subst mapping from `C:\S` to `S:\`. A target created with
`S:\a.exe` becomes `C:\S\a.exe`.

The process reports `C:\S\a.exe`, lldb adds a second module for a file
it already has, and breakpoints get a stale unresolved location next to
the real one. This is why swift-ci's Windows tests, which run from a
`T:` subst drive, fail with `2 != 1`.

This patch matches what lldb-server does on Linux: report the paths the
loader used instead.

- DLL load events use `lpImageName`, or the loader's module list on
attach.
- The executable's path comes from
`PEB::ProcessParameters->ImagePathName`.
- `ObjectFilePECOFF::ParseDependentModules` no longer resolves dependent
DLL paths with `real_path`.
- `DynamicLoaderWindowsDYLD::DidAttach` loads the process's modules even
when it does not know the target's executable path.

When the paths differ only in case, the on-disk spelling is kept.

Tested on Windows x86_64 from a subst drive. The patch fixes 37 API
tests failures.

The patch adds a regression test `functionalities/module_aliased_path`
that fails without the fix.

Requires:
- https://github.com/llvm/llvm-project/pull/227373



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list