microsoft / microsoft/vscode-cpptools
std::unordered_map values display as "(,)" in hover/variables panel with cppvsdbg debugger
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
- VS Code version: 1.115.0
- cpptools extension: ms-vscode.cpptools 1.31.4
- OS: Windows 11
- Compiler: MSVC (Visual Studio Community 2022, amd64)
- CMake Kit: Visual Studio Community 2022 Release - amd64
Bug Description
When debugging a C++ project built with MSVC (VS2022), std::unordered_map<int, float> values are displayed as (,) in both the hover tooltip and the Variables/Watch panel.
Steps to Reproduce
- Declare and populate a
std::unordered_map<int, float>variable. - Start debugging (via CMake Tools, using cppvsdbg).
- Hover over the variable or expand it in the Variables panel.
Expected Behavior
Each entry should display as [key] = value, e.g. [3] = 0.5.
Actual Behavior
Each entry displays as [3] = (, ).
Additional Notes
begin()->firstandbegin()->secondboth evaluate correctly in the Watch panel, so debug info is intact.- The issue appears to be that
std::pair::DisplayStringexpressions ({first},{second}) fail when rendered as part of unordered_map expansion in vsdbg's natvis engine. std::vectordisplays correctly.
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
Reproduce the issue with the supplied MSVC/cppvsdbg setup, then inspect how the debugger's natvis handling expands std::unordered_map entries and evaluates std::pair::DisplayString expressions. Compare hover and Variables-panel output with the working Watch expressions; done means each entry displays its key and value instead of (, ).
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100