What is 'Limited Debug Information'? (Full “Debugging Information" generates huge EXE files)

二次信任 提交于 2020-01-11 02:35:00

问题


I installed Delphi XE7 recently. When I first compiled an old app my jaw dropped when I have seen that the size of the EXE increased with 10MB!

Playing in the 'Project options' I discovered that setting the 'Debug information' to 'Limited Debug Information' decreases the EXE size to something VERY close to the EXE generated by Delphi XE. Maybe under Delphi XE7 'Limited Debug Information' is the equivalent of 'Debug Information' from Delphi XE since it results in the same EXE size?

So, why full 'Debug information' makes the EXE so big (compared to XE)? I cannot compile the EXE with limited info (I guess) because I want to have full access to the debugging goodies (also EurekaLog needs it).
Embarcadero's documentation says nothing about the difference between 'limited' and full debug info.

EurekaLog documentation is for an old version of Delphi so it doesn't clearly states if I can use the new option (merciful) 'Limited debug info' or the full debug info. I will have to experiment.


回答1:


"Limited Debug Information" is an option that only affects the Android targeting compiler. However, since all the compilers share the same interface, this option appears for every target. It only applies to how much debug information goes into each individual object (.o) file. For Android (and iOS), the debug info format is DWARF. DWARF is a very verbose format and can contain highly detailed structural type information about all the types in a given unit and for all the types from all the units "used" by a given unit. Under "Limited Debug Information", the type information for all the used units is not generated. This can mean some field and local variables may not be inspectable while debugging.

As for whether debug information is included into the final executable, that is controlled by the linker option, not by the compiler option. The linker will link whatever debug information is available. If building for Android and "Debug Information" is selected, then the final image will have much more information and be much larger.

Now I am going to presume you're targeting Windows (you don't actually state that you are, but I'll use my psychic powers here), in which case, "Limited Debug Information" and "Debug Information" are the same thing. Under Windows, the debug format is called, "GIANT". Can you say "irony"? DWARF is an extremely verbose format, while Embarcadero's (Borland's originally) own GIANT format is more compact. The increase in size can only be from added run-time functionality and probably from more use of generics.



来源:https://stackoverflow.com/questions/27931285/what-is-limited-debug-information-full-debugging-information-generates-hug

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