如何查看 .net JITer 生成的机器代码的反汇编?
如何查看 .net JITer 生成的机器代码的反汇编? 找不到“显示反汇编窗口”菜单选项。 甚至它的工具栏按钮也处于禁用状态。 如果我没记错的话,确实可以看到反汇编,但必须诉诸某种技巧,不幸的是我不记得那个技巧是什么。 有人可以在这里提供一些指示吗?
调试环境:VS2008(我猜你可以在 WinDbg 和一些调试器扩展(SOS.dll?)中轻松地看到反汇编。嗯,现在我认为 VS2008 中也可能使用相同的 dll,让我检查一下并回复你。如果我错了,请随时纠正我。)
How do I see a disassembly of the machine code generated by the .net JITer? The Show disassembly window menu option is no where to be found. Even the tool bar button for it is in the disabled state. If I recall correctly the disassembly can indeed be seen but one must resort to some trick, unfortunately I don't remember what that trick was. Can someone please provide some pointers here?
Debugging environment: VS2008 (I guess you can see the disassembly without much pain in WinDbg and some debugger extention (SOS.dll?) Hmm, now I think that same dll may also be used in VS2008 let me check and get back to you. Please feel free to correct me if I am wrong.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 VS2008 Team System Developer Edition 的 C# 项目中,反汇编窗口对我来说运行良好。
实际上 - 有一件事没有像我希望的那样工作 - 我无法进入框架代码。 也许某个地方有一些设置可以让我这样做,我不知道。 但我可以很好地对我自己的代码进行反汇编。
您使用的是 VS2008 Express 吗? 也许这有一些限制。
总是有 cordbg(哎呀!)。
当然,JITer 在调试器下运行时会生成未优化的代码。 您可能可以跳过一些环节来避免这种情况,例如在 JIT 完成您想要查看的任何内容后附加到流程。
The Disassembly window is working fine for me in a C# project in VS2008 Team System Developer Edition.
Actually - there's one thing that's not working as I would have hoped - I can't step into Framework code. Maybe there's some setting somewhere that might let me do that, I don't know. But I can step throiugh the disassembly for my own code just fine.
Are you using VS2008 Express? Maybe that has some limitation.
There's always cordbg (yikes!).
Of course, the JITer will generate non-optimized code when run under a debugger. There may be some hoops you can jump through to avoid this - like attaching to the process after the JIT has done its work for whatever you want to look at.
您好,不幸的是,显示调试窗口命令仍然无法工作,但您可以使用名为 SOS.dll 的调试器扩展 dll 来调试/反汇编 .net 代码,这里有一些链接(请注意,这适用于 VS2008 和 WinDbg)...
1 ) MSDN:SOS 调试扩展 (SOS.dll)
2) 有关将 SOS 与 Windbg 结合使用的一些常规技巧
Hi unfortunately the show debug window command is still not working but you can get by with a debugger extention dll called SOS.dll to debug/disassemble .net code here are a few links (note this works with VS2008 and WinDbg)...
1) MSDN: SOS Debugging Extension (SOS.dll)
2) Some general tips on using SOS with Windbg
似乎对我来说工作得很好。 您是否启用了地址级调试?
工具| 选项| 调试| 一般| 启用地址级调试?
要获取反汇编窗口,请转到“调试”|“反汇编”窗口。 窗户 | 反汇编(我使用的是 c# 开发人员配置文件)
或者在命令行窗口中键入 Debug.Dissassemble
Seems to be working fine for me. Do you have Address Level debugging enabled?
Tools | Options | Debugging | General | Enable Address Level Debugging?
To get the dissassembly window, go to Debug | Windows | Dissassembly (I'm using the c# developer profile)
Or, in the Command Window, type Debug.Dissassembly