views:

78

answers:

4

I've got a Windows minidump (C code) and a corresponding exe file. Unfortunately, I don't have the exact matching .pdb files, but I do have .pdbs that contain the exact same code just built at a different time. In Windbg, I can use:

.symopt+0x40

To tell it to load anything, even mismatched symbol files. This works great in this particular instance, and I'm able to get a proper call stack. I'm just curious as to whether or not Visual Studio has any such feature. We use pretty much every different version of VS here, so it doesn't matter which version it might be in. Thanks.

A: 

According to this post its possible to use sos windbg commands as well in visual studio. But i am not sure if ".symopt" also falls into this category.

RED SOFT ADAIR
A: 

Try this utility:

http://www.debuginfo.com/tools/chkmatch.html

Sanketh I
A: 

There is no override, but the poster to this question found a way to modify the PDB files to make them match the EXE.

Thanks to one of the comments on the first answer, I checked out a link to the pdfs of the book "Undocumented Windows 2000 Secrets: A Programmers Cookbook". And the author goes into great detail about the pdb file format. As I said before, I had already loaded the pdb into a hex editor and flipped some bits around appearing that I made the age/signature match, but it didn't work. Well, after using the utility from the W2k secrets book to "explode" the pdb into the included streams, I found out that they hide another reference to the age in stream 3!!!!!!! Once I flipped that one as well, it matched up in windbg.

Not sure if you want to go to this much trouble, but it looks like it can be done. If this is for production support then it could be worth your while.

Steve Townsend
A: 

Visual Studio and Windbg match pdbs by comparing the timestamps in the Executable header with timestamps store in the pdb file. You can view the timestamp by running dumpin /headers .

I haven't used chkmatch but modifying either the exe or pdb to match each other should work fine.

Be aware that this technique may not be enough to debug your binary. John Robbins in his book 'Debugging Windows' (which I can recommend) mentions that he's seen different build results from the identical source tree built at almost identical times.

Always build pdb symbols with your builds (including release builds) and archive them alongside the build products and include the .map file for good measure.

persiflage