We've just updated the MDbg sample! This is a full source sample for building a managed debugger in C#.

It's available here. (This is the same link as before. If it brings up version 1.0, just try refreshing the page until you get mdbgSample21.EXE).

We're up to version 2.1.0, and it includes:

  1. Mdbg + Python integration. (You need to download Python separately)
  2. Managed wrappers for native debugging APIs like WaitForDebugEvent. (This is what I alluded to previously here).
  3. Improved event logging infrastructure.
  4. Pdb2Xml conversion tool, which now includes round-tripping the pdbs. (I hoped we'd release this earlier, but better late than never.)
  5. Updated Eula.
  6. Better organized directory structure. This includes a "tools" subdirectory, which we expect to pave the way for adding new Mdbg-based tools.
  7. All IL files have been converted into C#, so it's now a pure C# solution.

The previous update was about a year ago (12/12/05). I have a bunch of other mdbg links here, and questions / comments can go to the "Building Development And Diagnostic Tools for .NET" forum. (Jon Langdon posted an announcement on that forum here). This should be pretty compatible with the previous release. There's a minor breaking change in there regarding WriteLine and newlines. (I had to update the Gui to avoid double newlines)

There's a readme.htm and mdbg.sln to get you started quickly. 

Mithun Shanbhag is now on the CLR Debugger team and was responsible for driving the sample release. Kudos to Mithun!

I want to reiterate my standard Mdbg disclaimer: The Mdbg sample is primarily intended to demonstrate how to use .NET diagnostic APIs (mainly ICorDebug) and not intended to be a production debugger. Also, while the mdbg sample is important to us, it's not our top priority and we tend to steer our efforts to the ICorDebug implementation (which Visual Studio and other debuggers use) instead of the Mdbg sample. Regardless, we hope folks find this helpful.