Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
A disassembler for ByteCode objects as used by GHCi.
Synopsis
- toBytes :: Word -> [Word] -> ByteString
- disassemble :: forall box. [box] -> [Word] -> ByteString -> [BCI box]
- data BCI box
- = BCISTKCHECK Word
- | BCIPUSH_L Word16
- | BCIPUSH_LL Word16 Word16
- | BCIPUSH_LLL Word16 Word16 Word16
- | BCIPUSH_G box
- | BCIPUSH_ALTS box
- | BCIPUSH_ALTS_P box
- | BCIPUSH_ALTS_N box
- | BCIPUSH_ALTS_F box
- | BCIPUSH_ALTS_D box
- | BCIPUSH_ALTS_L box
- | BCIPUSH_ALTS_V box
- | BCIPUSH_UBX [Word]
- | BCIPUSH_APPLY_N
- | BCIPUSH_APPLY_F
- | BCIPUSH_APPLY_D
- | BCIPUSH_APPLY_L
- | BCIPUSH_APPLY_V
- | BCIPUSH_APPLY_P
- | BCIPUSH_APPLY_PP
- | BCIPUSH_APPLY_PPP
- | BCIPUSH_APPLY_PPPP
- | BCIPUSH_APPLY_PPPPP
- | BCIPUSH_APPLY_PPPPPP
- | BCISLIDE Word16 Word16
- | BCIALLOC_AP Word16
- | BCIALLOC_AP_NOUPD Word16
- | BCIALLOC_PAP Word16 Word16
- | BCIMKAP Word16 Word16
- | BCIMKPAP Word16 Word16
- | BCIUNPACK Word16
- | BCIPACK Word Word16
- | BCITESTLT_I Int Int
- | BCITESTEQ_I Int Int
- | BCITESTLT_F Word Int
- | BCITESTEQ_F Word Int
- | BCITESTLT_D Word Int
- | BCITESTEQ_D Word Int
- | BCITESTLT_P Word16 Int
- | BCITESTEQ_P Word16 Int
- | BCICASEFAIL
- | BCIJMP
- | BCICCALL Word
- | BCISWIZZLE Word16 Int16
- | BCIENTER
- | BCIRETURN
- | BCIRETURN_P
- | BCIRETURN_N
- | BCIRETURN_F
- | BCIRETURN_D
- | BCIRETURN_L
- | BCIRETURN_V
- | BCIBRK_FUN
- | BCITESTLT_W Word Int
- | BCITESTEQ_W Word Int
- | BCI_DECODE_ERROR Word16
Documentation
toBytes :: Word -> [Word] -> ByteString Source #
Converts the first n
bytes of this list of Words to a ByteString.
disassemble :: forall box. [box] -> [Word] -> ByteString -> [BCI box] Source #
Given a list of pointers, a list of literals and a ByteString containing byte code instructions, disassembles them into a list of byte code instructions.
The various byte code instructions that GHCi supports.
Instances
Functor BCI Source # | |
Foldable BCI Source # | |
Defined in GHC.Disassembler fold :: Monoid m => BCI m -> m # foldMap :: Monoid m => (a -> m) -> BCI a -> m # foldr :: (a -> b -> b) -> b -> BCI a -> b # foldr' :: (a -> b -> b) -> b -> BCI a -> b # foldl :: (b -> a -> b) -> b -> BCI a -> b # foldl' :: (b -> a -> b) -> b -> BCI a -> b # foldr1 :: (a -> a -> a) -> BCI a -> a # foldl1 :: (a -> a -> a) -> BCI a -> a # elem :: Eq a => a -> BCI a -> Bool # maximum :: Ord a => BCI a -> a # | |
Traversable BCI Source # | |
Show box => Show (BCI box) Source # | |