Search code examples
delphidelphi-7

Delphi compiler options for Debugging


What effect do the options in the image below have on the finally binary?

enter image description here

I first compiled my application with them enabled and the compiled binary file size was 7,606,272 bytes. Then I manually switched them off...and the size was unchanged. I also used these compiler switches (included in every file using a .inc file) to do the same thing:

    {$D-}       // Remove "Debug information"
    {$L-}       // Remove "Local symbols"
    {$Y-}       // Remove "Reference info/Definitions only"
    {$C-}       // Remove "Assertions"

Same file size. The help does say that debugging information goes into the DCU (object) files and I've confirmed this is correct (they're smaller with the options off). Compilation and linking time is so fast, though, its hard to tell if there is a difference time-wise.

Does toggling these options have any effect on the final binary (eg. performance enhancement)? It doesn't appear to affect the size of the binary, in any case.


Solution

  • The top three options have no effect on the binary. They only impact on whether or not debugging information is produced in the dcu files.

    The assertions option determines whether or not Assert statements are included or not. That affects the executable.

    Debug DCUs determines whether or not the RTL/VCL dcu files contain debug information. Also, the debug versions of these dcu files are built unoptimized to make debugging better. So that also affects the code that goes in the executable.