Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

std::unordered_map values display as "(,)" in hover/variables panel with cppvsdbg debugger

未关闭
#14,362 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
冷清
技术栈
cpp
领域
devtools

调研方向

使用提供的 MSVC/cppvsdbg 设置重现该问题,然后检查调试器的 natvis 处理如何展开 std::unordered_map 条目并计算 std::pair::DisplayString 表达式。将悬停和 Variables 面板中的输出与正常工作的 Watch 表达式进行比较;当每个条目显示其键和值而不是 (, ) 时即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug debugger help wanted

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.

Image

Steps to Reproduce

  1. Declare and populate a std::unordered_map<int, float> variable.
  2. Start debugging (via CMake Tools, using cppvsdbg).
  3. 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()->first and begin()->second both evaluate correctly in the Watch panel, so debug info is intact.
  • The issue appears to be that std::pair::DisplayString expressions ({first}, {second}) fail when rendered as part of unordered_map expansion in vsdbg's natvis engine.
  • std::vector displays correctly.
主要语言
TypeScript
星标
6.2k
派生
1.7k
平均合并
1 天 4 小时
30 天内合并 PR
58

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/vscode-cpptools 的其他 Issue

查看 microsoft/vscode-cpptools 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。