Windbg加载symbol过慢

Windbg越来越慢了,随便attach到一个.net进程后,Windbg都会花上3到5分钟来加载symbol, 比如ntdll.dll, mscoreei.dll等,而且期间cpu(双核)的使用率维持在50%左右.

会不会是因为Windbg每次都从symbol server上下载需要的pdb?在尝试把Windbg的Symbol Search Path设置到本地的symbol cache文件夹后,问题依旧.

最终,从这里找到了线索:如果我们设置了过多的"无条件断点"(unqualified breakpoints),并且把这些断点信息保存在了缺省workspace中.这些断点的存在会使得Windbg花费额外的时间去加载暂时用不到的module,同时也会强制Windbg去把所有未解析的断点和所有加载进来的module进行匹配,所以,不论你debug的程序多么小,Windbg都会花费很长的时间去加载symbol.

解决方法很简单,打开Windbg,选择Debug-->Breakpoints (或者Alt+F9),在弹出的对话框里清除所有的断点,保存当前workspace.

HOHO~现在Windbg一瞬间就把symbol都load进来了,不过,看起来版本需要更新了:)

 

Microsoft (R) Windows Debugger Version 6.12.0001.591 X86
Copyright (c) Microsoft Corporation. All rights reserved.


***** WARNING: Your debugger is probably out-of-date.
*****          Check http://dbg for updates.

*** wait with pending attach
Symbol search path is: symsrv*symsrv.dll*D:/Workspace/Symbols*//symbols/symbols
Executable search path is:
ModLoad: 002f0000 002f8000   D:/Workspace/Projects/ConsoleApplication6/ConsoleApplication6/bin/Debug/ConsoleApplication6.exe
ModLoad: 77190000 772cc000   C:/Windows/SYSTEM32/ntdll.dll
ModLoad: 6e6a0000 6e6ea000   C:/Windows/SYSTEM32/MSCOREE.DLL
ModLoad: 76cd0000 76da4000   C:/Windows/system32/KERNEL32.dll
ModLoad: 75500000 7554a000   C:/Windows/system32/KERNELBASE.dll
ModLoad: 75ca0000 75d40000   C:/Windows/system32/ADVAPI32.dll
ModLoad: 75d90000 75e3c000   C:/Windows/system32/msvcrt.dll
ModLoad: 77300000 77319000   C:/Windows/SYSTEM32/sechost.dll
ModLoad: 75880000 75921000   C:/Windows/system32/RPCRT4.dll
ModLoad: 6e5f0000 6e656000   C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscoreei.dll
ModLoad: 75c30000 75c87000   C:/Windows/system32/SHLWAPI.dll
ModLoad: 75d40000 75d8e000   C:/Windows/system32/GDI32.dll
ModLoad: 757b0000 75879000   C:/Windows/system32/USER32.dll
ModLoad: 772d0000 772da000   C:/Windows/system32/LPK.dll
ModLoad: 770f0000 7718d000   C:/Windows/system32/USP10.dll
ModLoad: 772e0000 772ff000   C:/Windows/system32/IMM32.DLL
ModLoad: 75e40000 75f0c000   C:/Windows/system32/MSCTF.dll
ModLoad: 63360000 638f1000   C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorwks.dll
ModLoad: 70ea0000 70f3b000   C:/Windows/WinSxS/x86_microsoft.vc80.crt_1fc8b3b9a1e18e3b_8.0.50727.4927_none_d08a205e442db5b5/MSVCR80.dll
ModLoad: 75f10000 76b59000   C:/Windows/system32/shell32.dll
ModLoad: 76b60000 76cbc000   C:/Windows/system32/ole32.dll
ModLoad: 752e0000 752eb000   C:/Windows/system32/profapi.dll
ModLoad: 61c00000 626f8000   C:/Windows/assembly/NativeImages_v2.0.50727_32/mscorlib/8c1770d45c63cf5c462eeb945ef9aa5d/mscorlib.ni.dll
ModLoad: 75260000 7526c000   C:/Windows/system32/CRYPTBASE.dll
ModLoad: 700e0000 7013b000   C:/Windows/Microsoft.NET/Framework/v2.0.50727/mscorjit.dll
(11c8.155c): Break instruction exception - code 80000003 (first chance)
eax=7ffdc000 ebx=00000000 ecx=00000000 edx=7722d23d esi=00000000 edi=00000000
eip=771c3540 esp=03ecfb30 ebp=03ecfb5c iopl=0         nv up ei pl zr na pe nc
cs=001b  ss=0023  ds=0023  es=0023  fs=003b  gs=0000             efl=00000246
ntdll!zzz_AsmCodeRange_End:
771c3540 cc              int     3

   

 

阅读更多
上一篇在.NET代码里调用Network Monitor API.
下一篇创建免注册(Registration Free)COM
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭