Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ultimate guide to Debug in Delphi

Is there a complete resource for debugging in Delphi that instructs on how to use all the IDE debugging tools? There used to be a guide from Marco Cantù but it was updated to Delphi 5 if I am not wrong.

May you please redirect me to a complete resource updated at least to D2009 (better if XE).

like image 270
LaBracca Avatar asked Oct 22 '10 07:10

LaBracca


2 Answers

Internet is your friend, here are two links about debugging

Delphi - Debugging techniques

[PDF] http://www.scip.be/ScipViewFile.php?Page=ArticlesDelphi11

The content in there is still very relevant

like image 157
Sigurdur Avatar answered Oct 04 '22 16:10

Sigurdur


I'd like to complement Peter Sherman's excellent response:

My favorite debugging technique is

if <MyExpression> then
  asm nop end;

This code does basically nothing and has no influence on running performance. It is a no-op. However you can put regular breakpoints on that "asm" line and it will work just like any other breakpoint. Whoever have tried conditional breakpoints (especially those inside loops) know that it can take forever for the debugger to evaluate the breakpoint condition and it will become a nightmare to run multiple debugging sessions. In the above case, it runs on full speed and have no other side effects.

A side note: The asm block can only be used with x86 compilers.

like image 34
Alexandre M Avatar answered Oct 04 '22 17:10

Alexandre M