如何调试IL code运行时生成使用Reflection.Emit的 [英] How do I debug IL code generated at runtime using Reflection.Emit

查看:184
本文介绍了如何调试IL code运行时生成使用Reflection.Emit的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想产生一些code在使用DynamicMethod的类在Reflection.Emit的命名空间中运行,但由于某种原因,它抛出一个VerificationException。这里是IL code我想使用...

I am trying to generate some code at runtime using the DynamicMethod class in the Reflection.Emit namespace but for some reason its throwing a "VerificationException". Here is the IL code I am trying to use...

ldarg.1
ldarg.0
ldfld, System.String FirstName
callvirt, Void Write(System.String)
ldarg.1
ldarg.0
ldfld, System.String LastName
callvirt, Void Write(System.String)
ldarg.1
ldarg.0
ldfld, Int32 Age
callvirt, Void Write(Int32)
ret

我需要一种方法来调试产生IL code。我有什么选择?我使用VS2008专业。

I need a way to debug the generated IL code. What options do I have? I am using VS2008 professional.

推荐答案

我已经发现了一些更多的帮助,在这里...

I have found some more help here...

DebuggerVisualizer为DynamicMethod的(让我看看IL)这是一个调试器使用可视化,你就可以看到生成的IL在运行!

DebuggerVisualizer for DynamicMethod (Show me the IL) It's is a debugger visualizer using which you will be able to see the generated IL at runtime!

和更好的是调试LCG 它可以调试生成的code在运行时使用的Windbg!

And even better is Debugging LCG which allows you to debug the generated code at runtime using Windbg!

这篇关于如何调试IL code运行时生成使用Reflection.Emit的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆