forked from nomeata/ghc-heap-view
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ghc-heap-view.cabal
95 lines (89 loc) · 3.09 KB
/
ghc-heap-view.cabal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Name: ghc-heap-view
Version: 0.6.2
Synopsis: Extract the heap representation of Haskell values and thunks
Description:
This library provides functions to introspect the Haskell heap, for example
to investigate sharing and lazy evaluation. As this is tied to the internals
of the compiler, it only works with specific versions. This version supports,
GHC 8.8. For GHC 8.6 use version 0.6.0. For older GHC versions see
ghc-heap-view-0.5.10.
.
It has been inspired by (and taken code from) the vacuum package and the GHCi
debugger, but also allows to investigate thunks and other closures.
.
This package also provides a new GHCi-command, @:printHeap@, which allows you
to inspect the current heap representation of a value, including sharing and
cyclic references. To enable the command, you need to load the included ghci
script or add it to @~/.ghci@, as explained by @cabal install@. Once it is
set up, you can do this:
.
>> let value = "A Value"
>> let x = (value, if head value == 'A' then value else "", cycle [True, False])
>> :printHeap x
>let x1 = _bco
> x21 = []
>in (x1,_bco,_bco)
>> length (take 100 (show x)) `seq` return () -- evaluate everything
>> :printHeap x
>let x1 = "A Value"
> x16 = True : False : x16
>in (x1,x1,x16)
.
You can change the maximum recursion depth using @:setPrintHeapDepth@:
.
>> :setPrintHeapDepth 3
>> :printHeap x
>let x1 = C# 'A' : ... : ...
>in (x1,x1,True : ... : ...)
.
If the view is impaired by blackholes (written @_bh@), running
@System.Mem.performGC@ usually helps.
.
The work on this package has been supported by the Deutsche Telekom Stiftung
(<http://telekom-stiftung.de>).
tested-with: GHC == 8.6.1, GHC == 8.6.2, GHC == 8.6.3, GHC == 8.6.4, GHC == 8.6.5, GHC == 8.8.1, GHC == 8.10.1
License: BSD3
License-file: LICENSE
Author: Joachim Breitner, Dennis Felsing
Maintainer: Joachim Breitner <[email protected]>
Copyright: 2012-2019 Joachim Breitner
bug-reports: https://github.com/nomeata/ghc-heap-view
Category: Debug, GHC
Build-type: Custom
Cabal-version: 1.24
Extra-source-files: Demo.hs
data-files: ghci
Flag prim-supports-any
Description: The used GHC supports Any as an argument to foreign prim functions (GHC ticket #5931)
Default: False
custom-setup
setup-depends: base
setup-depends: filepath
setup-depends: Cabal >= 1.24 && < 3.3
Library
Default-Language: Haskell2010
Exposed-modules:
GHC.HeapView
GHC.AssertNF
GHC.Disassembler
GHC.HeapView.Debug
Build-depends:
base >= 4.12 && < 4.15,
ghc-heap,
containers,
transformers,
template-haskell,
bytestring >= 0.10,
binary
Hs-source-dirs: src/
Ghc-options: -Wall
test-suite Test
type: exitcode-stdio-1.0
main-is: Test.hs
build-depends: base, ghc-heap-view, deepseq
default-language: Haskell2010
Ghc-options: -Wall -O0
source-repository head
type: git
location: git://git.nomeata.de/ghc-heap-view.git
subdir: Cabal