Archive for March, 2008

Wohoo, I’ve changed the world :-)

March 4, 2008

Well at least I feel like I have. I finally contributed some code back to open source and threes a really feel good factor attached to doing so. Fine, yes it was less than 50 lines and yes the Icon doesn’t look all that awesome (but in my defense, it was hand drawn using visual studio icon editor) .
 

So what was it?
Deblector, created by Felix is a plug-in for reflector which allows you to debug MSIL in the .net framework. I’ve been using this from very close to the start (almost 1.5 years ago now) when working on a nasty framework being developed by a 3rd party vendor. Many of the framework releases were premature and we were the ginnie pig developers building against it. Many features of this framework just didn’t work and we had no documentation other than the 2 people in the other room that created the framework (and never really given it a test, as shown by the number of core functionality that didn’t work and never would have when you see how they had written it). Anyway, the great thing about this reflector plugin was that it gave you the power to trace through others code and allowed you to attach to a application (much like visual studio debugger), set break points in the MSIL (helped by the core reflector features of disassembling the MSIL to C# or VB) and see the execution paths, set into, over and out of code, see local variables etc in order to figure out what might be causing the issues.

So what did I change?
The great feature of the mdbg was that you could set it to break at the first exception (so you could break on exceptions even within a try catch block). This was the main reason I started using Deblector as the framework I was debugging against always swallowed the exception, no logging, no messages, no nothing, just poof and gone (anti patterns anyone???). Deblector supported the “Catch Exception” command within the command window but when the break point was reached, the command window would know this and allow you to work with it, however, the Debelctor UI wouldn’t and so you could not use the built in prettiness and power of Deblector. So now with only a few lines of code and 30mins creating a nice icon (yeah don’t laugh at it, I thought it turned out quite well considering my art skills), I have added a handler for the event and hooked up the code that would keep the UI in check. Very simple and took very little time, however, I figure it’s a really useful feature and tool.

So, next time you are digging to someone elses framework or DLL and you don’t have code to but want the ability to debug…. give Deblector a try, could be the man for the job 🙂

deblector.jpg