简体   繁体   English

为什么VS 2012 C#的反汇编窗口显示x64汇编而不是IL?

[英]Why is the Disassembly Window of VS 2012 C# Showing x64 Assembly Rather Than IL?

When I use the disassembly window of Visual Studio 2012 for a C# project, I expect to see IL code. 当我将Visual Studio 2012的反汇编窗口用于C#项目时,我希望看到IL代码。 But it shows x64 assembly. 但它显示了x64汇编。 Is this caused by the jitter? 这是由抖动引起的吗? The assembly below is a portion of the assembly code disassembled. 下面的程序集是反汇编代码的一部分。

        public static void Main() {
00000000  sub         rsp,1C8h 
00000007  xor         eax,eax 
00000009  mov         qword ptr [rsp+60h],rax 
0000000e  mov         qword ptr [rsp+58h],rax 
00000013  mov         qword ptr [rsp+50h],rax 
00000018  mov         qword ptr [rsp+38h],rax 
0000001d  mov         qword ptr [rsp+30h],rax 
00000022  mov         qword ptr [rsp+28h],rax 
00000027  mov         qword ptr [rsp+20h],rax 
0000002c  xor         eax,eax 
0000002e  mov         dword ptr [rsp+4Ch],eax 
00000032  mov         dword ptr [rsp+48h],eax 
00000036  mov         dword ptr [rsp+44h],eax 
0000003a  mov         dword ptr [rsp+40h],eax 
0000003e  mov         rax,7F8786239C0h 
00000048  mov         eax,dword ptr [rax] 
0000004a  test        eax,eax 
0000004c  je          0000000000000053 
0000004e  call        000000005FA4647C 

The current C# .NET debugger always shows the native code for methods (at least for x86 and x64). 当前的C#.NET调试器始终显示方法的本机代码(至少对于x86和x64)。 This is the code produced from the IL by the JIT. 这是JIT从IL生成的代码。 If you want to see the IL for a method, I recommend taking a look at ILSpy . 如果要查看方法的IL,建议查看ILSpy

The dissembly window looks at the code which is running directly on the processor. 反汇编窗口查看直接在处理器上运行的代码。 Hence it will show assembler and not IL. 因此它将显示汇编程序而不显示IL。

If you want to see the raw IL of a C# method then look at a tool like ildasm or reflector 如果要查看C#方法的原始IL,请查看ildasm或反射器之类的工具

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 / platform开关对x64窗口中C#汇编的影响 - Effects of /platform switch on C# assembly in x64 windows 如何在 C# 中调用 x64 汇编程序 - How to call a x64 Assembly procedure in C# VS2012如何将C#的AnyCPU配置的输出目录设置为各个解决方案配置的x86和x64文件夹? - VS2012 How to set output directory for C#'s AnyCPU configuration to x86 and x64 folders for respective solution configs? 用于C#的X86 / X64编译程序集 - Compiling assembly for X86/X64 for use with C# x86和x64 .NET Framework库的IL是否有区别? - Is there any difference in the IL of x86 vs x64 .NET Framework libraries? VisualStudio C#x64,为什么AddReference选项,.NET选项卡指向x86 DLL而不是x64? - VisualStudio C# x64, why AddReference option, .NET tab points to x86 DLL instead of x64? 在64位计算机上基于AnyCPU vs x64平台构建的C#应用​​程序的性能 - Performance of a C# application built on AnyCPU vs x64 platform on a 64 bit machine C#在x64上崩溃 - C# Crash on x64 sgen.exe x64 .net c#失败,“程序集格式不正确” - sgen.exe x64 .net c# fails with “assembly with an incorrect format” 在VS2010中针对x86和x64处理器编译C#项目 - Compile a C# project in VS2010 both for x86 and x64 processors
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM