What do I need to know to be good at debugging?

From time to time I will get this question from people learning to debug application code.  Debugging is an unusual skill and is a combination of art and science.   However, IMHO the following 3 items or characteristics are super important for being successful with your debugging:

  • You don’t necessarily need to be a C or C++ programmer, but you really need to be able to read C or C++ code, as well as some basic assembly and understand what is happening.  Probably more importantly, it to understand data structures around these languages – queues, stacks, linked lists, etc…  This knowledge makes it easier to understand what the code you are debugging is doing in the various code paths as well as understanding structures specific to dumps – such as the stack.
  • You really need to understand the internal workings of the application you are debugging.  For SQL Server, you really want to know how SQL Server works internally – the SQL OS.  Understand worker threads, tasks, memory clerks, etc… Many on MSDN help give you insight to the internal workings of SQL Server, and the Inside SQL Server series of books from Kalen Delaney are an excellent resource.
  • Finally, you of course have to learn how to use the tool.  WINDBG and the other debuggers have hundreds of commands that help you mine information from dumps and live debugs – so many commands it’s intimidating.  The Help file included with the debuggers is your best resource for this.  Once you get a bag of commands in your arsenal and the two items above, you’ll be well on your way.

With the skills and characteristics listed above, add good problem solving skills – if you are debugging as part of a troubleshooting effort – and you will be well on your way to understanding SQL Server at whole new level.

– Jay

Comments (0)