Skip to content

Unable to read value of recursive enum when debugging with lldb #118331

Open
@clems4ever

Description

@clems4ever

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:

screenshot-2023-11-26T19:13:48+01:00

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.WG-debuggingWorking group: Bad Rust debugging experiences

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions