查看C#通过JIT生成的机器代码

《Pro .NET Memory Management》第4章 Sample Program in Depth小节有讲。

先从应用商店下载Windbg
然后设置高级启动变量
• Executable: C:\Program Files\dotnet\dotnet.exe
• Arguments: \HelloWorld.dll
• Start directory: C:\Projects\HelloWorld\bin\Release\net6.0

下断点
bp coreclr!EEShutDown

加载符号
.loadby sos coreclr

查看函数信息
!name2ee *!HelloWorld.Program.Main

然后点一下函数的链接即可。

posted @ 2022-09-14 13:17  dewxin  阅读(84)  评论(1编辑  收藏  举报