
#11353: DWARF call frame information incorrect in the presence of unsafe foreign calls -------------------------------------+------------------------------------- Reporter: bgamari | Owner: Type: bug | Status: new Priority: normal | Milestone: 8.2.1 Component: Compiler | Version: 7.10.3 (CodeGen) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: x86_64 Type of failure: Debugging | (amd64) information is incorrect | Test Case: Blocked By: | Blocking: Related Tickets: #11338, #11337 | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): The problem is that you need both details from the code generator (to account for the unwind adjustments as described in this ticket) as well as the procedure's control flow graph (in order to push unwind information down to successor blocks). My current plan is, * Introduce a `UNWIND` pseudo-instruction * `CmmUnwind` nodes will be translated by the `UNWIND` instructions * Add a lazy field to `NEWBLOCK` which will capture the successors of the block * Introduce a pass after code generation which traverses the `[Instruction]` of each block and, * extract the `UNWIND` and `DELTA` instructions from a block's `[Instruction]` and use them to build a `LabelMap (UnwindTable, [SuccessorBlockId])` (the `SuccessorBlockId` being taken from the successors field of the block's `NEWBLOCK` instruction) * accumulate a `[BlockId]` to preserve the order in which we must emit unwinding tables (since they must be written in order of increasing address) * Introduce another pass of shape `LabelMap (UnwindTable, [SuccessorBlockId]) -> LabelMap UnwindTable` which pushes blocks' unwind tables "down" to their successors * Pass the resulting `UnwindTable`s to the existing unwinding table generation code -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/11353#comment:6 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler