summaryrefslogtreecommitdiff
path: root/compiler/nativeGen
diff options
context:
space:
mode:
authorBartosz Nitka <niteria@gmail.com>2018-05-03 12:37:00 -0400
committerBen Gamari <ben@smart-cactus.org>2018-05-03 12:37:18 -0400
commit6132d7c5e6404936ef281a6f3be333fea780906e (patch)
tree653db073c3273e343ae60a062c43c210fff05e87 /compiler/nativeGen
parent75361b119c609f0ab98f3d12a15690aae4ce42a1 (diff)
downloadhaskell-6132d7c5e6404936ef281a6f3be333fea780906e.tar.gz
Correctly add unwinding info in manifestSp and makeFixupBlocks
In `manifestSp` the unwind info was before the relevant instruction, not after. I added some notes to establish semantics. Also removes redundant annotation in stg_catch_frame. For `makeFixupBlocks` it looks like we were off by `wORD_SIZE dflags`. I'm not sure why, but it lines up with `manifestSp`. In fact it lines up so well so that I can consolidate the Sp unwind logic in `maybeAddUnwind`. I detected the problems with `makeFixupBlocks` by running T14779b after patching D4559. Test Plan: added a new test Reviewers: bgamari, scpmw, simonmar, erikd Reviewed By: bgamari Subscribers: thomie, carter GHC Trac Issues: #14999 Differential Revision: https://phabricator.haskell.org/D4606
Diffstat (limited to 'compiler/nativeGen')
-rw-r--r--compiler/nativeGen/Dwarf/Types.hs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/nativeGen/Dwarf/Types.hs b/compiler/nativeGen/Dwarf/Types.hs
index 579ed0d256..25629448dd 100644
--- a/compiler/nativeGen/Dwarf/Types.hs
+++ b/compiler/nativeGen/Dwarf/Types.hs
@@ -415,6 +415,12 @@ pprFrameBlock (DwarfFrameBlock hasInfo uws0) =
-- Note that this will not prevent GDB from failing to look-up the
-- correct function name for the frame, as that uses the symbol table,
-- which we can not manipulate as easily.
+--
+-- There's a GDB patch to address this at [1]. At the moment of writing
+-- it's not merged, so I recommend building GDB with the patch if you
+-- care about unwinding. The hack above doesn't cover every case.
+--
+-- [1] https://sourceware.org/ml/gdb-patches/2018-02/msg00055.html
-- | Get DWARF register ID for a given GlobalReg
dwarfGlobalRegNo :: Platform -> GlobalReg -> Word8