| ... |
... |
@@ -15,7 +15,7 @@ import Data.Function (($), id, (.)) |
|
15
|
15
|
import Data.Tuple (fst, snd, uncurry)
|
|
16
|
16
|
import Data.Bool (Bool, otherwise, not, (&&))
|
|
17
|
17
|
import Data.Int (Int)
|
|
18
|
|
-import Data.Word (Word, Word16)
|
|
|
18
|
+import Data.Word (Word)
|
|
19
|
19
|
import Data.Maybe (Maybe, maybe)
|
|
20
|
20
|
import Data.Either (Either, either)
|
|
21
|
21
|
import Data.List (length, (++), map, zipWith, take, drop, replicate)
|
| ... |
... |
@@ -24,12 +24,10 @@ import Data.ByteString (ByteString, unpack) |
|
24
|
24
|
import Data.ByteString.Short (ShortByteString)
|
|
25
|
25
|
import Data.IntMap (IntMap)
|
|
26
|
26
|
import Data.IntMap qualified as IntMap (toList)
|
|
27
|
|
-import Data.Array.IArray (IArray, bounds, indices, elems)
|
|
28
|
|
-import Data.Array.Unboxed (UArray)
|
|
|
27
|
+import Data.Array (bounds, indices, elems)
|
|
29
|
28
|
import Numeric (showHex)
|
|
30
|
29
|
import Text.Show (show)
|
|
31
|
30
|
import System.IO (IO, FilePath)
|
|
32
|
|
-import Foreign.Storable (Storable)
|
|
33
|
31
|
import GHC.Data.Strict qualified as Strict (Maybe, maybe)
|
|
34
|
32
|
import GHC.Data.FastString (unpackFS)
|
|
35
|
33
|
import GHC.Data.FlatBag (FlatBag, elemsFlatBag)
|
| ... |
... |
@@ -78,7 +76,6 @@ import GHC.ByteCode.Breakpoints |
|
78
|
76
|
import GHC.ByteCode.Binary (OnDiskModuleByteCode (..))
|
|
79
|
77
|
import GHC.ByteCode.Serialize (readOnDiskModuleByteCode)
|
|
80
|
78
|
import GHC.Driver.Env.Types (HscEnv)
|
|
81
|
|
-import GHCi.ResolvedBCO (BCOByteArray, fromBCOByteArray)
|
|
82
|
79
|
import GHCi.FFI (FFIType)
|
|
83
|
80
|
import GHCi.Message (ConInfoTable (..))
|
|
84
|
81
|
|
| ... |
... |
@@ -132,8 +129,6 @@ pprByteCodeObject currentModule byteCodeObject = case byteCodeObject of |
|
132
|
129
|
-> entry (text "ordinary object" <+> ppr unlinkedBCOName <> text ":") $
|
|
133
|
130
|
vcat [
|
|
134
|
131
|
pprArity $ unlinkedBCOArity,
|
|
135
|
|
- pprInstructions $ unlinkedBCOInstrs,
|
|
136
|
|
- pprBitmap $ unlinkedBCOBitmap,
|
|
137
|
132
|
pprLiterals currentModule $ unlinkedBCOLits,
|
|
138
|
133
|
pprPointers currentModule $ unlinkedBCOPtrs
|
|
139
|
134
|
]
|
| ... |
... |
@@ -155,14 +150,6 @@ pprByteCodeObject currentModule byteCodeObject = case byteCodeObject of |
|
155
|
150
|
pprArity :: Int -> SDoc
|
|
156
|
151
|
pprArity = entry (text "arity:") . ppr
|
|
157
|
152
|
|
|
158
|
|
--- | […]
|
|
159
|
|
-pprInstructions :: BCOByteArray Word16 -> SDoc
|
|
160
|
|
-pprInstructions = entry (text "instructions:") . pprBCOByteArray
|
|
161
|
|
-
|
|
162
|
|
--- | […]
|
|
163
|
|
-pprBitmap :: BCOByteArray Word -> SDoc
|
|
164
|
|
-pprBitmap = entry (text "bitmap:") . pprBCOByteArray
|
|
165
|
|
-
|
|
166
|
153
|
-- | […]
|
|
167
|
154
|
pprDataConstructorName :: Name -> SDoc
|
|
168
|
155
|
pprDataConstructorName = entry (text "data constructor name:") . ppr
|
| ... |
... |
@@ -530,11 +517,6 @@ pprObjectFileContent ix = entry (text "file" <+> ppr ix <> text ":") . |
|
530
|
517
|
pprByteString :: ByteString -> SDoc
|
|
531
|
518
|
pprByteString = pprFixedSizeNaturalList . unpack
|
|
532
|
519
|
|
|
533
|
|
--- | […]
|
|
534
|
|
-pprBCOByteArray :: (Integral a, FiniteBits a, Storable a, IArray UArray a) =>
|
|
535
|
|
- BCOByteArray a -> SDoc
|
|
536
|
|
-pprBCOByteArray = pprFixedSizeNaturalList . elems . fromBCOByteArray
|
|
537
|
|
-
|
|
538
|
520
|
-- | […]
|
|
539
|
521
|
pprFixedSizeNaturalList :: (Integral a, FiniteBits a) => [a] -> SDoc
|
|
540
|
522
|
pprFixedSizeNaturalList [] = text "<empty>"
|