Skip to content

HashMap not rendered properly when using MSVC debugger #92286

Closed
@selvavm

Description

@selvavm

When I was working in a Rust project few months back, I was able properly visualize Hashmap in the debugger pane of VSCode when using MSVC debugger. Now it is showing Raw data. Is the structure of HashMap changed which needs a modification to Natvis file?

I tried this code:

fn main() {
    println!("Hello, world!");
    let mut hash_map = HashMap::new();
    hash_map.insert("Test1".to_string(), "Test1".to_string());
    hash_map.insert("Test2".to_string(), "Test2".to_string());
    hash_map.insert("Test3".to_string(), "Test3".to_string());
    println!("End, world!");
}

I expected to see this happen: The debugger pane showing key and value combination

Instead, this happened: Showing the raw data and pointers
image

rustc --version --verbose:

rustc 1.57.0 (f1edd0429 2021-11-29)
binary: rustc
commit-hash: f1edd0429582dd29cccacaf50fd134b05593bd9c
commit-date: 2021-11-29
host: x86_64-pc-windows-msvc
release: 1.57.0
LLVM version: 13.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)C-bugCategory: This is a bug.O-windows-msvcToolchain: MSVC, Operating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions