Debugging CoreCLR Applications in WinDBG

One of the nicest tools that you have as a developer is the ability to debug. WinDBG isn’t what I call the best debugger in the world, but it is certainly among the most powerful. This post is meant just to walk you through setting up WinDBG with a CoreCLR application.

· DevOps Zone · Tutorial
Save
2.24K Views

One of the nicest tools that you have as a developer is the ability to debug. WinDBG isn’t what I call the best debugger in the world, but it is certainly among the most powerful. This post is meant just to walk you through setting up WinDBG with a CoreCLR application.

In particular, this is important when you are getting a crash dump from somewhere. In order to actually debug things properly, you need to load the crash dump into WinDBG and then run the following commands:

.sympath srv*c:\Symbols*https://msdl.microsoft.com/download/symbols
.load C:\Program Files\dotnet\shared\Microsoft.NETCore.App\1.0.0\sos.dll .
.reload

The first step is to setup the symbols, so you can see method names, instead of addresses. The second will use the CoreCLR SOS dll (note, if you have different versions, you might need to get the sos.dll from the machine that the user is running along with the dump). And finally you are reloading the symbols (this will be slow on the first time).

That is it, now you can start working with WinDBG relatively normally, although I did notice some of the commands have better UI. Looks like SOS and SOSEX had a meeting.

Topics:
method, debugger, coreclr, tools, crash, ui, application, windbg, commands

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.


Comments