views:

197

answers:

3

Hello,

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  A: 

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.

pj4533
+2  A: 

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

Paul Arnold
A: 

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.

marc ochsenmeier