Wintellect Blogs

Does That PDB File Match the Binary?

28 Jun , 2011  

While you should always have your PDB files in symbol servers, there are times when you’re doing private (aka local) builds and moving those builds around hither and yon in a test environment where you can accidentally forget to copy over a binary’s PDB file. That leads to the common question: short of starting a debugger, how can I check that a PDB file matches a particular binary?

Obviously you can always take an educated guess if a PDB file matches a binary from the timestamp. That will work in most cases, but to completely check, you’ll need to rely on SYMCHK.EXE, a command line tool that comes with the Debugging Tools for Windows (AKA WinDBG). The trick is to tell SYMCHK.EXE to use the PDB file directory as your symbol server. In the following example, I’m running the SYMCHK.EXE command from the same directory where my binary, RinjPlay.exe is located.

symchk RinjPlay.exe /s .\

If the PDB matches the binary, you’ll see the following output.

SYMCHK: FAILED files = 0


If the PDB does not match, your output will look like the following.

SYMCHK: RinjPlay.exe        FAILED   – RinjPlay.pdb mismatched or not found

SYMCHK: FAILED files = 1


As with any SYMCHK.EXE command, you can pass /v to get detailed output about your binary and PDB file matching.

  • Interesting Finds: June 28, 2011

  • Anonymous

    Wow really good info there. Thanks 🙂

  • Hi John,
    I’ve written an assembly and .pdb inspector that extracts the GUIDS (among many other things), that allows you to visually compare the PDB GUID to see if it matches. Hopefully, I’ll have it “polished enough” for posting on my blog and probably on CodePlex in the next month or two. If you’re interested, I’ll ping you back and give you the URL.
    Let me know.

  • Hi John,
    Thanks for your posts about debugging! I think they are really helpful.
    Wanted to share another method of how to detect PDB file mismatch. It is possible to do with ‘dumpbin.exe’ utility that comes with Visual Studio. The trick is simple: use /PDBPATH option ( with dumpbin utility in the same folder where binary and PDB reside. The result will be like this:
    >> dumpbin /PDBPATH:VERBOSE wargame.exe
    Microsoft (R) COFF/PE Dumper Version 8.00.50727.762
    Copyright (C) Microsoft Corporation. All rights reserved.
    Dump of file wargame.exe
    PDB file ‘C:\Users\Andrew\Development\EclipseWorkspace\wg2k\dist\wargame.pdb’ checked. (PDB age mismatch)
    I have also found another utility that can do the trick:
    Best Regards,