如何在编译时从PDB获取StackFrame?
我需要从任何 PDB 获取函数的堆栈框架(所有输入/输出参数及其类型)。我有 PDB 中某个函数的函数名称和地址,有没有办法从 PDB 文件中获取该函数的所有参数(输入/输出)?
这些函数是用非托管代码编写的。
问候,
乌斯曼
I need to get a stack frame 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
你的概念很混乱。 PDB 与任何其他文件一样不包含堆栈或堆栈帧,因为它是在执行期间创建的。 .net exe/dll 包含类的元数据,因此您可以查看方法签名。您可以在代码中获取堆栈帧(google class
StackFrame
/StackFrame
),但仍然无法获得堆栈中的所有数据(例如参数值)。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.
要从转储中提取函数名称、地址和参数类型,您可以使用 dia2dump 程序。它作为调试接口访问 SDK (dia-sdk) 的示例提供。对于 Visual 2008 或 2010,您可以在
C:\Program Files\Microsoft Visual Studio(您的版本)\DIA SDK\Samples\DIA2Dump
下找到它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