[all-commits] [llvm/llvm-project] 9edbf8: [lldb][windows] fix environment handling in Create...
Charles Zablit via All-commits
all-commits at lists.llvm.org
Mon Dec 1 10:46:38 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 9edbf83667821e3154446d5e2429e41bf261e26f
https://github.com/llvm/llvm-project/commit/9edbf83667821e3154446d5e2429e41bf261e26f
Author: Charles Zablit <c_zablit at apple.com>
Date: 2025-12-01 (Mon, 01 Dec 2025)
Changed paths:
M lldb/source/Host/windows/ProcessLauncherWindows.cpp
Log Message:
-----------
[lldb][windows] fix environment handling in CreateProcessW setup (#168733)
This patch refactors and documents the setup of the `CreateProcessW`
invocation in `ProcessLauncherWindows`. It's a dependency of
https://github.com/llvm/llvm-project/pull/168729.
`CreateEnvironmentBufferW` now sorts the environment variable keys
before concatenating them into a string. From [the `CreateProcess`
documentation](https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw):
> An application must manually pass the current directory information to
the new process. To do so, the application must explicitly create these
environment variable strings, sort them alphabetically (because the
system uses a sorted environment), and put them into the environment
block. Typically, they will go at the front of the environment block,
due to the environment block sort order.
`GetFlattenedWindowsCommandStringW` now returns an error which will be
surfaced, instead of failing silently.
Types were converted to their wide equivalent (i.e appending `W` to
them, see `STARTUPINFOEX`) since we are calling the `W` variant of
`CreateProcess`.
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