Skip to content

Latest commit

 

History

History
59 lines (42 loc) · 3.44 KB

GHC DWARF.md

File metadata and controls

59 lines (42 loc) · 3.44 KB

Current goal: make unwinding work with DWARF again (?)

Previous work:

My tickets:

Known (unticketed) problems:

  • some tests in ./validate regress 75% allocations with -g
  • unwinding past stg_stop_thread_info (FFI) doesn't work on -threaded. Solution: we need to unwind rbp as well.
  • 8.2.x will probably not work with -g. The status of 8.4.x is unclear. See https://ghc.haskell.org/trac/ghc/ticket/14868

Future ideas:

Unwind everything and give access to locals

  • Would probably require some extra type info

Use DWARF for retainer profiles without -prof

Be more strategic about source notes with -g1.

  • Need to be careful to preserve middle frames

Tips & Tricks

You can get gdb to produce some useful info with set debug frame 1.

Good reading material

CFI directives in assembly files

CFI directives

6.45.2 Extended Asm - Assembler Instructions with C Expression Operands

Generic asm macros used on many machines

Split Stacks in GCC - "Fortunately DWARF is complex enough to represent the unusual return sequence used by a split stack function. Therefore, the only major issue is that gdb expects all stack address to monotonically decrease. Some marker will be needed to tell gdb to disable this sanity check."