Shipping core libraries with debug symbols

Peter Wortmann scpmw at leeds.ac.uk
Sun Jan 4 22:48:02 UTC 2015



Okay, I ran a little experiment - here's the size of the debug sections 
that Fission would keep (for base library):

   .debug_abbrev:          8932 - 0.06%
   .debug_line:          374134 - 2.6%
   .debug_frame:         671200 - 4.5%

Not that much. On the other hand, .debug_info is a significant contributor:

   .debug_info(full):   4527391 - 30%

Here's what this contains: All procs get a corresponding DWARF entry, 
and we declare all Cmm blocks as "lexical blocks". The latter isn't 
actually required right now - to my knowledge, GDB simply ignores it, 
while LLDB shows it as "inlined" routines. In either case, it just shows 
yet more GHC-generated names, so it's really only useful for profiling 
tools that know Cmm block names.

So here's what we get if we strip out block information:

   .debug_info(!block): 1688410 - 11%

This eliminates a good chunk of information, and might therefore be a 
good idea for "-g1" at minimum. If we want this as default for 7.10, 
this would make the total overhead about 18%. Acceptable? I can supply a 
patch if needed.

Just for comparison - for Fission we'd strip proc records as well, which 
would cause even more extreme savings:

   .debug_info(!proc):    36081 - 0.2%

At this point the overhead would be just about 7% - but without doing 
Fission properly this would most certainly affect debuggers.

Greetings,
   Peter

On 03/01/2015 21:22, Johan Tibell wrote:
 > How much debug info (as a percentage) do we currently generate? Could 
we just keep it in there in the release?



More information about the ghc-devs mailing list