Writing a CLR Debugger in Python

Harry Pierson has written an excellent set of blog entries about writing a managed debugger in IronPython. He builds on the ICorDebug managed wrappers that we ship in Mdbg and explains many of the concepts for how to write a debugger, such as managing breakpoints.  Read more about them here. 

0

Mdbg (C# debugger in C#) source sample updated

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: Mdbg + Python…

5

Fixing the MDbg / Iron Python extension…

A while ago, we had a sample of Mdbg-Python extension that let you use python to script MDbg. It was based off a pre-release Iron Python, and things have since broken. We updated at least once to keep up with the breaks. We’re aware of the problems and actively updating it to use the latest python…

0

Working on managed wrappers for Native Debugging API

FWIW, I’ve been working on some managed wrappers for the native debugging API (kernel32!WaitForDebugEvent,etc) My goals are: Make it extremely easy to use the native debugging API.  Maintain fidelity to the native debug API. I didn’t want a super thick wrapper, but I was willing to track some extra state to make things easy. Smooth…

12

How to build Mdbg apps

I often publish little samples in this blog based off MDbg (which generally show off the debugging services in some way; such as app to convert Pdb–>XML, or this harness to print all exceptions in an app). I generally call these apps “harnesses” because they run on another app (the debuggee). I’ve gotten some questions…

1

Managed Stack Explorer

Check out: Managed Stack Explorer. It’s a tool on CodePlex that lets you automatically get stack snapshots of V2 managed processes. Its debugging inspection functionality (viewing callstacks) is built on the CLR Debugging Services via ICorDebug, and access through managed code via the low-level managed wrappers from Mdbg (and so I’ve added it to the…

3

Felice Pollano: Integrating a debugger into Reflector

Felice Pollano is working on project to make merge Reflector (an IL–>C# decompiler) and Mdbg (a managed debugger). See here for details. I’ve said at many times this is possible, but have never had the cycles to go do it. (As a side note, there are actually a lot of things that are possible at…

3

Why doesn’t MDbg use generics?

If you’ve looked at the MDbg sources, you’ll notice it looks a lot like a V1.1 app. There are few to no V2 (Whidbey) concepts in there: few anonymous delegates, very little (if any?) generics, no ‘yield’ keyword. Since MDbg shipped in V2, why didn’t we use the greatest stuff from V2? 1. Bootstrapping: We…

3

Jan is on MSDN TV talking about MDbg

Jan Stranik is on MSDN TV talking about MDbg, the managed-debugging sample written in C#.  See the video here.  Jan wrote most of MDbg, and handle a lot of hard problems about getting a working debugger in managed code. He gives a brief overview of managed-debugging and of Mdbg’s architecture, including how Mdbg layers things…

0

MDbg, Managed-debugging, and 64 bit

V2 CLR added support for 64-bit (amd64 and ia64), and that includes managed-debugging support. So a 64-bit MDbg can debug a 64-bit managed app. But what about cross-platform stuff when your debugger and debuggee are different platforms? Here’s how MDbg and managed-debugging work across the 32/64 bit divide.  The quick story is that Mdbg is…

2