eecs280staff / tutorials

Tools and tutorials
https://eecs280staff.github.io/tutorials/
Other
5 stars 4 forks source link

VS Code on Mac Debug Fails #177

Closed jamesjuett closed 8 months ago

jamesjuett commented 9 months ago

Especially on older Macs with an Intel chip or following an update, debugging in VS Code with CodeLLDB fails.

Evidently, the crux of the issue is that CodeLLDB includes a bundled debugserver, which is incompatible (or becomes incompatible after an update). https://github.com/vadimcn/codelldb/issues/999

A potential fix is to delete that bundled file. Removing it results in fallback to a system version that works.

cd ~/.vscode/extensions/vadimcn.vscode-lldb-1.10.0/lldb/bin
rm debugserver

See https://github.com/vadimcn/codelldb/discussions/456#discussioncomment-874122.

We should probably add this to the troubleshooting section.

A prerequisite for this workaround is students having CLI tools installed via xcode-select --install, but we already have them do that. (Otherwise there wouldn't be a separate debugserver to fall back on.)

I'll also note that the issue that prompted the most recent switch to CodeLLDB rather than the microsoft C++ debugging extension is unfortunately still unresolved. Otherwise, we could consider not recommending CodeLLDB anymore. https://github.com/microsoft/vscode-cpptools/issues/7240