Discussion:
dbghelp api and enumerating object files.
(too old to reply)
bob
2004-10-14 10:19:05 UTC
Permalink
Is it possible to enumerate object files for a given binary + PDB.

You can enumerate symbols, source files, what about object files?

Thanks
Oleg Starodumov
2004-10-15 09:58:12 UTC
Permalink
Post by bob
Is it possible to enumerate object files for a given binary + PDB.
You can enumerate symbols, source files, what about object files?
I don't know how to do it with DbgHelp (it looks like it is not possible),
but you can do it with DIA.

There is Compiland symbol (child of the global scope Exe symbol),
which contains the needed information:
http://msdn.microsoft.com/library/en-us/diasdk/html/vsgrfCompiland.asp

You can start with Dia2Dump sample (DumpLex function in particular,
plus Dump function until the place where it obtains the "global scope" symbol)
http://msdn.microsoft.com/library/en-us/diasdk/html/vssamSample.asp

Regards,
Oleg
Jonathan Arnold
2004-10-15 12:30:33 UTC
Permalink
Post by Oleg Starodumov
I don't know how to do it with DbgHelp (it looks like it is not possible),
but you can do it with DIA.
Am I correct in assuming, based upon a search of MSDN, that the DIA is
only available to Enterprise VS.NET users? Is it on any version of MSDN?
--
Jonathan Arnold
inSORS
Pat Styles
2004-11-11 00:58:50 UTC
Permalink
From DbgHelp, call SymSearch with SymTagCompiland and you will get the
objects enumerated...

rc = SymSearch(hp, base, 0, SymTagCompiland, param, 0, cbEnumObjs, NULL,
0);

.pat styles
Post by Oleg Starodumov
Post by bob
Is it possible to enumerate object files for a given binary + PDB.
You can enumerate symbols, source files, what about object files?
I don't know how to do it with DbgHelp (it looks like it is not possible),
but you can do it with DIA.
There is Compiland symbol (child of the global scope Exe symbol),
http://msdn.microsoft.com/library/en-us/diasdk/html/vsgrfCompiland.asp
You can start with Dia2Dump sample (DumpLex function in particular,
plus Dump function until the place where it obtains the "global scope" symbol)
http://msdn.microsoft.com/library/en-us/diasdk/html/vssamSample.asp
Regards,
Oleg
Oleg Starodumov
2004-11-11 11:01:16 UTC
Permalink
Post by Pat Styles
From DbgHelp, call SymSearch with SymTagCompiland and you will get the
objects enumerated...
rc = SymSearch(hp, base, 0, SymTagCompiland, param, 0, cbEnumObjs, NULL,
0);
Yes, it works. Thanks!

Regards,
Oleg

Loading...