用于调试的Delphi编译器选项 [英] Delphi compiler options for Debugging

查看:89
本文介绍了用于调试的Delphi编译器选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

下图中的选项对最终的二进制文件有什么影响?

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

我首先在启用它们的情况下编译了我的应用程序,并且编译后的二进制文件大小为7,606,272字节。然后我手动将其关闭...大小没有变化。我还使用了这些编译器开关(使用.inc文件包含在每个文件中)来完成相同的操作:

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"

文件大小相同。帮助确实表明调试信息进入了DCU(目标)文件,并且我确认这是正确的(关闭选项后它们会更小)。但是,编译和链接时间是如此之快,很难分辨时间上是否存在差异。

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.

推荐答案

前三个选项对二进制文件。它们仅影响dcu文件中是否生成调试信息。

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.

assertions选项确定是否包含 Assert 语句。这会影响可执行文件。

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

调试DCU确定RTL / VCL dcu文件是否包含调试信息。此外,这些dcu文件的调试版本未经过优化就可以使调试更好。因此,这也会影响可执行文件中的代码。

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.

这篇关于用于调试的Delphi编译器选项的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆