[Lldb-commits] [lldb] [lldb] Inherit Host::GetEnvironment() when launching a wasm runtime (PR #190476)
via lldb-commits
lldb-commits at lists.llvm.org
Sat Apr 4 11:11:39 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Maarten Steevens (MaartenS11)
<details>
<summary>Changes</summary>
Some WebAssembly runtimes might use environment variables such as `HOME` or `XDG_CONFIG_HOME` to store configuration files, additionally some VMs might allow wasm modules to read environment variables from the host. Currently, if a runtime is launched using the WebAssembly platform it doesn't inherit the environment. As a result wasm runtimes and modules are unable to read from environment variables and might even fail to launch (if the config file is required).
---
Full diff: https://github.com/llvm/llvm-project/pull/190476.diff
1 Files Affected:
- (modified) lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp (+1)
``````````diff
diff --git a/lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp b/lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
index fb52e48850cb9..a7c60aec98670 100644
--- a/lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
+++ b/lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
@@ -176,6 +176,7 @@ lldb::ProcessSP PlatformWasm::DebugProcess(ProcessLaunchInfo &launch_info,
launch_info.SetArguments(args, true);
launch_info.SetLaunchInSeparateProcessGroup(true);
launch_info.GetFlags().Clear(eLaunchFlagDebug);
+ launch_info.GetEnvironment() = Host::GetEnvironment();
auto exit_code = std::make_shared<std::optional<int>>();
launch_info.SetMonitorProcessCallback(
``````````
</details>
https://github.com/llvm/llvm-project/pull/190476
More information about the lldb-commits
mailing list