module GHC.Debug.Client
(
Debuggee
, DebugM
, debuggeeRun
, debuggeeConnect
, debuggeeClose
, withDebuggeeRun
, withDebuggeeConnect
, socketDirectory
, snapshotRun
, run
, runTrace
, runAnalysis
, pause
, fork
, pauseThen
, resume
, pausePoll
, withPause
, version
, gcRoots
, allBlocks
, getSourceInfo
, savedObjects
, precacheBlocks
, dereferenceClosure
, dereferenceClosures
, dereferenceStack
, dereferencePapPayload
, dereferenceConDesc
, dereferenceInfoTable
, Quadtraversable(..)
, buildHeapGraph
, multiBuildHeapGraph
, HG.HeapGraph(..)
, HG.HeapGraphEntry(..)
, HG.ppHeapGraph
, traceWrite
, traceMsg
, saveCache
, loadCache
, module GHC.Debug.Types.Closures
, SourceInformation(..)
, RawBlock(..)
, BlockPtr
, StackPtr
, ClosurePtr
, InfoTablePtr
, HG.StackHI
, HG.PapHI
, HG.HeapGraphIndex
) where
import GHC.Debug.Types
import GHC.Debug.Types.Closures
import GHC.Debug.Convention (socketDirectory)
import GHC.Debug.Client.Monad
import GHC.Debug.Client.Query
import qualified GHC.Debug.Types.Graph as HG
import Data.List.NonEmpty (NonEmpty)
derefFuncM :: HG.DerefFunction DebugM Size
derefFuncM :: DerefFunction DebugM Size
derefFuncM ClosurePtr
c = do
SizedClosure
c' <- ClosurePtr -> DebugM SizedClosure
dereferenceClosure ClosurePtr
c
forall (m :: * -> * -> * -> * -> *) (f :: * -> *) a b c d e g h i.
(Quadtraversable m, Applicative f) =>
(a -> f b)
-> (c -> f d)
-> (e -> f g)
-> (h -> f i)
-> m a c e h
-> f (m b d g i)
quadtraverse PayloadCont -> DebugM PapPayload
dereferencePapPayload ConstrDescCont -> DebugM ConstrDesc
dereferenceConDesc StackCont -> DebugM StackFrames
dereferenceStack forall (f :: * -> *) a. Applicative f => a -> f a
pure SizedClosure
c'
buildHeapGraph :: Maybe Int -> ClosurePtr -> DebugM (HG.HeapGraph Size)
buildHeapGraph :: Maybe Int -> ClosurePtr -> DebugM (HeapGraph Size)
buildHeapGraph = forall (m :: * -> *) a.
MonadFix m =>
DerefFunction m a -> Maybe Int -> ClosurePtr -> m (HeapGraph a)
HG.buildHeapGraph DerefFunction DebugM Size
derefFuncM
multiBuildHeapGraph :: Maybe Int -> NonEmpty ClosurePtr -> DebugM (HG.HeapGraph Size)
multiBuildHeapGraph :: Maybe Int -> NonEmpty ClosurePtr -> DebugM (HeapGraph Size)
multiBuildHeapGraph = forall (m :: * -> *) a.
MonadFix m =>
DerefFunction m a
-> Maybe Int -> NonEmpty ClosurePtr -> m (HeapGraph a)
HG.multiBuildHeapGraph DerefFunction DebugM Size
derefFuncM
runAnalysis :: DebugM a -> (a -> IO r) -> Debuggee -> IO r
runAnalysis :: forall a r. DebugM a -> (a -> IO r) -> Debuggee -> IO r
runAnalysis DebugM a
a a -> IO r
k Debuggee
e = do
Debuggee -> IO ()
pause Debuggee
e
a
r <- forall a. Debuggee -> DebugM a -> IO a
run Debuggee
e DebugM a
a
Debuggee -> IO ()
resume Debuggee
e
a -> IO r
k a
r