Skip to content

Instantly share code, notes, and snippets.

@KodrAus
Last active February 11, 2019 00:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save KodrAus/ebdb887834e5840a84a0ef0eac6e3e4c to your computer and use it in GitHub Desktop.
Save KodrAus/ebdb887834e5840a84a0ef0eac6e3e4c to your computer and use it in GitHub Desktop.
Debugging .NET JIT Output

See this issue in Kestrel.

This is what I do from my OSX environment.

Build coreclr checked

$ ./build.sh -x64 -checked -skiptests

Build test app as standalone and publish

Publish the app you'd like to test as a standalone binary:

$ dotnet publish -f netcoreapp2.1 -r osx-x64 -c Release

Back in coreclr, copy all files from bin/Product/OSX.x64.Checked to your standalone publish directory e.g. bin/Release/netcoreapp2.1/osx-x64/publish.

Set the enviorment vars

export COMPlus_JitPrintInlinedMethods=1
export COMPlus_JitDisasm=*

Run your published app

From the publish directory, your standalone binary, probably piping its output to a file:

$ ./corerun myapp.dll

You can also get the jit to only output a certain disassembly e.g. set COMPlus_JitDisasm=System.Generic.*.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment