Condividi tramite


Not Your Father's Debugger

In case you missed it, the Debugging Tools for Windows blog recently posted about the new SDK and the availability of JavaScript extensibility.

I used something like this a few years ago to do all sorts of interesting things, and I can definitely see myself doing more of this in the future.

Something I learned is that when you have tools that allow you to easily inspect your programs, you start designing so it's easier to create debug scripts for it, and in turn you can get better diagnostics and fix bugs more easily.

For example, if you're writing a library that exposes a number of objects that callers will refer to, I've often found it convenient to have all of these weaved through a linked list, just so I can traverse them and get an instant view of all the outstanding references, and maybe drill into the ones that are in some particular state. For example, what are all the connections in your server, and which of those have pending work? Are there any that haven't had any activity for a while? Do you know which client is associated with each state? Some of this information is also a good candidate for instrumentation, but that's a topic for another day.

Enjoy!