c++ - 有没有一种简单的方法可以让 `boost::ptr_vector` 在 Visual Studio 中对调试器更加友好?

标签 c++ visual-studio-2010 visual-c++ debuggervisualizer boost-ptr-container

我正在考虑使用 boost::ptr_container 作为 this question 的响应的结果.该库的最大问题是我无法在调试器中查看集合的内容,因为 MSVC 调试器无法识别它,因此我看不到容器的内容。 (所有数据在内部存储为 void *)

我听说 MSVC 有一个名为“调试器可视化器”的功能,它允许用户使调试器更智能地处理这些事情,但我从来没有写过这样的东西,而且我不是很熟悉这样的事情。

例如,将 boost::shared_ptr 的行为与 MSVC 自己的 std::tr1::shared_ptr 进行比较。在调试器中(即在 Watch 窗口中),boost 版本显示为用于实现共享指针的大量内部变量,但 MSVC 版本显示为指向对象的普通指针(以及 shared_ptr 的内脏是隐藏的)。

我怎样才能开始使用或实现这样的东西?

最佳答案

this link它提供了您可能想要的每个调试器可视化工具(通过 autoexp.dat):

All visualizers are available in the svn. Currently, we support the following Boost types:

  • boost::array, ptr_array, ptr_deque, ptr_list, ptr_map, ptr_multimap, ptr_set, ptr_multiset, ptr_vector
  • boost::interprocess::offset_ptr
  • boost::optional
  • boost::multi_index_container
  • boost::shared_ptr
  • boost::posix_time::ptime,
  • boost::posix_time::time_duration (two variants are available)
  • boost::regex
  • boost::variant

关于c++ - 有没有一种简单的方法可以让 `boost::ptr_vector` 在 Visual Studio 中对调试器更加友好?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4532109/

相关文章:

c++ - vc++ 应用程序中的看门狗

c++ - 为什么我不能继承虚拟基的构造函数?

c++ - 什么容器来存储唯一值?

visual-studio-2010 - 是否可以通过 Microsoft 测试管理器安排自动化测试?

visual-studio-2010 - 使用 Azure 计算模拟器调试角色实例的问题, '/' 应用程序中的服务器错误

c++ - 全局 "placement"删除[]

c++ - opengl 立方体不会渲染

c++ - std::map 转换器模板

visual-studio-2010 - 在 VS2010 中如何添加现有项目的整个目录

c++ - vtkCharts 库既不适用于 Visual Studio 也不适用于 GCC 编译器 - 为什么?