WinDbg 找不到微软符号

WinDbg can't find microsoft symbols

我有一个简单的演示控制台程序可以调试,但令人惊讶的是 windbg 无法从 Microsoft 默认存储中获取符号。

我愿意

.reload /f

我得到摘要:

************* Symbol Loading Error Summary ************** 
Module name            Error 
ConsoleApp             PDB not found : cache*
                Unable to locate the .pdb file in this location

                The system cannot find the file specified : SRV*https://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 the pingme.txt file is
                not present in the root directory), or the file is present in the
                symbol server exclusion list.

符号文件路径为

srv*

我试图开始使用我自己的应用程序的 pdf 文件,但它甚至找不到 Microsoft 符号。

更新

在解决了其他问题后,我可以重现这个。好像我只是读错了消息。由于错误消息指向 Microsoft 默认商店,我读它就像它没有在 Microsoft 商店找到指定的文件...认为它不是 connecting/finding/downloading Microsoft 符号,而实际上主要错误说它只是没有'找到我自己的应用程序的符号。

不过,消息不是很清楚。例如,当我设置并添加一个额外的路径时,说好的。

0:000> .sympath srv*c:\test\Symbols*https://msdl.microsoft.com/download/symbols;c:\test\hello
DBGHELP: Symbol Search Path: srv*c:\test\symbols*https://msdl.microsoft.com/download/symbols;c:\test\hello
DBGHELP: Symbol Search Path: srv*c:\test\symbols*https://msdl.microsoft.com/download/symbols;c:\test\hello
Symbol search path is: srv*c:\test\Symbols*https://msdl.microsoft.com/download/symbols;c:\test\hello
Expanded Symbol search path is: srv*c:\test\symbols*https://msdl.microsoft.com/download/symbols;c:\test\hello

************* Symbol Path validation summary **************
Response                         Time (ms)     Location
Deferred                                       srv*c:\test\Symbols*https://msdl.microsoft.com/download/symbols
OK                                             c:\test\hello

现在当我 .reload /f 符号加载错误摘要是这样的:

************* Symbol Loading Error Summary **************
Module name            Error
App                    The system cannot find the file specified : srv*c:\test\symbols*https://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 the pingme.txt file is
                not present in the root directory), or the file is present in the
                symbol server exclusion list.

                       PDB not found : c:\test\hello\symbols\exe\App.pdb
                Unable to locate the .pdb file in this location

我不知道为什么无法在路径 PDB not found : c:\test\hello\symbols\exe\App.pdb 中加载?

srv* 是什么意思,你已经拥有了吗?
路径在哪里?
就像说 c:\symbols 或者 f:\mycrap\myuselesssymbols 等等等等?

路径应该类似于 srv*viz X:\yyyyyy*http://msdl.microsoft.com/download/symbols

您可以在 .reload /f

之前使用 .symfix 设置默认符号路径

在您的 WinDbg 会话的输出中有

************* Symbol Loading Error Summary ************** 
Module name            Error 
ConsoleApp             PDB not found : cache*

因此 ConsoleApp 存在模块加载错误,这是 您的 应用程序,而不是 Microsoft 应用程序。

当然你还没有将你的应用程序的符号上传到微软,所以在https://msdl.microsoft.com/download/symbols.

上找不到这些符号

我觉得你的申请是

  • 完全没有符号信息的发布版本
  • 带有符号信息的调试版本,但在应用程序中指定的路径中找不到符号

因此,

  • 除了微软符号服务器(请使用.symfix c:\path\to\microsoft-symbols),
  • 确保您已为您的应用程序构建 PDB(检查您的编译器 and/or 链接器设置,具体取决于编程语言)
  • 将您自己的符号添加到符号路径 (.sympath+ c:\path\to\pdb\)。
  • .reload 符号

语法srv* is documented,但实际上我从未见过有人在实践中使用它,因为人们希望从本地存储的符号中受益,从而提高性能。

如果仍然不起作用,请使用 !sym noisy Process Monitor 来解决符号加载问题。 .pdb 的文件名过滤器应该会有所帮助。

原因是

  • 即使使用 !sym noisy,WinDbg 也不会列出它实际寻找符号的所有路径
  • 符号加载顺序的文档不正确。

    帮助文件说符号按此顺序加载

    • X:\...\symbols\<ext>\<filename>.pdb
    • X:\...\<ext>\<filename>.pdb
    • X:\...\<filename>.pdb

    但是我观察到的加载顺序是

    • X:\...\<filename>.pdb
    • X:\...\<ext>\<filename>.pdb
    • X:\...\symbols\<ext>\<filename>.pdb