Is it possible to load mismatched symbols in Visual Studio?

穿精又带淫゛_ 提交于 2019-12-03 11:50:47
Steve Townsend

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.

Sanketh I

Try this utility:

ChkMatch utility can be used to check whether an executable and debug information file match. It can also be used to enforce matching between an executable and debug information file, if they are compatible.

For more information about debug information matching and related issues, see this article.

Supported debug information formats: DBG, PDB 2.0, PDB 7.0...

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.

RED SOFT ADAIR

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.

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