-1

I'm developing C++ under Visual Studio Community 2013. It is C++/Win32 project not UWP and it is run as Debug/x64 platform.

My config is:

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

Cache symbol directory contains bunch of *.pdb files and it was never touched.

Problem: When I run debugger occasionally I get message about contacting MS symbol server to download ntdll.dll and some other files which are I guess system related because I do not recognize them as a part of my project.

Why is ntdll.dll being downloaded? This article says:

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

I haven't rebuild ntdll.dll, how could I? It is not possible because it is part of Windows kernel, so why download debug symbols for ntdll.dll again and again instead of caching it?

Edit:

When I run debug (F5) then under Debug -> Windows -> Output I see following line:

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

Output of 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       

As I said it happens occasionally so I do not know how exactly I can reproduce this. Seems that in the past time it is working and ntdll.dll is not downloaded from MS servers anymore. I cannot change x64 to x86 because our project does not run on x86.

My C:\Users\wakatana\AppData\Local\Temp\SymbolCache contains following folders/files (I guess one might be for x86 and another for x64 but I'm not sure):

ntdll.pdb\41C94DD545BD4FCBA2E8F404185B97DC1\ntdll.pdb
ntdll.pdb\77A5329C3B1E425FAA9519DA285D8DA71\ntdll.pdb

Is it possible to explicitly tell VS to use already cached version of ntdll.dll in C:\Users\wakatana\AppData\Local\Temp\SymbolCache for all new projects or what is the default VS behavior?

My OS is Windows10 Home with latest updates

Wakan Tanka
  • 7,542
  • 16
  • 69
  • 122
  • I have just disabled the symbol server and accept the warnings about missing pdb files. Although I would like to see an answer that solves this pain. – drescherjm Nov 07 '16 at 21:52
  • 1
    You'll have to document your question better. With the debugger attached, use Debug > Windows > Modules. Right-click ntdll.dll in the list and select "Symbol Load Information". Copy/paste the content of the box into your question. And mention your Windows version. – Hans Passant Nov 08 '16 at 01:01
  • @WakanTanka, can you tell me which project type you debug? Whether this dll file was really downloaded from the symbols server during you debug your app every time? As far as I know it has some limitation for windows 10 home version for certain apps like UWP or others, so whether your app run normally if you execute it with "start without debugging", please change the debug/release platform target like X86/x64 installed of the Any CPU, how about the result? – Jack Zhai Nov 14 '16 at 12:04
  • @Wakan Tanka, in your debug mode window, do you get the message "source information stripped messages" for this dll file? https://social.msdn.microsoft.com/Forums/vstudio/en-US/f2732d89-f67b-4af1-8565-eaa2b5785bcd/symbols-loaded-source-information-stripped?forum=vsdebug – Jack Zhai Nov 24 '16 at 08:33
  • 1
    @JackZhai-MSFT I've updated OP – Wakan Tanka Nov 24 '16 at 08:56

1 Answers1

0

It would be related to this specific assembly.

If I use the X86 Target, I will get the wntdll.pdb file.

enter image description here

If I use the X64 target, I will get the ntdll.pdb file, but like yours, they are all in temp\SymbolCache folder. I also get the information "source information stripped messages" in X64 target. It really has no the pdb file in the default symbol folder under TOOLS->Options->Debugging->Symbols.

enter image description here

Since I got the same issue as yours, I submitted a connect report to the product team:

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

You could also add your comment and vote it.

Jack Zhai
  • 6,230
  • 1
  • 12
  • 20