Learn To Use The Debugger

PDF Print E-mail
Written by Graham Stoney   

Most development platforms have debuggers that are powerful tools which barely get exploited by most software engineers. Breakpoints and watchpoints can be set up to catch events before they wreak havoc, and those assertions that you've carefully added during coding can be caught to nail bugs the moment they start causing trouble. A powerful debugger is much more useful that printf statements showing the flow of the code and debugging logs, but they do take time to learn and get used to.

Often the default choice in development environments is to avoid generating debug information when compiling the final production code. This is madness; there are often bugs which don't appear when the optimizer is turned off and they usually don't turn out to be compiler bugs. Make sure you retain debug information for all your releases so that it's possible to fire the debugger up and get inside the code to diagnose problems reported from the field. Don't ship the debug information with the product though, as that would help nasty people reverse engineering your code; and you probably don't want that.



Social Bookmark this page:Reddit! Del.icio.us! Google! Live! Facebook! StumbleUpon! Spurl! Yahoo! Ask!
 

Add your comment

Your name:
Your email:
Subject:
Comment:

Sponsored Links