Question

I figured out how a .NET assembly .dll file maps to a .pdb using a GUID (blog). When I debug into an assembly and it asks for the source code, if I navigate to a file, it may tell me that the source code is different from the original. How does it know this? I was expecting the .pdb file to contain a checksum for each file, but it doesn't appear to. The best tool I found to dump the debug information is dia2dump. The C++ .pdb files had MD5 entries, but the C# .pdb files did not.

C++ dump
dia2dump -f dia2dump.pdb > dia2dump.pdb.files.txt

C# dump
dia2dump -f Autofac.pdb > Autofac.pdb.files.txt
dia2dump -all Autofac.pdb > Autofac.pdb.all.txt

Is there something I missed in the "all" dump?

It has got to be using a checksum. If I change a single character in Module.cs, I get:
enter image description here

Where do I find the checksum for a source file referenced in a .pdb?

Était-ce utile?

La solution

An MD5 checksum is stored in the .pdb file for each source file. If you answer "No" to the question above "Would you like the debugger to use it anyway?", it prints out the checksum it was looking for:

enter image description here

Using a hex editor, you can see it is definitely in the .pdb. My next task is to figure out how to get access to it programatically. For a .pdb file, I want it to return all source file names and their MD5 checksums.

enter image description here

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top