Mismatched PDBs — Why?


If you are developing software, most likely you have encountered the “mismatched pdbs” debugger error. It usually happens when you point the debugger to the wrong symbol path.


But there are times you are confident that the symbols you point to are the correct symbols, and it left you wondering why the debugger believes the symbols do not match.


!sym noisy” will tell you how the windows debugger searches for symbols, and report mismatched pdbs when encountered, but it does not tell you why the symbols do not match.


The answer is in a debugger extension !itoldyouso.


0:000> !itoldyouso


!IToldYouSo <module> [symbol]


!IToldYouSo tests the validity of a module against a symbol file.
The module can be specified by either its name or base address.
If a symbol file is not specified, then the loaded symbol is tested.
Otherwise, if a pdb or dbg symbol file path is specified, it is tested
against the loaded module.



0:000> !itoldyouso foo c:\temp\foo.pdb


C:\temp\foo.dll
    Timestamp: 4549BCD2
  SizeOfImage: BF000
          pdb: foo.pdb
      pdb sig: 18D24151-2AA3-4917-9980-58CB02F5E5F9
          age: 2


foo.pdb
      pdb sig: 18D24151-2AA3-4917-9980-58CB02F5E5F9
          age: 2


MATCH: foo.pdb and C:\temp\foo.dll


0:000> !itoldyouso foo c:\temp\foo1.pdb


C:\temp\foo.dll
    Timestamp: 4549BCD2
  SizeOfImage: BF000
          pdb: foo.pdb
      pdb sig: 18D24151-2AA3-4917-9980-58CB02F5E5F9
          age: 2


foo.pdb
      pdb sig: 4B81E62F-84A3-4864-8ADF-8AD0F9EFEEDB
          age: 2


MISMATCH: foo.pdb and C:\temp\foo.dll

Comments (5)

  1. Norman Diamond says:

    Question 1.

    > 0:000> !itoldyouso foo c:tempfoo1.pdb

    > MISMATCH: foo.pdb and C:tempfoo.dll

    Why isn’t it MISMATCH: foo1.pdb and C:tempfoo.dll?

    Question 2.

    When Visual Studio 2005’s debugger says there’s a mismatch between the .cpp file that it just finished compiling and the .cpp file where the user tried to set a breakpoint, is there an itoldyouso to find why the .cpp file doesn’t match itself?

  2. Norman Diamond says:

    Sorry, my second question needs a correction.  Is there an itoldyouso to find why the .cpp file doesn’t match the .dll that resulted from compiling that .cpp and is now being executed?

  3. junfeng says:

    The first question: It is a copy&paste error:)

    The second question: No I don’t know. I am one of those guys that don’t use VS.

  4. Yuhong Bao says:

    BTW, what is the story behind the name !IToldYouSo?

  5. junfeng says:

    I have no idea.