WinDbg can't find microsoft symbols

眉间皱痕 提交于 2019-12-08 07:12:48

问题


I have a simple demo console program to debug but surprisingly windbg can't symbols from Microsoft default store.

I do

.reload /f

I get the summary:

************* 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.

Symbols file path is

srv*

I was trying to get to work with pdf files of my own application but it can't even find microsoft symbols.

Update

After sorting out other issues, I can reproduce this back. It seems like I was just reading the message wrong. Since the error message was pointing to Microsoft default store, I read it like it didn't find the specified files at Microsoft store...thinking it was not connecting/finding/downloading Microsoft symbols when in fact the major error says it just didn't find my own's application's symbols.

Still, the message is not super clear. For example when I set and add an additional path, says Ok.

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

Now when I .reload /f the symbol loading error summary is this:

************* 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

I don't know the why unable to load in the path PDB not found : c:\test\hello\symbols\exe\App.pdb?


回答1:


In the output of your WinDbg session there is

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

so there's a module load error for ConsoleApp, which is your application and not a Microsoft application.

Certainly you have not uploaded the symbols of your application to Microsoft, so the symbols cannot be found on https://msdl.microsoft.com/download/symbols.

It seems to me that your application is

  • either a release build without symbol information at all
  • a debug build with symbol information but the symbols are not found in the path that is specified within the application

Therefore,

  • in addition to the Microsoft symbol server (please use .symfix c:\path\to\microsoft-symbols),
  • make sure you have built PDBs for your application (check your compiler and/or linker settings, depending on the programming language)
  • add your own symbols to the symbol path (.sympath+ c:\path\to\pdb\).
  • .reload the symbols

The syntax srv* is documented, but actually I've never seen someone use it in practice, because people want to benefit from symbols stored locally, which increases the performance.

If it still does not work, use !sym noisy and Process Monitor to troubleshoot loading of the symbols. A file name filter for .pdb should help.

The reason for that is

  • even with !sym noisy, WinDbg does not list all paths where it is actually looking for symbols
  • the documentation for the symbol load order is incorrect.

    The help file says that symbols are loaded in this order

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

    But the load order observed by me is

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



回答2:


what does srv* mean is it all you have got ?
where is the path ?
like say c:\symbols or f:\mycrap\myuselesssymbols etc etc ?

the path should be something like srv*<your LOCAL DIRECTORY>viz X:\yyyyyy*http://msdl.microsoft.com/download/symbols

you can use .symfix to set a default symbol path prior to .reload /f



来源:https://stackoverflow.com/questions/38062216/windbg-cant-find-microsoft-symbols

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!