Skip to content
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

Fix lldb-dap path on Darwin #1008

Merged
merged 2 commits into from
Aug 15, 2024

Conversation

plemarquand
Copy link
Contributor

The lldb-dap binary is not in the toolchain directory on Darwin like it is on Linux and Windows. Use xcrun -find lldb-dap on Darwin to find the correct lldb-dap location.

The `lldb-dap` binary is not in the toolchain directory on Darwin like
it is on Linux and Windows. Use `xcrun -find lldb-dap` on Darwin to find
the correct `lldb-dap` location.
@adam-fowler
Copy link
Contributor

Has lldb-dap moved? It used to be in the same folder as swift etc. Using xcrun will mean we get the lldb-dap from the currently selected Xcode not the current toolchain in VSCode.

@plemarquand
Copy link
Contributor Author

I dont know if its moved, I don't have the Xcode 16 Beta 1 anymore to check, but its in /Applications/Xcode.app/Contents/Developer/usr/bin/lldb-dap not /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lldb-dap, which is where we're looking today.

Good catch about xcrun -find returning the executable in the selected Xcode. I'll have to try another approach. We'll have to update the existing getLLDB() function as well, as it also uses xcrun.

@adam-fowler
Copy link
Contributor

The important thing is lldb and lldb-dap both come from the same source. If we are using xcrun for lldb then I guess we should do the same for lldb-dap.

Ideally we would use the one that comes with the toolchain we are using though.

@award999
Copy link
Contributor

Ideally we would use the one that comes with the toolchain we are using though.

The find command can specify toolchain, ex. xcrun --toolchain OSX15_1 -f lldb-dap

Seems like maybe only the default toolchain does not have lldb-dap because the other handful I try seem to, ex. /Applications/Xcode.app/Contents/Developer/Toolchains/OSX15.1.xctoolchain/usr/bin/lldb-dap

@plemarquand
Copy link
Contributor Author

@adam-fowler after some double checking, because we're specifying the DEVELOPER_DIR as an environment variable for xcrun it does search in the VS Code selected toolchain.

I just pushed an update that searches the selected toolchain for lldb-dap before falling back to looking in Xcode on Darwin, same as how we were looking for lldb.

@award999 award999 added the needs verification Issue has been fixed, but requires verification before closing label Aug 15, 2024
@plemarquand plemarquand merged commit e0a0fba into swiftlang:main Aug 15, 2024
7 of 8 checks passed
@plemarquand plemarquand deleted the toolchain-debug-adapter-macos branch August 15, 2024 14:30
@matthewbastien
Copy link
Member

Verified with d6c91dd

@matthewbastien matthewbastien removed the needs verification Issue has been fixed, but requires verification before closing label Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants