Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 795
Server Overflow Avatar asked Jan 13 '15 20:01

Server Overflow


1 Answers

"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.

like image 53
Allen Bauer Avatar answered Oct 23 '22 00:10

Allen Bauer