How do I determine the file and line # of a C# method from a symbols (.pdb) file?
Question
pdb files contain symbol information for .NET assemblies. I'd like to read a pdb file in order to correlate methods with their file location. The data is contained within it but I can't seem to find a good description of how to get it out.
I know about mdbg, but that is very heavy (I think/hope) for what I want.
Solution
You should look:
- Mono.Cecil and especially the Mono.Cecil.Pdb module. It should do what you want and more.
OTHER TIPS
In DBGHELP.DLL, you can use the SymGetLineFromAddr64 function. You'll need to use P/Invoke. There might be a corresponding API in the DIA SDK, but I'm not as familiar with it as I am DBGHELP.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow