强制Windbg不加载符号

4

我正在对一些软件进行崩溃分析,但我确定没有 sth.exe 的 pdb 文件。但是每当 sth.exe 崩溃时,windbg 每次都会搜索很多路径和符号服务器。即使我断开虚拟机的网络连接,它仍然会花费一些时间来搜索 sth.exe 的 pdb。这导致我的自动分析失败。有没有办法告诉 windbg sth.exe 没有 pdb,请不要浪费时间去搜索它?

1个回答

4

在安装windbg的文件夹中创建一个名为symsrv.ini的文件
此示例中的目录为e:\ewdk\program files\windows kits\10\Debuggers\x86

在该文件中创建一个排除部分,并将所有未知PDB列表添加到其中
这样symsrv就不会搜索它们了

:\>ls -l symsrv.ini
-rw-rw-rw-  1 HP 0 259 2016-08-18 17:43 symsrv.ini

:\>file symsrv.ini
symsrv.ini; ASCII text, with CRLF line terminators

:\>cat symsrv.ini
[exclusions]
livekdD.sys
vmm.pdb
livekdD.pdb
vmci.pdb
vsock.pdb
clwvd.pdb
spldr.pdb
vmkbd.pdb
vmnetsrv.pdb
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

:\>livekd

LiveKd v5.40 - Execute kd/windbg on a live system
Sysinternals - www.sysinternals.com

!sym noisy
noisy mode - symbol prompts off

kd> .reload /f

SYMSRV:  vmci.pdb is in the file exclusion list
DBGHELP: d:\build\ob\bora-1141980\bora-vmsoft\build\release\crosstalk\windows\wi
n2k\i386\vmci.pdb - file not found
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for vmci.sys -
DBGHELP: vmci - export symbols

SYMSRV:  vsock.pdb is in the file exclusion list
DBGHELP: d:\build\ob\bora-1253991\bora-vmsoft\build\release\vsock\windows\win2k\
i386\vsock.pdb - file not found
*** ERROR: Symbol file could not be found.  Defaulted to export symbols for vsock.sys -
DBGHELP: vsock - export symbols

SYMSRV:  vmm.pdb is in the file exclusion list
DBGHELP: m:\src\built\vs2005.sp2\vssp2\usa\ent_volume\i386\sym\sys\vmm.pdb - fil
e not found
*** ERROR: Module load completed but symbols could not be loaded for vmm.sys
DBGHELP: vmm - no symbols loaded

************* Symbol Loading Error Summary **************
Module name            Error
vmci                   The system cannot find the file specified : srv*e:\symbols*
                       http://msdl.microsoft.com/download/symbols The SYMSRV client 
                       failed to find a file in the UNC store, or there is an invalid
                       UNC store (an invalid path or thepingme.txt file is not present
                       in the root directory), or the fileis present 
                       in the symbol server exclusion list.

xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

评论回答:

首先,在windbg帮助文件中有一个设置排除列表的主题。此主题暗示了这个文件(该文件是针对使用symproxy并应在%windowsdir\system32\inetsrv\"处创建,不适用于symsrv.dll(注册表键也似乎不起作用)。

https://msdn.microsoft.com/en-us/library/windows/hardware/ff556870(v=vs.85).aspx

在我的电脑上,我在procmon日志中看到了一个fastio路径中的NameNotFound错误,Windbg安装目录中出现问题,因此我猜测将文件从上述路径移动到Windbg安装目录,结果一切正常,这是很久以前的事情。

enter image description here但后来我在osr windbg列表中看到了jason shay(MSFT)的文章,说明这个功能已经推出windbg 6.4.4 beta版本。

http://www.osronline.com/showthread.cfm?link=68916

因此,这里没有缺少常识,只是角落里的案例总是很难发现。


哇,非常感谢~后来我在Windbg帮助文件中使用关键词“symsrv.ini”找到了它。我想知道你是怎么知道这个的?我已经花费了很长时间在帮助文件中寻找它,但却一无所获。是否有一些基础常识我错过了呢? - occia
嗯,我无法在评论中放置响应,因此我编辑了帖子以获取一些要点。简而言之,这是一个边缘情况,很难预测和计划,因此没有常识缺失。 - blabb

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接