Archive for the 'Uncategorized' Category

Hello Everyone.
My name is Eran Sandler and I’ve been messing around with .NET for the past 5+ years (a little bit after the first PDC it was introduced to the world).

I wanted to share with the world some of the experiences I’ve gathered in the last couple of years in regards to .NET debugging, specifically to Production debugging and Post Mortem debugging since there is little to no information available on the web (not to mention not a whole lot of tools to do that).

So what is Production Debugging?
In my own terms, production debugging is the ability to debug your application in a production environment without the ability to install a fully feldged development environment. This means, NO Visual Studio or some other IDE at your disposal, NO code compilation on the machine and a lot of other NOs that you can figure yourself.

This type of debugging is very suited to situations where you need to debug on a production environment some tricky problem and there is no way (or ability) to install a development environment.
A good example of this situtation is deubgging on a customer’s production environment.

OK, so what is Post Mortem Debugging?
I’m not sure its the right term for it (and maybe I mixed it up with some other term), but basically its the ability to investigate a problem after it occured.
We are capable of doing that using a tool that actually takes a snapshot of all the memory that is being used at the moment in a given process. This gives us a current image of the process at a certain point in time enabling us to investigate various things like the objects alive at this momemnt, what are the various threads doing and so on.

Post Mortem debugging is very useful if you can’t reach a cutomer’s site (or don’t want to) and you need to get more information to better understand and solve a problem.
Another good use of post mortem debugging is the ability to take a few sequencial snapshots of a ceratin process and examine some information as it changes over time, for example, checking the virtual memory fragmentation that is happening over time in a ceratin process.


By now you are probably wonder if this is actually possible. Well… It is!
Microsoft even supplies the tools (Debugging Tools for Windows – contains WinDbg and friends, and there is also CorDbg which is the .NET managed Debugger that comes with the .NET Framework SDK) and its even quite easy but the main problem is lack of documentation and places on the net to actually learn this stuff.

I will try to give some tips, pointers and tutorials on how to do various things I’ve picked up a long the way and hopefully we will have enough information here to help everyone.

In the next couple of posts I’m going to show the basic things of how to use WinDebug (that’s the main tool we’ll use) with .NET and we will learn some cool stuff.

So… hold on to your hourses because we are going on a crazy debugging ride 🙂