打开下面这个文件。注意这个文件是只读文件,需要先去掉只读属性才能修改
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Packages\Debugger\Visualizers\default.natstepfilter
在 </StepFilter>之前插入一行
<Function><Name> std::.* </Name><Action> NoStepInto </Action></Function>
也就是将
- <?xml version="1.0" encoding="utf-8"?> <StepFilter xmlns="http://schemas.microsoft.com/vstudio/debugger/natstepfilter/2010"> <Function><Name>__security_check_cookie</Name><Action>NoStepInto</Action></Function> <Function><Name>__abi_winrt_.*</Name><Action>NoStepInto</Action></Function> <Function><Name>_ObjectStublessClient.*</Name><Action>NoStepInto</Action></Function> <Function><Name>_Invoke@12</Name><Action>NoStepInto</Action></Function> <Function><Name>_RTC_Check(Esp|StackVars)</Name><Action>NoStepInto</Action></Function> <Function><Name>_chkstk</Name><Action>NoStepInto</Action></Function> <Function><Name>ATL::CComPtrBase.*::operator&</Name><Action>NoStepInto</Action></Function> <Function><Name>ATL::CComPtrBase.*::operator-></Name><Action>NoStepInto</Action></Function> <Function><Name>ATL::CHeapPtrBase.*::operator&</Name><Action>NoStepInto</Action></Function> <Function><Name>ATL::CHeapPtrBase.*::operator-></Name><Action>NoStepInto</Action></Function> <Function><Name>ATL::CComBSTR::operator&</Name><Action>NoStepInto</Action></Function> <Function><Name>std::forward<.*</Name><Action>NoStepInto</Action></Function> <Function><Name>std::move<.*</Name><Action>NoStepInto</Action></Function> <Function><Name>Platform::EventSource::Invoke.*</Name><Action>NoStepInto</Action></Function> <Function><Name>IID_PPV_ARGS_Helper<.*</Name><Action>NoStepInto</Action></Function> <Function><Name>Microsoft::WRL::ComPtr<.*>::operator&</Name><Action>NoStepInto</Action></Function> <Function><Name>Microsoft::WRL::ComPtr<.*>::operator-></Name><Action>NoStepInto</Action></Function> <Function><Name>Microsoft::WRL::Details::ComPtrRef.*</Name><Action>NoStepInto</Action></Function> <Function><Name>operator new</Name><Action>NoStepInto</Action></Function> </StepFilter>
修改为
<?xml version="1.0" encoding="utf-8"?>
<StepFilter xmlns="http://schemas.microsoft.com/vstudio/debugger/natstepfilter/2010">
<Function><Name>__security_check_cookie</Name><Action>NoStepInto</Action></Function>
<Function><Name>__abi_winrt_.*</Name><Action>NoStepInto</Action></Function>
<Function><Name>_ObjectStublessClient.*</Name><Action>NoStepInto</Action></Function>
<Function><Name>_Invoke@12</Name><Action>NoStepInto</Action></Function>
<Function><Name>_RTC_Check(Esp|StackVars)</Name><Action>NoStepInto</Action></Function>
<Function><Name>_chkstk</Name><Action>NoStepInto</Action></Function>
<Function><Name>ATL::CComPtrBase.*::operator&</Name><Action>NoStepInto</Action></Function>
<Function><Name>ATL::CComPtrBase.*::operator-></Name><Action>NoStepInto</Action></Function>
<Function><Name>ATL::CHeapPtrBase.*::operator&</Name><Action>NoStepInto</Action></Function>
<Function><Name>ATL::CHeapPtrBase.*::operator-></Name><Action>NoStepInto</Action></Function>
<Function><Name>ATL::CComBSTR::operator&</Name><Action>NoStepInto</Action></Function>
<Function><Name>std::forward<.*</Name><Action>NoStepInto</Action></Function>
<Function><Name>std::move<.*</Name><Action>NoStepInto</Action></Function>
<Function><Name>Platform::EventSource::Invoke.*</Name><Action>NoStepInto</Action></Function>
<Function><Name>IID_PPV_ARGS_Helper<.*</Name><Action>NoStepInto</Action></Function>
<Function><Name>Microsoft::WRL::ComPtr<.*>::operator&</Name><Action>NoStepInto</Action></Function>
<Function><Name>Microsoft::WRL::ComPtr<.*>::operator-></Name><Action>NoStepInto</Action></Function>
<Function><Name>Microsoft::WRL::Details::ComPtrRef.*</Name><Action>NoStepInto</Action></Function>
<Function><Name>operator new</Name><Action>NoStepInto</Action></Function>
<Function><Name>std::.*</Name><Action>NoStepInto</Action></Function>
</StepFilter>
经过测试,这个方法也适用于VS2013,当然default.natstepfilter的文件路径要修改一下
如果需要详细定制StepInto,请查看参考资料
, ,