I am trying to read debug data from a pdb file, specifically the debug data for windows system libraries such as kernel32.dll, where the .pdb was provided by the microsoft symbol store.
where c:\sym\ is my local symbol cache.
I have fired up windbg and loaded some random file to populate the smybol cache, and i now have the public symbols for a lot of windows libraries in c:\sym\
Microsoft provides a very nice example for working wiht pdb files, to be found here: C:\Program Files\Microsoft Visual Studio 9.0\DIA SDK\Samples\DIA2Dump\
(MSVS needs to be installed....)
SO i compiled that example and tried it on itself:
Code:
example.exe -all Debug\example.exe.
And sure enough it worked and spit out quiet some info.
Next thing i tried was to load a system lib:
Code:
example.exe -all c:\windows\system32\kernel32.dll
But that failed with this error:
loadDataForExe failed - HRESULT = 806D0005
which stands for "PDB_NOT_FOUND" (or similar). Great.
So i copied kernel32.dll and kernel32.pdb from c:\sym\...\ to c:\, ran -all c:\kernel32.dll again and - poof - it worked!
Although that environemnt variable should really be enough, i tried passing my cache-path directly to the function mentioned in an above error:
Which leaves me with the questions:
==> why wont it read the debugging data, unless it's in the same directory?
I am left feeling a little stupid for having to copy the dll + it's pdb into a temp directory, running the command, then deleting them again.
But maybe that's just what developing for MS Windows feels like.
edit:
resolved the access issue. kernel32.dll had been deleted from my %windir%. Dont ask me how, or why a direct CreateFIle() call succeeded...
Last edited by tuli; February 25th, 2013 at 11:51 AM.
Dear microsoft, if you feel the urge to use technology as broken and unmaintainable as the DIA, please at least make sure the basic and most frequently used tasks actually work.
And when you fail to do so and a customer complains, please fix it, for god s sake.
Bookmarks