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
% which rust-lldb

which is the same as Mac Terminal.

The current version of Codelldb does not support Apple M1. But see this: Running on Arm64 Macs · vadimcn/vscode-lldb Wiki · GitHub