检索 JIT 输出 [英] Retrieve JIT output

查看:26
本文介绍了检索 JIT 输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有兴趣查看 C# 程序(不是 CLR 字节码指令)的实际 x86 程序集输出.有什么好的办法吗?

I'm interested in viewing the actual x86 assembly output by a C# program (not the CLR bytecode instructions). Is there a good way to do this?

推荐答案

您应该将 WinDbg 与 SOS/SOSEX 一起使用,确保您要查看 x86 代码的方法在方法表中进行了 JIT,然后使用 查看实际反汇编u 命令.这样你就会看到实际的代码.

You should use WinDbg with SOS/SOSEX, ensure that method you want to see x86 code for is JITted in method tables and then see actual unassembly with u command. Thus you would see actual code.

正如这里其他人提到的,使用 ngen 您可以看到与实际 JIT 编译结果不完全匹配的代码.使用 Visual Studio 也是可能的,因为 JIT 的编译在很大程度上取决于调试器是否存在这一事实.

As others mentioned here, with ngen you could see code that is not exactly matches actual JIT compilation result. With Visual Studio it is also possible because JIT's compilation depends heavily on the fact if debugger is present or not.

UPD:一些澄清.WinDbg 也是一个调试器,但它是本机.

UPD: Some clarification. WinDbg is a debugger also, but it is native one.

在这里您可以阅读有关该技术的信息详细.

Here you can read about the technique in detail.

这篇关于检索 JIT 输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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