[Lldb-commits] [lldb] d400080 - [lldb] Inherit Host::GetEnvironment() when launching a wasm runtime (#190476)
via lldb-commits
lldb-commits at lists.llvm.org
Sat Apr 4 14:18:14 PDT 2026
Author: Maarten Steevens
Date: 2026-04-04T21:18:09Z
New Revision: d400080063de2923bf1ae95c95c5b17975e5c66a
URL: https://github.com/llvm/llvm-project/commit/d400080063de2923bf1ae95c95c5b17975e5c66a
DIFF: https://github.com/llvm/llvm-project/commit/d400080063de2923bf1ae95c95c5b17975e5c66a.diff
LOG: [lldb] Inherit Host::GetEnvironment() when launching a wasm runtime (#190476)
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). This PR aims to resolve this
issue, I have tested this with the WARDuino runtime and my WIP gdbstub.
Added:
Modified:
lldb/source/Plugins/Platform/WebAssembly/PlatformWasm.cpp
Removed:
################################################################################
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(
More information about the lldb-commits
mailing list