为什么不缓存 ntdll.dll 的 pdb

Why isn't pdb for ntdll.dll cached

我在 Visual Studio Community 2013 下开发 C++。它是 C++/Win32 项目而不是 UWP,它是 运行 作为 Debug/x64 平台。

我的配置是:

Tools -> Options -> Debugging -> Symbols -> All module, unless excluded
Tools -> Options -> Debugging -> Symbols -> Cache symbol in this directory 

缓存符号目录包含一堆 *.pdb 个文件并且从未被触及。

问题: 当我 运行 调试器偶尔会收到有关联系 MS 符号服务器下载 ntdll.dll 和一些其他文件的消息,我猜这些文件与系统相关,因为我不认为它们是我项目的一部分。

为什么要下载 ntdll.dllThis 文章说:

Some common reasons symbols aren’t loaded include:

  1. Symbol paths don’t point to the correct location
  2. The symbol file is from a different version of the module than the one loaded in the process - Visual Studio requires that the symbol file come from the exact same build as the module. It cannot load symbols that come from a different build even if the source code was identical

我还没有重建 ntdll.dll,我怎么可能?这是不可能的,因为它是 Windows 内核的一部分,所以为什么要一次又一次地下载 ntdll.dll 的调试符号而不是缓存它?

编辑:

当我 运行 调试 (F5) 然后在 Debug -> Windows -> Output 下,我看到以下行:

'MyProject.exe' (Win32): Loaded 'C:\Windows\System32\ntdll.dll'. Loading disabled by Include/Exclude setting.

Debug -> Windows -> Modules 的输出:

ntdll.dll   C:\Windows\System32\ntdll.dll   N/A No  Loading disabled by Include/Exclude setting.        2   10.0.14393.447 (rs1_release_inmarket.161102-0100)   11/2/2016 11:13 AM  00007FFFDF410000-00007FFFDF5E1000   [12772] MyProject.exe       

正如我所说,它偶尔会发生,所以我不知道如何准确地重现它。似乎在过去它正在工作并且 ntdll.dll 不再从 MS 服务器下载。我无法将 x64 更改为 x86,因为我们的项目没有 运行 on x86.

我的 C:\Users\wakatana\AppData\Local\Temp\SymbolCache 包含以下 folders/files(我猜一个可能用于 x86,另一个用于 x64,但我不确定):

ntdll.pdbC94DD545BD4FCBA2E8F404185B97DC1\ntdll.pdb
ntdll.pdbA5329C3B1E425FAA9519DA285D8DA71\ntdll.pdb

是否可以明确告诉 VS 在 C:\Users\wakatana\AppData\Local\Temp\SymbolCache 中为所有新项目使用已经缓存的 ntdll.dll 版本,或者默认的 VS 行为是什么?

我的 OS 是 Windows10 有最新更新的主页

这将与这个特定的程序集有关。

如果我使用 X86 目标,我将获得 wntdll.pdb 文件。

如果我使用 X64 目标,我会得到 ntdll.pdb 文件,但像你的一样,它们都在 temp\SymbolCache 文件夹中。我还在 X64 目标中获得了信息 "source information stripped messages"。 TOOLS->Options->Debugging->Symbols下的默认符号文件夹中确实没有pdb文件。

因为我遇到了和你一样的问题,所以我向产品团队提交了连接报告:

https://connect.microsoft.com/VisualStudio/feedbackdetail/view/3113479/why-isnt-pdb-for-ntdll-dll-cached

您也可以添加您的评论并投票。