ghc-debug-common-0.2.1.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 

Instances

Instances details
Show ClosurePtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Binary ClosurePtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Eq ClosurePtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Ord ClosurePtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

Hashable ClosurePtr Source # 
Instance details

Defined in GHC.Debug.Types.Ptr

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

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

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

Other utility