Windows调试符号 - 不加载 [英] Windows Debugging Symbols - Not Loading

查看:633
本文介绍了Windows调试符号 - 不加载的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Windows 7 x64 SP1。我已经下载了符号:



http://msdn.microsoft.com/en-us/windows/hardware/gg463028



我已经下载并安装了x64 RTM和x64 Windows 7 x64 SP1的SP1符号。安装在 T:\Symbols 文件夹中。



但是当我调试64位本地C ++应用程序时,符号将不会加载。例如,对于 ntdll.dll ,PDB位于:




  • T:\Symbols\\\
    tdll.pdb\6192BFDB9F04442995FFCB0BE95172E12

  • T:\Symbols\\\
    tdll .pdb \CFF40300FD804691B73E12CF2A150EE02



但Visual Studio(2008/2010)将不会加载符号。在调试时,从模块视图中,我选择 ntdll.dll 并说出加载符号从 - >符号路径,指定 ntdll.pdb 。对于所提到的路径,它总是会说:


在此文件夹中找不到匹配的符号文件。


我还在中添加了这个文件夹( T:\Symbols )调试 - >选项,但它仍然不会加载符号。调试时,加载所有符号按钮将被启用,点击将不会加载符号!



对于32 - 位于PDB文件名下的 wntdll.pdb ntdll.dll ,并将存储在GUID命名的文件夹中上面提到的时尚但VS不会为32位调试加载符号。



非常有趣(令人沮丧的是),当我选择加载符号从 - > Microsoft符号服务器,它将下载并且完美地加载符号。它将在以下位置下载符号( ntdll 的完整路径):





\Users\。 ..\AppData\Local\Temp\SymbolCache\\\
tdll.pdb\6192BFDB9F04442995FFCB0BE95172E12



这里可以看到GUID与 T:\Symbols 路径中的GUID命名文件夹匹配,但对于手动安装的符号VS是刚性的,不加载它!



对于NTDLL.PDB,尽管相应的文件夹相同,并且PDB的大小也相同,但时间戳可能不同。



有时,VS还会将符号放在:



C:\ .. .\AppData\Local\Temp\SymbolCache\MicrosoftPublicSymbols



如果VS只能从Microsoft Symbols Server下载正确的符号,那么使用本地下载的符号呢?



我的问题基本上是如何加载本地下载和安装的符号?

解决方案

RTM或SP1符号的下载链接几乎没有用处。每个补丁之后,您将获得一个更改的ntdll.dll或其他中央操作系统库。这将使您的旧pdbs无用。因此,您需要从符号服务器下载它们,以确保您是最新的。但是由于并不是所有的DLL都被更改,您应该将Symbol服务器下载缓存设置到您已经解压缩下载的符号的同一位置。



转到:



工具 - 选项 - 调试 - 符号



并为此目录中的缓存符号设置路径。



加载所有符号意味着您加载当前加载的所有模块的所有符号处理。但它不会下载Windows使用的所有dll的所有符号。如果您下载Windbg,您将获得一个名为symchk.exe的工具,该工具允许您递归地下载所有二进制文件的符号。


I am having Windows 7 x64 SP1. I have downloaded symbols from:

http://msdn.microsoft.com/en-us/windows/hardware/gg463028

I have downloaded and installed x64 RTM and x64 SP1 symbols for Windows 7 x64 SP1. Installed on T:\Symbols folder.

But When I debug a 64-bit native C++ application, the symbols would not load at all. For ntdll.dll, for instance, the PDBs are located in:

  • T:\Symbols\ntdll.pdb\6192BFDB9F04442995FFCB0BE95172E12
  • T:\Symbols\ntdll.pdb\CFF40300FD804691B73E12CF2A150EE02

But Visual Studio (2008/2010) will not load symbols. While debugging, from Modules View, I select ntdll.dll and say Load Symbols From -> Symbol Path, the specify the ntdll.pdb. For both of mentioned paths, it will always say:

A matching symbol file was not found in this folder.

I have also added this folder (T:\Symbols) in Debugging -> Options, but it will still not load the symbols. While debugging, Load All Symbols button would be enabled, and clicking would not load the symbol either!

For 32-bit the PDB filename would be wntdll.pdb for ntdll.dll and would be stored in GUID-named folders in fashion mentioned above. But VS will not load symbols for 32-bit debugging either.

Quite interestingly (and frustratingly), when I select Load Symbols From -> Microsoft Symbols Server, it will download and load the symbols perfectly. It will download the symbols at following location (full path for ntdll):

\Users\...\AppData\Local\Temp\SymbolCache\ntdll.pdb\6192BFDB9F04442995FFCB0BE95172E12

Here you can see the GUID is matching with the GUID-named folder in T:\Symbols path, but for manually installed symbols VS is rigid not to load it!

For NTDLL.PDB, despite the respective folder being same, and the size of PDB also being same, the timestamp might be different.

Sometimes VS would also place symbols in:

C:\...\AppData\Local\Temp\SymbolCache\MicrosoftPublicSymbols

If VS would download correct symbols ONLY from Microsoft Symbols Server, then what the use of locally downloaded symbols?

My question is basically how to load locally downloaded and installed symbols?

解决方案

The download links for the RTM or SP1 symbols are pretty much useless. After each patch day you will get a changed ntdll.dll or other central OS libraries. This will render your "old" pdbs useless. You need to download them therefore from the symbol servers to be sure that you are up to date.

But since not all dlls are changed you should set your Symbol server download cache to the same location where you have unpackaged your downloaded symbols.

Go to:

Tools - Options - Debugging - Symbols

and set the path for Cache symbols in this directory.

Load all symbols means that you do load all symbols for all modules that are loaded in your current process. But it will not dowload all symbols for all dlls that are used by Windows. If you do download Windbg you get a tool called symchk.exe which allows you to download the symbols for all binaries recursively.

这篇关于Windows调试符号 - 不加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆