Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Debugging Symbols - Not Loading

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):

enter image description here

\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?

like image 906
Ajay Avatar asked Aug 21 '11 06:08

Ajay


People also ask

Why are my breakpoints not working?

If a source file has changed and the source no longer matches the code you're debugging, the debugger won't set breakpoints in the code by default. Normally, this problem happens when a source file is changed, but the source code wasn't rebuilt. To fix this issue, rebuild the project.

How do you load symbols?

Attempts to load symbols from locations specified on the Options > Debugging > Symbols page. If the symbol file is not found or not loaded, launches File Explorer so you can specify a new location to search.

How do I load a WinDbg symbol?

To use the symbols for debugging, we need to tell windbg which directories it should look into, to find the symbols. To do this, click on File menu and then Symbol File Path. You can enter the path as shown in the below image. The symbol path in this example is srv*c:symbols*//msdl.microsoft.com/download/symbols.

How do I enable Windows debugging?

To enable boot debugging, use the BCDEdit /bootdebug command and specify the appropriate boot component. If you wish to perform kernel debugging after Windows starts, use the BCDEdit /debug command as well. You must also select a debugging connection, just as in normal kernel debugging.


1 Answers

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.

like image 82
Alois Kraus Avatar answered Sep 20 '22 01:09

Alois Kraus