views:

5317

answers:

4

When using WinDbg, where should the private symbol files (pdb?) be placed?

My situation is: I have a DLL which I want to debug. I have the source code and symbol files for this DLL. This DLL is called by another DLL (which I don't have symbols or source for) which, in turn, is called by an EXE (which I also don't have symbols or source for).

My problem is that I am getting a warning that says

*** WARNING: Unable to verify checksum for C:\TheProgram\SomeSubfolder\AnotherSubfolder\MyDll.dll

This warning I think is the reason why I am getting the following type of messages in the call stack:

MyDll!AClass::AFunction+SomeHexAddress

My file structure looks something like this:

The exe: C:\TheProgram\program.exe

The calling dll: C\TheProgram\SomeSubfolder\caller.???

My DLL that I want to debug: C:\TheProgram\SomeSubfolder\AnotherSubfolder\MyDll.dll

Note: I set Symbol File path and the Source file path to where the debug DLL was generated, in my workspace on a different drive from the exe.. But I did copy the pdb + map files and put it on the dll that I wanted to debug..

+2  A: 

One option is to leave the symbol files where they are (i.e. in the build output folder) and then use -y WinDbg command line option to locate these files. Using this approach should guarantee that the symbol files are always be up to date.

From the Microsoft Help:

-y SymbolPath 
Specifies the symbol search path. Separate multiple paths with a 
semicolon (;). If the path contains spaces, it should be enclosed 
in quotation marks. For details, and for other ways to change this 
path, see Symbol Path.
jussij
So how would I use this? type in a command prompt "WinDbg.exe -y BuildOutputFolderHere"?
krebstar
I don't think this works for me..
krebstar
Works for me: windbg.exe -y "SRV*c:\websymbols*http://msdl.microsoft.com/download/symbols"
mhenry1384
Leave out the semicolon at the end. Dunno why StackOverflow keeps adding that.
mhenry1384
+2  A: 
Thanks.. I think it's clear enough..
krebstar
+2  A: 

As part of our build process, we copy the private PDB files and the released EXE/DLL files to a symbol server. At its simplest, this is just a UNC path, but you can configure it for access using HTTP.

To copy your output files, use the SYMSTORE.EXE program.

Then, configure your debugger (we use Visual Studio and WinDbg) to look in that path. For WinDbg, the simplest way to do this is to set an environment variable:

_NT_SYMBOL_PATH=
    SRV*C:\WebSymbols*http://msdl.microsoft.com/download/symbols;
    \\symsvr\Symbols

(that should all be on one line)

This configures WinDbg to look on the Microsoft Symbol Server (caching the files in C:\WebSymbols) and also to look in a local symbol store (\\symsvr\Symbols).

We also use the Source Server tools to store SVN details in the PDB file, meaning that we can get back to the exact source file used to build a particular release. Look in ...\Debugging Tools for Windows (x86)\srcsrv.

Roger Lipscombe
+5  A: 
AaronBa
Thanks.. Can't verify this atm, but good to have for future reference.. :) +1
krebstar