Delphi compiler options for Debugging

 ̄綄美尐妖づ 提交于 2019-12-11 04:15:06

问题


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

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.


回答1:


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.



来源:https://stackoverflow.com/questions/31613499/delphi-compiler-options-for-debugging

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!