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 容器的元素显示在调试器中


基础教程推荐
- 我有静态或动态 boost 库吗? 2021-01-01
- 静态库、静态链接动态库和动态链接动态库的 .lib 文件里面是什么? 2021-01-01
- 这个宏可以转换成函数吗? 2022-01-01
- 如何将 std::pair 的排序 std::list 转换为 std::map 2022-01-01
- 如何在 C++ 中初始化静态常量成员? 2022-01-01
- 常量变量在标题中不起作用 2021-01-01
- 在 C++ 中计算滚动/移动平均值 2021-01-01
- 如何通过C程序打开命令提示符Cmd 2022-12-09
- C++结构和函数声明。为什么它不能编译? 2022-11-07
- 如何检查GTK+3.0中的小部件类型? 2022-11-30