Visual Studio 2013 C++: STL container#39;s elements display in debugger(Visual Studio 2013 C++:STL 容器的元素显示在调试器中)
问题描述
C++ 调试期间的 MSVS 2013(自动和监视窗口)仅显示 STL 容器的大小:
MSVS 2013 during C++ debugging (Autos and Watch windows) shows only size of STL container's:
MSVS 2010: "[9](9,8,7,6,5,4,3,2,1)"
MSVS 2013: "{ size=9 }"
在 MSVS 2013 中查看元素的值需要行展开.
有没有办法让 MSVS 2013 在调试器中显示像 MSVS 2010 这样的 STL 容器?
我试图删除 stl.natvis(它在 2013 年使用过),但没有帮助:autoexp.dat 仍未使用.
是否可以强制 MSVS 2013 使用 autoexp.dat?
是否可以修改 stl.natvis 脚本(根据容器元素的值构造 DisplayString)?
还有什么办法吗?
Line expand is required to see element's value in MSVS 2013.
Is there any way to make MSVS 2013 show STL containers like MSVS 2010 in debugger?
I tried to remove stl.natvis (it is used in 2013), but it doesn't help: autoexp.dat is still not used.
Is possible to force MSVS 2013 use autoexp.dat?
Is it possible to modify stl.natvis scripts (construct DisplayString from container element's values)?
Any other way?
推荐答案
我找到了一种强制 MSVS 2012/2013 使用 autoexp.dat 的方法:设置启用编辑并继续"和启用本机编辑并继续".
它禁用 C++ 的数据查看增强"(natvis)和 std::vector 的元素(std::list、std::map、...) 显示在变量的主线上(MSVS 2010 样式).
但是,仍然很有趣,是否可以修改 stl.natvis 以获得相同的显示结果?
I found one way to force MSVS 2012/2013 use autoexp.dat: set "Enable Edit And Continue" and "Enable Native Edit and Continue".
It disables "data viewing enhancements" (natvis) for C++, and elements of std::vector (std::list, std::map, ...) become displayed on the main line of the variable (MSVS 2010 style).
But, it still would be interesting, is it possible to modify stl.natvis to get the same display result?
这篇关于Visual Studio 2013 C++:STL 容器的元素显示在调试器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Visual Studio 2013 C++:STL 容器的元素显示在调试器中


基础教程推荐
- 管理共享内存应该分配多少内存?(助推) 2022-12-07
- 如何在不破坏 vtbl 的情况下做相当于 memset(this, ...) 的操作? 2022-01-01
- 如何使图像调整大小以在 Qt 中缩放? 2021-01-01
- 如何“在 Finder 中显示"或“在资源管理器中显 2021-01-01
- 使用从字符串中提取的参数调用函数 2022-01-01
- Windows Media Foundation 录制音频 2021-01-01
- 从 std::cin 读取密码 2021-01-01
- 为 C/C++ 中的项目的 makefile 生成依赖项 2022-01-01
- 为什么语句不能出现在命名空间范围内? 2021-01-01
- 在 C++ 中循环遍历所有 Lua 全局变量 2021-01-01