Open chanmaoganda opened 1 month ago
Not lldb-dap specific, but applies to lldb in general
@llvm/issue-subscribers-lldb
Author: Jingchen Wang (chanmaoganda)
lldb doesn't have "native" support for Rust. There's no Rust Language or runtime plugins, and there isn't a Rust frontend to use for parsing expressions.
The current level of support for rust in lldb is: Rust claims to be "another variant of C++". So we ingest Rust types from DWARF into the Clang AST's, and use the C++ parser to parse expressions using those types. Rust also supplies some lldb data formatters that can help introspect common Rust data types. From reports I've gotten execution control is okay, and with the Rust data formatters the frame var
command is mostly useful. But you don't get very far with the expression parser.
You might be able to emulate what rust-lldb
does (https://github.com/rust-lang/rust/blob/master/src/etc/rust-lldb) by adding a initCommand
(https://github.com/llvm/llvm-project/blob/main/lldb/tools/lldb-dap/README.md#configuration-settings-reference) to load the formatters file (https://github.com/rust-lang/rust/blob/27e38f8fc7efc57b75e9a763d7a0ee44822cd5f7/src/etc/lldb_lookup.py).
Allegedly CodeLLDB can be used - https://code.visualstudio.com/docs/languages/rust#_debugging
Though I wonder if it suffers from the same drawbacks.
I'm currently using llvm@18.1.8 and lldb-dap@0.2.6. I tried to debug rust programs, but i got the following error:
warning: This version of LLDB has no plugin for the language "rust". Inspection of frame variables will be limited.
though frames is limited, variables are able to inspect