ghc-debug-common-0.6.0.0: Connect to a socket created by ghc-debug-stub and analyse the heap of the debuggee program.
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Debug.Types.Ptr

Description

Data types for representing different pointers and raw information All pointers are stored in little-endian to make arithmetic easier.

We have to send and recieve the pointers in big endian though. This conversion is dealt with in the Binary instance for ClosurePtr and then the other pointers are derived from this instance using DerivingVia

Synopsis

InfoTables

Closures

newtype ClosurePtr Source #

Bundled Patterns

pattern ClosurePtr :: Word64 -> ClosurePtr 

Operations on ClosurePtr

heapAlloced :: ClosurePtr -> Bool Source #

Check if the ClosurePtr is block allocated or not TODO: MP: These numbers are hard-coded from what mblock_address_space.begin and mblock_address_space.end were when I inspected them in gdb. I don't know if they are always the same of should be queried from the debuggee

Blocks

newtype BlockPtr Source #

Constructors

BlockPtr Word64 

Instances

Instances details
Show BlockPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Binary BlockPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Methods

put :: BlockPtr -> Put #

get :: Get BlockPtr #

putList :: [BlockPtr] -> Put #

Eq BlockPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Ord BlockPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Hashable BlockPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Methods

hashWithSalt :: Int -> BlockPtr -> Int #

hash :: BlockPtr -> Int #

data RawBlock Source #

Instances

Instances details
Show RawBlock Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Binary RawBlock Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Methods

put :: RawBlock -> Put #

get :: Get RawBlock #

putList :: [RawBlock] -> Put #

extractFromBlock :: ClosurePtr -> RawBlock -> RawClosure Source #

Invariant: ClosurePtr is within the range of the block The RawClosure this returns is actually the tail of the whole block, this is fine because the memory for each block is only allocated once due to how BS.drop is implemented via pointer arithmetic.

Stacks

newtype StackPtr Source #

Constructors

StackPtr Word64 

Instances

Instances details
Show StackPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Binary StackPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Methods

put :: StackPtr -> Put #

get :: Get StackPtr #

putList :: [StackPtr] -> Put #

Eq StackPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Ord StackPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Hashable StackPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Methods

hashWithSalt :: Int -> StackPtr -> Int #

hash :: StackPtr -> Int #

newtype RawStack Source #

Constructors

RawStack ByteString 

Instances

Instances details
Show RawStack Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Eq RawStack Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Ord RawStack Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Bitmaps

newtype PtrBitmap Source #

A bitmap that records whether each field of a stack frame is a pointer.

Constructors

PtrBitmap (Array Int Bool) 

Instances

Instances details
Show PtrBitmap Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Binary PtrBitmap Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

traversePtrBitmap :: Monad m => (Bool -> m a) -> PtrBitmap -> m [a] Source #

Constants

newtype CCSPtr Source #

Constructors

CCSPtr Word64 

Instances

Instances details
Show CCSPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Binary CCSPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Methods

put :: CCSPtr -> Put #

get :: Get CCSPtr #

putList :: [CCSPtr] -> Put #

Eq CCSPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Methods

(==) :: CCSPtr -> CCSPtr -> Bool #

(/=) :: CCSPtr -> CCSPtr -> Bool #

Ord CCSPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Hashable CCSPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Methods

hashWithSalt :: Int -> CCSPtr -> Int #

hash :: CCSPtr -> Int #

newtype CCPtr Source #

Constructors

CCPtr Word64 

Instances

Instances details
Show CCPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Methods

showsPrec :: Int -> CCPtr -> ShowS #

show :: CCPtr -> String #

showList :: [CCPtr] -> ShowS #

Binary CCPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Methods

put :: CCPtr -> Put #

get :: Get CCPtr #

putList :: [CCPtr] -> Put #

Eq CCPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Methods

(==) :: CCPtr -> CCPtr -> Bool #

(/=) :: CCPtr -> CCPtr -> Bool #

Ord CCPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Methods

compare :: CCPtr -> CCPtr -> Ordering #

(<) :: CCPtr -> CCPtr -> Bool #

(<=) :: CCPtr -> CCPtr -> Bool #

(>) :: CCPtr -> CCPtr -> Bool #

(>=) :: CCPtr -> CCPtr -> Bool #

max :: CCPtr -> CCPtr -> CCPtr #

min :: CCPtr -> CCPtr -> CCPtr #

Hashable CCPtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Methods

hashWithSalt :: Int -> CCPtr -> Int #

hash :: CCPtr -> Int #

Other utility