- Dwarf standard v2
- Dwarf standard v3, needed for
dW_CFA_expression
- GHC DWARF wiki page
- Source notes
- Overview of code generator
- https://ghc.haskell.org/trac/ghc/ticket/11338 Unwind information is incorrect in region surrounding a safe foreign call
- https://ghc.haskell.org/trac/ghc/ticket/11337 Unwind information incorrect between Sp adjustment and end of block
- https://phabricator.haskell.org/D2741 Generalize CmmUnwind and pass unwind information through NCG
- https://phabricator.haskell.org/D3104 CmmLayoutStack: Correctly annotate Sp adjustments with unwinding information, appears to be the blame for #14999
- https://phabricator.haskell.org/D2742 CmmLayoutStack: Add unwind information on stack fixups, the code makes sense, but it breaks lint from #15000
- https://phabricator.haskell.org/D169, initial diff
- https://phabricator.haskell.org/D2738, Cmm: Add support for undefined unwinding statements
- https://phabricator.haskell.org/D1279, Output source notes in extended DWARF DIEs
- https://ghc.haskell.org/trac/ghc/ticket/13866, -g doesn't work with -pgma=clang++
- https://ghc.haskell.org/trac/ghc/ticket/14999, unwinding info for stg_catch_frame is wrong
- https://ghc.haskell.org/trac/ghc/ticket/15000, Add a linter for debug information (-g)
- https://ghc.haskell.org/trac/ghc/ticket/14894, HEAD fails to build with -g1
- https://ghc.haskell.org/trac/ghc/ticket/14779, Compiling with -g fails -lint-core checks, also a runtime bug
- https://sourceware.org/ml/gdb-patches/2018-02/msg00252.html,
gdb
makes assumptions that make sense for C-like languages, patch not merged, because there's a concern about performance
- 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 unwindrbp
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
- Would probably require some extra type info
- Need to be careful to preserve middle frames
You can get gdb
to produce some useful info with set debug frame 1
.
CFI directives in assembly files
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."