問題描述
我知道僅啟用我的代碼"調試選項,但這僅適用于托管代碼.
我正在尋找一種無需單步執行即可進入函數調用的方法,例如,STL 字符串轉換運算符,因為在函數的一個參數中存在從 char* 到字符串的隱式轉換.
我發現了這個 博客條目 有解決方案.雖然我更愿意說不要介入任何不屬于這個項目的事情",但這看起來可行.
查看了一些博客和新聞組后,方法是在此注冊表項下為每個不想步入的函數添加一個條目(假設為 VS 2005):
<前>32 位 Windows\HKEY_LOCAL_MACHINESoftwareMicrosoftVisualStudio8.0NativeDEStepOver64 位 Windows\HKEY_LOCAL_MACHINESoftwareWow6432NodeMicrosoftVisualStudio8.0NativeDEStepOver路徑的版本號:
<前>Visual Studio 2005:8.0Visual Studio 2008:9.0Visual Studio 2010:10.0Visual Studio 2012:11.0Visual Studio 2013:12.0該鍵包含一組影響步進執行方式的規則.每條規則都被指定為一個單獨的條目,其名稱是一個十進制數,其值是一個函數名稱模式,用于指定我們想要影響哪些函數.例如
<前>"10" = "boost::scoped_ptr.*::.*=NoStepInto"防止進入 boost::scoped_ptr 函數.
規則從高值到低值進行評估,直到找到匹配的模式,或者沒有剩下的規則.在這種情況下,函數被步進.
函數名是正則表達式.
冒號需要用反斜杠引用.
您可以指定 StepInto 和 NoStepInto.這為您提供了一種方法,可以避免進入同一作用域/命名空間中的除少數函數之外的所有函數.
重新啟動 Visual Studio 以獲取對注冊表的更改.
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_MACHINESoftwareMicrosoftVisualStudio8.0NativeDEStepOver 64 bit Windows \HKEY_LOCAL_MACHINESoftwareWow6432NodeMicrosoftVisualStudio8.0NativeDEStepOver
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 中的某些功能?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!