[all-commits] [llvm/llvm-project] 467128: [lldb][Windows] Reuse preloaded exe module on laun...

Charles Zablit via All-commits all-commits at lists.llvm.org
Fri Jul 17 08:32:52 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 4671287932028a32caa4bce6aea35f9de3f1daa8
      https://github.com/llvm/llvm-project/commit/4671287932028a32caa4bce6aea35f9de3f1daa8
  Author: Charles Zablit <c_zablit at apple.com>
  Date:   2026-07-17 (Fri, 17 Jul 2026)

  Changed paths:
    M lldb/source/Plugins/Process/Windows/Common/ProcessWindows.cpp

  Log Message:
  -----------
  [lldb][Windows] Reuse preloaded exe module on launch (#210010)

# Brief

Recreating the module everytime causes the path to be canonicalized.
This does not work well with subst drives, because the newly created
module will not have the correct drive path, causing breakpoints to be
unresolved.


# Description
`ProcessWindows::OnDebuggerConnected` derives the executable module from
`GetModuleFileNameExW` on every connect. This returns the process
image's *real* path, so when the target is created via a subst'd or
mapped drive (e.g. `S:\...\a.out`, where `S:` is subst for `C:\S`) it
comes back as `C:\S\...\a.out`. `GetOrCreateModule` then fails to match
the module LLDB had already preloaded and creates a duplicate instead.
The duplicate leaves the original module's breakpoint location orphaned
unresolved while the new module's location is resolved, so a source line
breakpoint reports two locations with only one resolved. Generic tests
that assert exactly one resolved location fail with `"2 != 1"` and
`"Expecting 1 locations, got 2"`.

# Fix
This patch fixes this by first attempting to reuse the existing module
if it exists. In practice, LLDB only looks for the executable during
attach.

This is a problem in Swiftlang where we run our tests with a subst
drive. The impacted tests are:
-
`lang/c/{array_types,function_types,set_values,enum_types,anonymous,forward,local_variables}`
- `lang/cpp/{class_types,inlines}`
- `commands/{apropos/with-process,command/nested_alias,memory/write}`
- `functionalities/{memory/find,dead-strip,memory/holes}`
- `commands/expression/entry-bp`



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