6

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.

Nathan Hughes
  • 94,330
  • 19
  • 181
  • 276
Gabriel
  • 20,797
  • 27
  • 159
  • 293
  • There is a related post here but it doesn't treat the EXE size problem: http://stackoverflow.com/questions/19653475/what-is-the-different-between-limited-debugging-information-and-debug-informa – Gabriel Jan 13 '15 at 20:55
  • Try enabling the linker's "Place debug information in separate TDS file" option. – Remy Lebeau Jan 13 '15 at 21:00
  • I don't think EurekaLog will work this way. Or, probably i will have distribute also the TDS files. Anyway, I will look into this. Thanks. – Gabriel Jan 13 '15 at 21:02
  • Seems like you ask [this question](http://stackoverflow.com/q/6267246/62576) with every new version of Delphi you get. :-) – Ken White Jan 13 '15 at 21:07
  • 1
    @KenWhite-Yes. But this time they added a new compiler option (limited) and there is absolutely not a single word of explanation about it. – Gabriel Jan 13 '15 at 21:11
  • PS: I only have this problem because I use EurekaLog so I need to turn those linking/debugging options ON. I will drop a question to EurekaLog support. But I am still curious about what the hell could be **limited** debug info. How limited is it? – Gabriel Jan 13 '15 at 21:30
  • I think that the new options are for the mobile compilers. Maybe. – David Heffernan Jan 13 '15 at 21:40
  • This is strange. What could Delphi XE7 add to the EXE file (as debug info) to make it even bigger than before? – Gabriel Jan 13 '15 at 21:44
  • 1
    Why would you need to include debug info in the exe, or distribute tds file? With madExcept, you can either include that information in the exe, or keep it back at base. When the bug report is sent in, the bug report viewer decodes the raw data and turns addresses into function names, line numbers etc. Surely it's the same with Eureka. – David Heffernan Jan 13 '15 at 21:46
  • http://wiert.me/2013/11/20/when-the-delphi-xe5-commandline-compiler-fails-with/ – David Heffernan Jan 13 '15 at 21:51
  • 2
    @DavidHeffernan-You are right. For EurekaLog the Debug Info should be turned on only in 'Compiling' not also in 'Linking'. – Gabriel Jan 14 '15 at 09:41

1 Answers1

14

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

Allen Bauer
  • 16,657
  • 2
  • 56
  • 74
  • 3
    Thanks for the information. Too bad there's no documentation. – David Heffernan Jan 14 '15 at 07:54
  • Thanks Allen. Your first sentence already explained almost everything :) – Gabriel Jan 14 '15 at 09:23
  • 2
    For the record, even though the linker for Android will inject all the debug information into the executable image (actually a .so on Android), that information is stripped away while building the .apk file which is what is actually placed onto the device (or emulator). For debugging, the gdb debugger doesn't read the debug information from the image packed into the .apk, rather it reads it from the originally linked image on your hard-drive. – Allen Bauer Jan 15 '15 at 03:40