Commits on Source (2)
-
Ben Gamari authored
It turns out that some important native debugging/profiling tools (e.g. perf) rely only on symbol tables for function name resolution (as opposed to using DWARF DIEs). However, previously GHC would emit temporary symbols (e.g. `.La42b`) to identify module-internal entities. Such symbols are dropped during linking and therefore not visible to runtime tools (in addition to having rather un-helpful unique names). For instance, `perf report` would often end up attributing all cost to the libc `frame_dummy` symbol since Haskell code was no covered by any proper symbol (see #17605). We now rather follow the model of C compilers and emit descriptively-named local symbols for module internal things. Since this will increase object file size this behavior can be disabled with the `-fno-expose-all-symbols` flag. With this `perf record` can finally be used against Haskell executables. Even more, with `-g3` `perf annotate` provides inline source code.
49c69308 -
Ben Gamari authored6a977ea5
Showing
- compiler/GHC/Cmm/CLabel.hs 34 additions, 0 deletionscompiler/GHC/Cmm/CLabel.hs
- compiler/GHC/CmmToAsm.hs 1 addition, 0 deletionscompiler/GHC/CmmToAsm.hs
- compiler/GHC/CmmToAsm/Config.hs 2 additions, 2 deletionscompiler/GHC/CmmToAsm/Config.hs
- compiler/GHC/CmmToAsm/Monad.hs 2 additions, 0 deletionscompiler/GHC/CmmToAsm/Monad.hs
- compiler/GHC/CmmToAsm/X86/Ppr.hs 11 additions, 0 deletionscompiler/GHC/CmmToAsm/X86/Ppr.hs
- compiler/GHC/Driver/Flags.hs 1 addition, 0 deletionscompiler/GHC/Driver/Flags.hs
- compiler/GHC/Driver/Session.hs 8 additions, 2 deletionscompiler/GHC/Driver/Session.hs
- docs/users_guide/debug-info.rst 1 addition, 0 deletionsdocs/users_guide/debug-info.rst
- docs/users_guide/phases.rst 14 additions, 0 deletionsdocs/users_guide/phases.rst