All tricks in this blog are only for educational purpose. Learn these tricks only for your knowledge. Please donot try these to harm any one. We will not take any responsibility in any case. All softwares and tools on this site are here for private purposes only and If you want to use a software for business purpose, please purchase it. I do not host many of these tools. I Post links that I have found from numerous Search engines. I will not be responsible for any of harm you will do by using these tools.


Friday, September 24, 2010

delphi programming tutorial: Debugging techniques in Delphi & bug prevention

Debugging techniques in Delphi 1 Programming with Delphi Debugging Debuggingtechniques in Delphi … In this small tutorial I will explain some nice features in Delphi which will help …
Debugging techniques in Delphi 3 Debugging 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. Try it with an example Debugging techniques in Delphi 5 Options Before you can start using the Delphi debugger tools, you have to make sure all necessary settings are set.Project options Go to the tab Compiler in the project options via the menu Project >> Options . Uncheck Optimization , check Stack frames and check some of the Debuggingoptions. Without these options you will not be able to use all the debugging tools. When creating an official build of your application it is better to uncheck all Debugging options and to check Optimization. Your final EXE will be a little bit smaller without this debug information Debugging techniques in Delphi 6 Just use the default Linker options. When using external debuggers like MemProof you sometimes have to set the Map file to Detailed and check Include TD32 debug info . In all other cases don’t check the EXE and DLL options and don’t use the Map file Debugging techniques in Delphi 7 Debugger options To use the debugger tools you have the check if the option Integrated debugging( Tools >> Debugger options ) is checked. 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. F9 Run/Start F8 Step over to next source line F7 Trace into (source of function/procedure) F4 Run to cursor (and skip the other source lines) F5 Add/remove break Debugging techniques in Delphi 8 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. The top of the Call Stack window lists the last function called by your program. Below this is the listing for the previously called function. The listing continues, with the first function called in your program located at the bottom of the list. If debug information is available for a function listed in the window, it is followed by the arguments that were passed when the call was made. The Call Stack window also shows the names of member functions (or methods). When right clicking you can jump to the selected procedure/function/…

Download delphi programming tutorial: Debugging techniques in Delphi & bug prevention.


Post a Comment