How to get StackFrame at compile time from PDB?
I need to get a stack fra开发者_如何转开发me of a function from any PDB (All in/out arguments and their types). I have the function name and address of a certain function from PDB, is there a way to get all of the parameters (in/out) of that function from the PDB file?
The functions are written in unmanaged code.
Regards,
Usman
You have a mess of concepts. PDB as any other file doesn't contain stack or stack frames, because it is something that is created during execution. .net exe/dll contains metadata for classes so you can peek at methods signature. You can get stack frames in your code (google class StackFrame
/StackFrame
) but still you can't all data from the stack like parameters values.
It is not possible to get a stack frame at compile time. The stack is a run time concept.
To extract function names, address and arguments types from a dump, you can use the dia2dump program. It is available as a sample of the Debug Interface Access SDK (dia-sdk). You can find it with Visual 2008 or 2010 under C:\Program Files\Microsoft Visual Studio (your version)\DIA SDK\Samples\DIA2Dump
精彩评论