Skip to content

LLDB v --ptr-depth 1 can't dereference pointer to a struct #147450

@kerty0

Description

@kerty0

I tried this code:

struct S(i32);

fn main() {
    let s = &S(1);
    println!("Hello, world!");
}

When using LLDB with nightly Rust's pretty printers, I expect v --ptr-depth 1 to dereference the pointer to the struct and display its contents:

Process stopped
* thread #1, name = 'pp', stop reason = step over
    frame #0: 0x0000555555568bd0 pp`pp::main::hf3117127974a188e at main.rs:5:5
   2   	
   3   	fn main() {
   4   	   let s = &S(1);
-> 5   	   println!("Hello, world!");
   6   	}
(lldb) v --ptr-depth 1
(pp::S *) s = 0x0000555555559a84 {
  __0 = 1
}

Instead, it only prints the pointer address:

Process stopped
* thread #1, name = 'pp', stop reason = step over
    frame #0: 0x0000555555568bd0 pp`pp::main::hf3117127974a188e at main.rs:5:5
   2   	
   3   	fn main() {
   4   	   let s = &S(1);
-> 5   	   println!("Hello, world!");
   6   	}
(lldb) v --ptr-depth 1
(pp::S *) s = 0x0000555555559a84

This regressed in c39ebea

Meta

rustc --version --verbose:

rustc 1.92.0-nightly (3d8c1c1fc 2025-10-06)

lldb --version:

lldb version 20.1.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuggersArea: debuggers themselves (gdc, lldb, cdb, WinDbg, etc.)A-debuggers-lldbArea: lldbC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions