Skip to content

[lldb] Load system's libswiftCore and honor explicit settings on REPL #3313

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lldb/source/Plugins/ExpressionParser/Swift/SwiftREPL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ lldb::REPLSP SwiftREPL::CreateInstanceFromDebugger(Status &err,
launch_info.SetExecutableFile(exe_module_sp->GetPlatformFileSpec(), true);
}

launch_info.GetEnvironment() = target_sp->GetTargetEnvironment();
debugger.SetAsyncExecution(false);
err = target_sp->Launch(launch_info, nullptr);
debugger.SetAsyncExecution(true);
Expand Down
4 changes: 3 additions & 1 deletion lldb/tools/repl/swift/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ int main() {
#endif
#ifdef __APPLE__
// Force loading of libswiftCore.dylib, which is not linked at build time.
dlopen("@rpath/libswiftCore.dylib", RTLD_LAZY);
// We load the system's libswiftCore, but this is overriden on tests to
// use the just built one by setting DYLD_LIBRARY_PATH.
dlopen("/usr/lib/swift/libswiftCore.dylib", RTLD_LAZY);
#elif defined(__linux__)
dlopen("libswiftCore.so", RTLD_LAZY);
#elif defined(_WIN32)
Expand Down