rust-analyzer: Debug functionalilty broken in VS code on MacOS
rust-analyzer version: 0.3.1885-standalone (b6d1887bc 2024-03-17) Issue also occurs on 0.3.1877-standalone (574e23ec5 2024-03-09) Does not occur on previous versions.
rustc version: rustc 1.73.0 (cc66ad468 2023-10-03)
relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)
- MacOS 14.3.1 with Apple M1 Pro
- VS Code Version: 1.87.1 (Universal)
- CodeLLDB v1.10.0
- No configurations in launch.json:
{
"version": "0.2.0",
"configurations": []
}
Running any #[test] > Debug results in popup:
"Unable to start debugging. Launch options string provided by the project system is invalid. Unable to determine path to debugger. Please specify the "MIDebuggerPath" option."
- No change in any setting other than updating the rust-analyzer extension to one of the two versions above triggers this issue.
- No problems on rust-analyzer version: 0.3.1868-standalone (037924c4d 2024-03-03) or lower.
repository link (if public, optional): -
code snippet to reproduce:
#[test]
// any test
Thank you for investigating!
About this issue
- Original URL
- State: closed
- Created 3 months ago
- Reactions: 13
- Comments: 16 (10 by maintainers)
Commits related to this issue
- Auto merge of #16964 - lnicola:debugger-order, r=roife fix: Revert debug extension priorities Close #16901 — committed to rust-lang/rust-analyzer by bors 3 months ago
- Auto merge of #16965 - roife:use-lldb-for-cpp-ext, r=lnicola fix: use lldb when debugging with C++ extension on MacOS See https://github.com/rust-lang/rust-analyzer/issues/16901#issuecomment-2024486... — committed to rust-lang/rust-analyzer by bors 3 months ago
Thanks a lot @lnicola and @roife. I just tested with rust-analyzer version: 0.4.1901-standalone (29a8e65bb 2024-03-28) and can confirm debugging is working again š
A nightly release with the fix is now available, in case anyone wants to test it.
This was confusing since there was no setting change and the error message is misleading. Downgrading the VS Code extension allowed debugging again.
I can confirm as well that 0.3.1868 and earlier are working. All debugging is broken on and after v0.3.1877
Somewhat related we should probably configure the extensions to use
rust-gdbandrust-lldb, but Iām not sure those are inPATHfor everyone.OK, Iāve found the issue with the inability to use C++ extension on Mac: currently, Apple Silicon cannot utilize GDB (due to Appleās restrictions on Kernel š¢), hence on macOS, we can only use lldb.
Oh š¤¦. I didnāt expect anyone to have multiple debugging extensions, but it makes sense with the C++ one.
In #16719, the order of the debugger changed, prioritizing āms-vscode.cpptoolsā, which resulted in the error. However, debugging with
codelldbstill works fine even without generating alaunch.jsonfile.Seeing same issue and I can confirm that downgrading to v0.3.1868 solves it.
This issue cannot be reproduced on my machine (M3 Max, macOS 14.3.1). If the problem was introduced by
v0.3.1877, could it be related to commit a01e4f8b72ccea318e5fb98c8f0cc2cab2c212b3 (#16719)?