【问题标题】:How can I avoid debugging into Boost source code in Visual Studio?如何避免在 Visual Studio 中调试到 Boost 源代码?
【发布时间】:2012-02-20 16:37:11
【问题描述】:

有没有办法从调试中排除 boost 源代码(或任何其他)?我不想涉足 boost 内部源代码。

例如:

boost::shared_ptr<Xyz> xyz(new Xyz());
xyz->someMethod();

当我想使用 F11 进入Xyz::someMethod() 时,调试器首先进入boost/shared_ptr.hpp,然后我得到into Xyz::someMethod()

【问题讨论】:

标签: c++ debugging visual-c++ boost visual-studio-debugging


【解决方案1】:

启动 regedit 并导航到以下键:

在 32 位操作系统下:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\10.0\NativeDE\StepOver

在 64 位操作系统下:

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\10.0\NativeDE\StepOver

在那里创建一个新的字符串值。随意命名。输入这个作为内容:

boost\:\:.*

(您需要重新启动 Visual Studio。)

【讨论】:

  • 如果您使用的是 Visual Studio Express,则密钥为 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VCExpress\10.0\NativeDE\StepOver
  • 这听起来像是一个不错的解决方案,但今天我们乐于助人的 IT 管理员刚刚决定启动 regedit 对我们这些菜鸟来说是危险的 :-( -> +1 反正
【解决方案2】:

对于 Visual Studio 2012:

here所述,此信息存储在文件C:\Program Files[ (x86)]\Microsoft Visual Studio 11.0\Common7\Packages\Debugger\Visualizers\default.natstepfilter

对于 boost::shared_ptr,这里有帮助:

<Function><Name>boost::shared_ptr&lt;.*</Name><Action>NoStepInto</Action></Function>

【讨论】:

  • 也适用于 VS 2015。谢谢!
  • VS 2017 这个文件可以在下面找到:C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\Packages\Debugger\Visualizers 谢谢!
  • 和“boost::*NoStepInto”来摆脱所有的boost文件步入。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-27
  • 2013-02-17
  • 2022-10-23
  • 2011-10-11
  • 2017-07-30
  • 1970-01-01
相关资源
最近更新 更多