Skip to content

test\debuginfo\pretty-std-collections-hash.rs fails with Visual Studio 2017 toolchain #76352

Closed
@petrochenkov

Description

@petrochenkov

These two lines in src\etc\natvis\libstd.natvis confuse both cdb and GUI debugger available inside VS:

<Item Name="{static_cast&lt;tuple&lt;$T1, $T2&gt;*&gt;(base.table.ctrl.pointer)[-(i + 1)].__0}">static_cast&lt;tuple&lt;$T1, $T2&gt;*&gt;(base.table.ctrl.pointer)[-(i + 1)].__1</Item>
<Item>static_cast&lt;$T1*&gt;(map.base.table.ctrl.pointer)[-(i + 1)]</Item>

cdb gives this error

Unable to find type 'tuple<u64,u64> *' for cast.

GUI debugger just skips the visualization and only shows raw representation.


It is possible to fix visualization inside VS GUI debugger by replacing static_cast with C-style casts

<Item Name="{((tuple&lt;$T1, $T2&gt;*)base.table.ctrl.pointer)[-(i + 1)].__0}">((tuple&lt;$T1, $T2&gt;*)base.table.ctrl.pointer)[-(i + 1)].__1</Item>
<Item>(($T1*)map.base.table.ctrl.pointer)[-(i + 1)]</Item>

, but I haven't found a way to make cdb eat this yet.


Tests for other debuggers can use requirement directives like

// min-gdb-version: 8.2

If cdb from VS2017 toolchain is unable to perform computations required for visualizing hash set/map, then we need to introduce such requirements for cdb as well.

cc @Amanieu @MaulingMonkey

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-testsuiteArea: The testsuite used to check the correctness of rustcC-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