From b1c76a4d761983b170524f21c9e6b512ad5dd06c Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Wed, 25 Sep 2024 11:50:27 -0700 Subject: [PATCH] ExpressionParser: inherit the environment for the REPL This is particularly important on Windows where `Path` needs to be propagated to the inferior to allow `LoadLibraryW(L"swiftCore.dll")` to succeed. The library is looked up via the `Path` environment variable and the default target environment is empty. As a result, the library is not found and the inferior exits terminating the REPL instance. --- lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp b/lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp index e3edf843033d1..e29aa1e9640e2 100644 --- a/lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp +++ b/lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp @@ -201,7 +201,7 @@ lldb::REPLSP SwiftREPL::CreateInstanceFromDebugger(Status &err, launch_info.SetExecutableFile(exe_module_sp->GetPlatformFileSpec(), true); } - launch_info.GetEnvironment() = target_sp->GetTargetEnvironment(); + launch_info.GetEnvironment() = target_sp->GetInheritedEnvironment(); debugger.SetAsyncExecution(false); err = target_sp->Launch(launch_info, nullptr); debugger.SetAsyncExecution(true);