VS Code debug Rust program: error attach failed ((os/kern) invalid argument on Mac M1

Running either lldb target/debug/rust or rust-lldb target/debug/rust from the VS Code Terminal will open the debugger, but running the program (with or without breakpoint at the main function) returns:

error: process exited with status -1 (attach failed ((os/kern) invalid argument))

I'm running on Mac M1. Running the same stuff from Mac Terminal works fine.

From VS Code Terminal:

% which lldb
/usr/bin/lldb
% which rust-lldb
/Users/me/.cargo/bin/rust-lldb

which is the same as Mac Terminal.

The current version of Codelldb does not support Apple M1. But see this: https://github.com/vadimcn/vscode-lldb/wiki/Running-on-Arm64-Macs

This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.