What's new in v2.0 CLR Debugging (ICorDebug)?

The CLR debugging services have added a lot of great things in v2.0. The main theme for us has been improving the Rapid Application Development (RAD) experience. Here’s a list of new features:

1) Edit-And-Continue. EnC is the ablity to edit code while it is being debugged without having to restart the debugging session. Both VB.Net + C# are supporting this, and any 3rd-party debugger could too.

2) Just-My-Code debugging. JMC is the ability to debug just the code you’re interested in without getting sucked into debugging 3rd-party library code that you don’t care about. This includes stepping through just your code and filtering exceptions in just your code.

3) Object identity. Object Identity is the ability to ‘tag’ objects found while inspecting and then instantly pull them up later by their tag without having to refind them. We’ve provided object identity for managed code objects, similar to the ‘this’ pointer in native code.

4) Interceptable exceptions. You can now stop an exception in midflight and resume executing code up on the stack, even when there’s not a catch block. It’s like SetIp for exceptions.

5) The mere presence of a debugger doesn’t affect code-gen anymore. In v1.1, the mere presence of a debugger affected codegen (jitted as debuggable). Debuggers shouldn’t affect behavior. We’ve fixed this. Part of this is making sure that jit-debug maps are always tracked. This is a major step forward in the sorry story of debugging retail managed code. Tinkering with .ini files to track debug info is no longer necessary. See here for details.

6) Fit & Finish: We’vefilled a few small holes in the debugger API, such as providing a way to find out how assemblies got resolved and inspecting GC handles.

7) Versioning: We avoided the debugger versioning problem in v1.1 by making v1.1 and v1.0 debugging interfaces completely interchangable (you’ll notice that cordebug.idl doesn’t have any changes between 1.0 and 1.1). This was feasible since we didn’t add any new features to v1.1. For v2.0, we’ve added full fledged debugger versioning support. See here for more details.

8) Managed Debug Assistants (MDAs) : [update:11/10/05] MDAs are useful checks in the core CLR to catch certain problems like running code under the loader lock or having a bad pinvoke signature. We've added first-class support for MDAs into the managed debugging APIs. See here for details.

(I expect to blog about these things in the future. As I do, I’ll come back here and add pertinent links).

We also spent a lot of time on certain infrastructure and stability issues.

- make ICorDebug a much better com-citizen. This was a requirement to use com-interop on the API, and thus enable MDbg.

- Improved func-eval abort (which translates to less hangs when func-evalling properties)

- much more stable (read: significantly less deadlocks) and faster interop-debugging.

 

Although this is all from the CLR perspective, rest assured that Visual Studio 2005 will take advantage of all of these new features.

 

I’d love to know what sort of functionality users would like in the next version.

[Update 7/13/05: Here are new things throughout the rest of .Net 2/VS2005: https://msdn2.microsoft.com/en-us/library/t357fb32.aspx ]