1. Computing

Delphi Debugging

Debugging Techniques in Delphi and Bug Prevention

By

Delphi Debugging - Call Stack window

Delphi Debugging - Call Stack window

Article written / submitted by Stefan Cruysberghs

Debugging in Delphi

Even if you did write a program in disciplined, well-structured, careful manner, you probably still need to debug it to find some bugs. Delphi offers great debugging tools and when you know how to use them, you will surely save a lot of time finding the exact reason of the problem.

In this small tutorial I will explain some nice features in Delphi which will help you to debug your programs. Because it is better to avoid bugs, I will also give some tips for making better programs.

The full article can be downloaded as one PDF document: Debugging Techniques in Delphi and Bug Prevention

Here's the contents:

  • Project options - before you can start using the Delphi debugger tools, you have to make sure all necessary settings are setDebugger options
  • Breakpoints - when pressing the F5 button or clicking on the left bar in your editor you can add a red line to your source. This line of source will have a breakpoint. When running the program, the execution will stop when it passes the source line. Now you can trace into your source by using some function keys.
  • Call stack - the Call Stack window displays the function calls (=LIFO list) that brought you to your current program location and the arguments passed to each function call.
  • Local variables - this window will show all local variables and their current value in the current function or procedure.
  • Watches - you add a watch to track the values of program variables or expressions as you step over or trace into code.
  • Ideas for creating your own debug features
  • Bug prevention
  • Try-Finally Gotchas
  • Try-Except Gotchas

The full article can be downloaded as one PDF document: Debugging Techniques in Delphi and Bug Prevention

  1. About.com
  2. Computing
  3. Delphi
  4. Getting Started with Delphi
  5. Delphi Debugging - Debugging Techniques in Delphi and Bug Prevention

©2014 About.com. All rights reserved.