codelldb: Unable to debug Rust with Amethyst library
OS: Windows 10 - 64x VSCode version: 1.52.1 Extension version: 1.6.1 Compiler: Rustc 1.49.0 Build target: stable-x86_64-pc-windows-msvc
I’m unable to debug in Rust using the Amethyst game library. Trying to do so makes a message appear with the text: “Oops! The debug adapter has terminated abnormally.”
main.rs
fn main() -> amethyst::Result<()> {
amethyst::start_logger(Default::default());
let _app_root = amethyst::utils::application_root_dir()?; // commenting this line makes it work
Ok(())
}
Cargo.toml
[package]
name = "test_rust"
version = "0.1.0"
edition = "2018"
[dependencies.amethyst]
git = "https://github.com/amethyst/amethyst.git"
branch = "main"
features = ["vulkan"]
launch.json
{ // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 “version”: “0.2.0”, “configurations”: [ { “type”: “lldb”, “request”: “launch”, “name”: “Debug executable ‘test_rust’”, “cargo”: { “args”: [ “build”, “–bin=test_rust”, “–package=test_rust” ], “filter”: { “name”: “test_rust”, “kind”: “bin” } }, “args”: [], “cwd”: “${workspaceFolder}” }, { “type”: “lldb”, “request”: “launch”, “name”: “Debug unit tests in executable ‘test_rust’”, “cargo”: { “args”: [ “test”, “–no-run”, “–bin=test_rust”, “–package=test_rust” ], “filter”: { “name”: “test_rust”, “kind”: “bin” } }, “args”: [], “cwd”: “${workspaceFolder}” } ] }
Debug log
Running `cargo build --bin=test_rust --package=test_rust --message-format=json`...
Compiling test_rust v0.1.0 (E:\source\test_rust)
Finished dev [unoptimized + debuginfo] target(s) in 2.47s
Raw artifacts:
{
fileName: 'e:\\source\\test_rust\\target\\debug\\test_rust.exe',
name: 'test_rust',
kind: 'bin'
}
Filtered artifacts:
{
fileName: 'e:\\source\\test_rust\\target\\debug\\test_rust.exe',
name: 'test_rust',
kind: 'bin'
}
configuration: {
type: 'lldb',
request: 'launch',
name: "Debug executable 'test_rust'",
args: [],
cwd: '${workspaceFolder}',
__configurationTarget: 5,
relativePathBase: 'e:\\source\\test_rust',
program: 'e:\\source\\test_rust\\target\\debug\\test_rust.exe',
sourceLanguages: [ 'rust' ]
}
liblldb: c:\Users\my_usr\.vscode\extensions\vadimcn.vscode-lldb-1.6.0\lldb\bin\liblldb.dll
environment: { LLDB_CAPTURE_REPRODUCER: '1' }
params: { sourceLanguages: [ 'rust' ] }
Listening on port 52111
[2021-01-31T04:17:28Z DEBUG codelldb] New debug session
INFO(Python) 05:17:28 formatters: Initializing
INFO(Python) 05:17:28 formatters.rust: Initializing
[2021-01-31T04:17:28Z DEBUG codelldb::dap_codec] --> {"command":"initialize","arguments":{"clientID":"vscode","clientName":"Visual Studio Code","adapterID":"lldb","pathFormat":"path","linesStartAt1":true,"columnsStartAt1":true,"supportsVariableType":true,"supportsVariablePaging":true,"supportsRunInTerminalRequest":true,"locale":"en-gb","supportsProgressReporting":true,"supportsInvalidatedEvent":true},"type":"request","seq":1}
[2021-01-31T04:17:28Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":1,"success":true,"command":"initialize","body":{"exceptionBreakpointFilters":[{"default":true,"filter":"rust_panic","label":"Rust: on panic"}],"supportTerminateDebuggee":true,"supportsCancelRequest":true,"supportsCompletionsRequest":true,"supportsConditionalBreakpoints":true,"supportsConfigurationDoneRequest":true,"supportsDataBreakpoints":true,"supportsDelayedStackTraceLoading":true,"supportsEvaluateForHovers":true,"supportsFunctionBreakpoints":true,"supportsGotoTargetsRequest":true,"supportsHitConditionalBreakpoints":true,"supportsLogPoints":true,"supportsReadMemoryRequest":true,"supportsRestartFrame":true,"supportsSetVariable":true}}
[2021-01-31T04:17:28Z DEBUG codelldb::dap_codec] --> {"command":"launch","arguments":{"type":"lldb","request":"launch","name":"Debug executable 'test_rust'","args":[],"cwd":"E:\\source\\test_rust","__configurationTarget":5,"relativePathBase":"e:\\source\\test_rust","program":"e:\\source\\test_rust\\target\\debug\\test_rust.exe","sourceLanguages":["rust"],"_adapterSettings":{"displayFormat":"auto","showDisassembly":"auto","dereferencePointers":true,"suppressMissingSourceFiles":true,"evaluationTimeout":5,"consoleMode":"commands","sourceLanguages":null,"terminalPromptClear":null},"__sessionId":"5a6f234e-b41d-469d-8bea-d9e8c8be42f9"},"type":"request","seq":2}
[2021-01-31T04:17:29Z DEBUG codelldb::dap_codec] <-- {"type":"event","seq":1,"event":"initialized"}
[2021-01-31T04:17:29Z DEBUG codelldb::dap_codec] <-- {"type":"request","seq":2,"command":"runInTerminal","arguments":{"args":["c:\\Users\\my_usr\\.vscode\\extensions\\vadimcn.vscode-lldb-1.6.0\\adapter\\codelldb.exe","terminal-agent","--port=52113"],"cwd":"","kind":"integrated","title":"Debug executable 'test_rust'"}}
[2021-01-31T04:17:29Z DEBUG codelldb::dap_codec] --> {"command":"setBreakpoints","arguments":{"source":{"name":"main.rs","path":"e:\\source\\test_rust\\src\\main.rs"},"lines":[6],"breakpoints":[{"line":6}],"sourceModified":false},"type":"request","seq":3}
[2021-01-31T04:17:30Z DEBUG codelldb::dap_codec] --> {"type":"response","seq":4,"command":"runInTerminal","request_seq":2,"success":true,"body":{"shellProcessId":2340}}
[2021-01-31T04:17:30Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":3,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"message":"Locations: 0","verified":false}]}}
[2021-01-31T04:17:30Z DEBUG codelldb::dap_codec] --> {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":5}
[2021-01-31T04:17:30Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":5,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
[2021-01-31T04:17:30Z DEBUG codelldb::dap_codec] --> {"command":"setDataBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":6}
[2021-01-31T04:17:30Z DEBUG codelldb::dap_codec] <-- {"type":"response","request_seq":6,"success":true,"command":"setDataBreakpoints","body":{"breakpoints":[]}}
[2021-01-31T04:17:30Z DEBUG codelldb::dap_codec] --> {"command":"setExceptionBreakpoints","arguments":{"filters":["rust_panic"]},"type":"request","seq":7}
Debug adapter exit code=3221225620, signal=null.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 16 (5 by maintainers)
I have the same problem. Thanks to @GuiAmPm, I have solved it. The reason is that I have installed NVIDIA Nsight. As shown below, the msdia140.dll for Nsight has been loaded by codelldb.
Run PowerShell as administrator. Execute the command below to register the component. Then codelldb works.
regsvr32.exe C:\Users\【user name】\.vscode\extensions\vadimcn.vscode-lldb-1.6.8\lldb\bin\msdia140.dll