Changes between Version 13 and Version 14 of DWARF


Ignore:
Timestamp:
Dec 16, 2018 11:32:35 AM (10 months ago)
Author:
nh2
Comment:

Add Features overview section and mention performance bug

Legend:

Unmodified
Added
Removed
Modified
  • DWARF

    v13 v14  
    1 
    2 
    31As of 7.10, GHC has basic functionality to generate DWARF-compliant
    42debugging information with its binaries. This opens up a completely
     
    2220execution is definitely a good idea. We hope that some experience will
    2321help us improve the situation.
     22
     23== Features
     24
     25There main components to GHC's DWARF support are:
     26
     27- The generation of debugging symbols in generated object code when `-g` is passed to GHC
     28  - This enables seeing and using them in tools like `gdb`, `valgrind`, `perf` etc.
     29- "stack unwinding" support: The GHC runtime being able to print stack traces:
     30  - when it crashes
     31  - when requested by sending a signal to the RTS
     32  - via the `GHC.ExecutionStack` API
     33
     34You can read more about them on [[DWARF/Status]].
     35
     36On using these features:
     37
     38- Stack unwinding support is enabled by passing `--enable-dwarf-unwind` at GHC build-configuration time.
     39- Debugging symbols are generated when you compile Haskell modules to object files by passing `-g`.
     40- `--enable-dwarf-unwind` and -`g` are technically independent (`-g` can be useful for other tools even when GHC's own stack unwinding support is disabled), but stack unwinding support in GHC when `-g` was not given to compiled code is quite useless because there won't be much content in printed stack traces (details on that below).
     41- The debugging symbols can be stripped (removed) after the build using e.g. the Unix `strip` tool.
     42- When using `Cabal`, `-g` passed to GHC is controlled by the `--enable-debug-info` flag, and stripping of debugging symbols controlled by `--enable-library-stripping` and `--enable-executable-stripping`.
    2443
    2544== Basic Set-Up
     
    367386- Windows situation completely unclear.
    368387
     388Performance problems:
     389
     390- Potential slowdown bug: "Using -g causes differences in generated core" - #15960
     391
    369392== Design decisions ==
    370393