Add HeapView functionality
authorPatrick Dougherty <patrick.doc@ameritech.net>
Wed, 16 May 2018 20:50:13 +0000 (16:50 -0400)
committerBen Gamari <ben@smart-cactus.org>
Sun, 20 May 2018 15:41:04 +0000 (11:41 -0400)
commitec22f7ddc81b40a9dbcf140e5cf44730cb776d00
treeff014a39b87f4d0069cfa4eed28afaf124e552b8
parent12deb9a97c05ad462ef04e8d2062c3d11c52c6ff
Add HeapView functionality

This pulls parts of Joachim Breitner's ghc-heap-view library inside GHC.
The bits added are the C hooks into the RTS and a basic Haskell wrapper
to these C hooks. The main reason for these to be added to GHC proper
is that the code needs to be kept in sync with the closure types
defined by the RTS. It is expected that the version of HeapView shipped
with GHC will always work with that version of GHC and that extra
functionality can be layered on top with a library like ghc-heap-view
distributed via Hackage.

Test Plan: validate

Reviewers: simonmar, hvr, nomeata, austin, Phyx, bgamari, erikd

Reviewed By: bgamari

Subscribers: carter, patrickdoc, tmcgilchrist, rwbarton, thomie

Differential Revision: https://phabricator.haskell.org/D3055
35 files changed:
.gitignore
compiler/ghc.cabal.in
compiler/ghci/ByteCodeLink.hs
compiler/ghci/ByteCodeTypes.hs
compiler/ghci/DebuggerUtils.hs [deleted file]
compiler/ghci/RtClosureInspect.hs
compiler/prelude/primops.txt.pp
configure.ac
ghc.mk
includes/Rts.h
includes/rts/storage/Heap.h [new file with mode: 0644]
libraries/ghc-heap/.gitignore [new file with mode: 0644]
libraries/ghc-heap/GHC/Exts/Heap.hs [new file with mode: 0644]
libraries/ghc-heap/GHC/Exts/Heap/ClosureTypes.hs [new file with mode: 0644]
libraries/ghc-heap/GHC/Exts/Heap/Closures.hs [new file with mode: 0644]
libraries/ghc-heap/GHC/Exts/Heap/Constants.hsc [new file with mode: 0644]
libraries/ghc-heap/GHC/Exts/Heap/InfoTable.hsc [new file with mode: 0644]
libraries/ghc-heap/GHC/Exts/Heap/InfoTable/Types.hsc [new file with mode: 0644]
libraries/ghc-heap/GHC/Exts/Heap/InfoTableProf.hsc [new file with mode: 0644]
libraries/ghc-heap/GHC/Exts/Heap/Utils.hsc [new file with mode: 0644]
libraries/ghc-heap/LICENSE [new file with mode: 0644]
libraries/ghc-heap/Setup.hs [new file with mode: 0644]
libraries/ghc-heap/cbits/HeapPrim.cmm [new file with mode: 0644]
libraries/ghc-heap/ghc-heap.cabal.in [new file with mode: 0644]
libraries/ghc-heap/tests/Makefile [new file with mode: 0644]
libraries/ghc-heap/tests/all.T [new file with mode: 0644]
libraries/ghc-heap/tests/heap_all.hs [new file with mode: 0644]
libraries/ghc-heap/tests/heap_all.stdout [new file with mode: 0644]
libraries/ghci/GHCi/InfoTable.hsc
libraries/ghci/GHCi/Message.hs
libraries/ghci/ghci.cabal.in
rts/Heap.c [new file with mode: 0644]
rts/PrimOps.cmm
rts/rts.cabal.in
testsuite/tests/ghc-api/T4891/T4891.hs