Visual Studio 2013 C ++:STL容器的元素显示在调试器中 [英] Visual Studio 2013 C++: STL container's elements display in debugger

查看:949
本文介绍了Visual Studio 2013 C ++:STL容器的元素显示在调试器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

MSVS 2013在C ++调试(自动和观察窗口)只显示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显示STL容器(如MSVS 2010)调试程序?

我试图删除 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容器的元素显示在调试器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆