ghc-debug-client-0.4.0.0: Useful functions for writing heap analysis tools which use ghc-debug.
Safe HaskellSafe-Inferred
LanguageHaskell2010

GHC.Debug.Client.Monad

Synopsis

Documentation

class (MonadFail m, Monad m) => DebugMonad m where Source #

Associated Types

type DebugEnv m Source #

Methods

request :: (Show resp, Typeable resp) => Request resp -> m resp Source #

requestBlock :: (Show resp, Typeable resp) => BlockCacheRequest resp -> m resp Source #

traceMsg :: String -> m () Source #

printRequestLog :: DebugEnv m -> IO () Source #

runDebug :: DebugEnv m -> m a -> IO a Source #

runDebugTrace :: DebugEnv m -> m a -> IO (a, [String]) Source #

newEnv :: Tracer IO String -> Mode -> IO (DebugEnv m) Source #

saveCache :: FilePath -> m () Source #

loadCache :: FilePath -> m () Source #

unsafeLiftIO :: IO a -> m a Source #

run :: Debuggee -> DebugM a -> IO a Source #

Run a DebugM a in the given environment.

traceWrite :: DebugMonad m => Show a => a -> m () Source #

Running/Connecting to a debuggee

withDebuggeeRun Source #

Arguments

:: FilePath

path to executable to run as the debuggee

-> FilePath

filename of socket (e.g. "/tmp/ghc-debug")

-> (Debuggee -> IO a) 
-> IO a 

Bracketed version of debuggeeRun. Runs a debuggee, connects to it, runs the action, kills the process, then closes the debuggee.

withDebuggeeConnect Source #

Arguments

:: FilePath

filename of socket (e.g. "/tmp/ghc-debug")

-> (Debuggee -> IO a) 
-> IO a 

Bracketed version of debuggeeConnect. Connects to a debuggee, runs the action, then closes the debuggee.

debuggeeRun Source #

Arguments

:: FilePath

path to executable to run as the debuggee

-> FilePath

filename of socket (e.g. "/tmp/ghc-debug")

-> IO Debuggee 

Run a debuggee and connect to it. Use debuggeeClose when you're done.

debuggeeConnectWithTracer Source #

Arguments

:: Tracer IO String 
-> FilePath

filename of socket (e.g. "/tmp/ghc-debug")

-> IO Debuggee 

Connect to a debuggee on the given socket. Use debuggeeClose when you're done.

debuggeeClose :: Debuggee -> IO () Source #

Close the connection to the debuggee.

Snapshot run

snapshotInit :: FilePath -> IO Debuggee Source #

Create a debuggee by loading a snapshot created by snapshot.

snapshotRun :: FilePath -> (Debuggee -> IO a) -> IO a Source #

Start an analysis session using a snapshot. This will not connect to a debuggee. The snapshot is created by snapshot.

Logging