CodeKicks.com
Focus on Microsoft Technologies - Tutorials, Articles, Code Samples.

Thursday, August 31, 2006

.NET CLR Debugging Overview

CLR Debugging

The CLR debugger is a new debugging platform designed from the ground up to support debugging any application run by the CLR. For the CLR to enable complete debugging support for all the languages it hosts, it must provide debugging services for all modern language features. Many of those new features were not captured by Active Script debugging services. This new approach increases overall complexity, but this complexity is necessary to harness the power provided by the CLR.

Such services include the addition of a class structure and support for rich types as well as many new native types. In addition, the CLR makes the actual runtime operations of the program, such as thread context inspection, process memory inspection, register set evaluation, and source code disassembly much more visible.

The CLR also provides extended runtime control. It allows the debugger to catch Control-C or Control-Break keystrokes to break a process at its current execution point, to move the instruction pointer to skip or reexecute code, and to modify the executable code at run time. The last item, known as dynamic code injection, is one of the more exciting features added to the debugger set. This feature provides the Edit and Continue capability introduced with Visual Studio® 6.0 (but which, unfortunately, did not make it into the first release of Visual Studio .NET). For example, the user can modify code while at a breakpoint, recompile, and continue executing the new code using the Edit and Continue services.

Finally, the CLR provides a whole host of notifications to the debugger when system events occur. System events, such as first and last chance exceptions, assembly and module load/unload, process and thread creation/exit, and a full data logging capability including trace levels, are available.

Figure 1 Debugging Architecture
Figure 1 Debugging Architecture

Find More topics from Microsoft. CLR Debugging

, , ,

Post a Comment