Skip to content

Instantly share code, notes, and snippets.

@kfreezen
Created February 26, 2019 20:29
Show Gist options
  • Save kfreezen/2c77b93c8085bfa90fe487229cf0eed5 to your computer and use it in GitHub Desktop.
Save kfreezen/2c77b93c8085bfa90fe487229cf0eed5 to your computer and use it in GitHub Desktop.
Using WinDBG to debug .NET / Golang interop

Using WinDBG with .NET and Golang

Make sure you have WinDBG (I prefer WinDBG Preview from Microsoft Store on Windows 10)

The next step is to download (PssCor4)[https://download.microsoft.com/download/2/C/E/2CE778CF-3A42-48FE-9EFF-4C76B4ECB147/Psscor4.EXE] and extract it to a folder (e.g. E:\debug).

Once you have that done, you can go to windbg and start the process from there.

Once the first breakpoint is hit in WinDBG, (should happen on start by default) run the following command. Your path to psscor4.dll may differ.

.load E:\debug\psscor4\amd64\psscor4.dll

Next, you'll need to let the application initialize before you run the following command.

.cordll -ve -u -l

Once that's done you should be able to debug as normal.

Remember to use !clrstack

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