Unable to read value of recursive enum when debugging with lldb
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Hello,
I'm currently facing an issue preventing me from debugging some code where recursive enums are involved. I cannot read the value from the debugger (LLDB using the extension from Vadim Chugunov on VSCode), instead I get the following error message in vscode: "<error: invalid value object>". Other types are readable, even non-recursive enums.
A picture is worth a thousand words so here it is:
The code to reproduce is simple:
#[derive(Debug)]
enum Test{
Test(Box<Test>),
Tail
}
fn main() {
let t = Test::Test(Box::new(Test::Tail));
println!("{:?}", t);
}
Ideally, I would be able to troubleshoot the content of the variable.
Here is the version of rust I'm using:
$ rustc --version --verbose
rustc 1.74.0 (79e9716c9 2023-11-13)
binary: rustc
commit-hash: 79e9716c980570bfd1f666e3b16ac583f0168962
commit-date: 2023-11-13
host: x86_64-unknown-linux-gnu
release: 1.74.0
LLVM version: 17.0.4
I have the same problem with the nightly
$ rustc --version --verbose
rustc 1.76.0-nightly (37b2813a7 2023-11-24)
binary: rustc
commit-hash: 37b2813a7be580ef59048a6bd08444c79e5cc97f
commit-date: 2023-11-24
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5
I think this might not be a bug but rather a use case not yet properly handled by rust and/or lldb. Does anyone know?
Thanks in advance.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the recursive-enum example with rustc, LLDB, and the VSCode extension, then inspect how the debugger presents the variable. Done means the recursive enum's value and contents can be read in the debugger instead of showing "<error: invalid value object>".
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100