有没有办法自动避免在Visual Studio中进入某些功能? [英] Is there a way to automatically avoiding stepping into certain functions in Visual Studio?

查看:167
本文介绍了有没有办法自动避免在Visual Studio中进入某些功能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道启用我的代码调试选项,但这仅适用于托管代码。



我正在寻找一种步骤进入函数调用,而不必逐步通过,例如,STL字符串转换运算符,因为在函数的一个参数中存在从char *到字符串的隐式转换。

解决方案

我发现这个博客条目有一个解决方案。虽然我更愿意说不要进入任何不属于这个项目的东西,但这看起来很可行。



编辑:在几个博客和新闻组中,该方法是为您不想在此注册表项下进入的每个函数添加一个条目(假设为VS 2005):

 
32位Windows
\\HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\NativeDE\StepOver
< b> 64位Windows
\\HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\VisualStudio\8.0\NativeDE\StepOver

路径的版本号:

 
Visual Studio 2005:8.0
Visual Studio 2008:9.0
Visual Studio 2010:10.0
Visual Studio 2012:11.0
Visual Studio 2013:12.0

此键包含一组影响步进执行的规则。每个规则被指定为一个单独的条目,其名称是十进制数,其值是一个函数名称模式,用于指定要影响的函数。例如

 
10=boost\:\:scoped_ptr。* \:\:。* = NoStepInto

阻止进入boost :: scoped_ptr函数。



规则从从高到低的值,直到找到匹配的模式,或者没有规则。在这种情况下,功能将进入。



功能名称是正则表达式。



需要引用冒号使用反斜杠。



您可以指定StepInto以及NoStepInto。这将为您提供一种方法,避免在同一范围/命名空间中进入所有功能。



重新启动Visual Studio以接收注册表的更改。 p>

I'm aware of the "Enable just my code" debug option, but that only works for managed code.

I'm looking for a way to step into a function call without having to step through, for example, an STL string cast operator because there is an implicit conversion from a char* to a string in one of the function's parameters.

解决方案

I found this blog entry which has a solution. Although I'd prefer to be able to say "don't step into anything that isn't part of this project", this looks workable.

EDIT: After looking at a few blogs and newsgroups, the method is to add an entry for each function that you don't want to step into under this registry key (assuming VS 2005):

32 bit Windows
    \\HKEY_LOCAL_MACHINE\Software\Microsoft\VisualStudio\8.0\NativeDE\StepOver
64 bit Windows
    \\HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\VisualStudio\8.0\NativeDE\StepOver

Version numbers for the path:

Visual Studio 2005: 8.0
Visual Studio 2008: 9.0
Visual Studio 2010: 10.0
Visual Studio 2012: 11.0
Visual Studio 2013: 12.0

This key contains a set of rules which affect how stepping is performed. Each rule is specified as a separate entry whose name is a decimal number and whose value is a function name pattern that specifies which functions we want to affect. e.g.

    "10" = "boost\:\:scoped_ptr.*\:\:.*=NoStepInto"

prevents stepping into boost::scoped_ptr functions.

The rules are evaluated from high to low values until a matching pattern is found, or there are no rules left. In that case the function is stepped into.

Function names are regular expressions.

Colons need to be quoted with a backslash.

You can specify StepInto as well as NoStepInto. This gives you a way to avoid stepping into all but a few functions in the same scope/namespace.

Restart Visual Studio to pick up the changes to the registry.

这篇关于有没有办法自动避免在Visual Studio中进入某些功能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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