How can I get the GUID from a PDB file?

青春壹個敷衍的年華 提交于 2019-12-23 17:42:47

问题


Does anyone know how to get the GUID from a PDB file?

I'm using Microsoft's Debug Interface Access SDK

http://msdn.microsoft.com/en-us/library/f0756hat.aspx

and getting E_PDB_INVALID_SIG when passing in the GUID i expect when trying to load the PDB.

I'd just like to know the GUID of the PDB so I can be certain that it's mismatching and not just a PDB that's perhaps corrupted somehow.

Is there a tool that can do this? I've tried dia2dump and dumpbin, but with no joy...

Many thanks,

thoughton.


回答1:


There is a Code Project tool called PDB Inspector that should be able to help you. Or if you need to do this programatically essentially you call:

IDiaDataSource::LoadDataFromPdb
IDiaDataSource::openSession
IDiaSession::get_global_scope
IDiaSymbol::get_guid



回答2:


I would use the dbghelp symbol APIs. If all you want is information about the PDB, you can use chkmatch, or heck, just load the dll/exe into WinDbg and use !sym noisy, !lmi or !chksym.

Fixing the PDB to match is a different story! chkmatch can do some of the work, but cannot make age differences match, it only can do timestamps and GUID signatures.




回答3:


an introduction to DIA and its relation to DbgHelp along with a C++ sample. Which is basically the article I wrote after the one mentioned by Paul Arnold.



来源:https://stackoverflow.com/questions/2517791/how-can-i-get-the-guid-from-a-pdb-file

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