GHC.Runtime.Interpreter

ghc-9.14.0.20251028: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.Runtime.Interpreter

Contents

- High-level interface to the interpreter
- The object-code linker
- Reexport for convenience

Description

Interacting with the iserv interpreter, whether it is running on an external process or in the current process.

Synopsis

- module GHC.Runtime.Interpreter.Types
- evalStmt :: Interp -> EvalOpts -> EvalExpr ForeignHValue -> IO (EvalStatus_ [ForeignHValue] [HValueRef])
- data EvalStatus_ a b
  - = EvalComplete Word64 (EvalResult a)
  - | EvalBreak HValueRef (Maybe EvalBreakpoint) (RemoteRef (ResumeContext b)) (RemotePtr CostCentreStack)
- type EvalStatus a = EvalStatus_ a a
- data EvalResult a
  - = EvalException SerializableException
  - | EvalSuccess a
- data EvalExpr a
  - = EvalThis a
  - | EvalApp (EvalExpr a) (EvalExpr a)
- resumeStmt :: Interp -> EvalOpts -> ForeignRef (ResumeContext [HValueRef]) -> IO (EvalStatus_ [ForeignHValue] [HValueRef])
- abandonStmt :: Interp -> ForeignRef (ResumeContext [HValueRef]) -> IO ()
- evalIO :: Interp -> ForeignHValue -> IO ()
- evalString :: Interp -> ForeignHValue -> IO String
- evalStringToIOString :: Interp -> ForeignHValue -> String -> IO String
- mallocData :: Interp -> ByteString -> IO (RemotePtr ())
- createBCOs :: Interp -> [ResolvedBCO] -> IO [HValueRef]
- addSptEntry :: Interp -> Fingerprint -> ForeignHValue -> IO ()
- mkCostCentres :: Interp -> String -> [(String, String)] -> IO [RemotePtr CostCentre]
- costCentreStackInfo :: Interp -> RemotePtr CostCentreStack -> IO [String]
- newBreakArray :: Interp -> Int -> IO (ForeignRef BreakArray)
- storeBreakpoint :: Interp -> ForeignRef BreakArray -> Int -> Int -> IO ()
- breakpointStatus :: Interp -> ForeignRef BreakArray -> Int -> IO Bool
- getBreakpointVar :: Interp -> ForeignHValue -> Int -> IO (Maybe ForeignHValue)
- getClosure :: Interp -> ForeignHValue -> IO (GenClosure ForeignHValue)
- whereFrom :: Interp -> ForeignHValue -> IO (Maybe InfoProv)
- getModBreaks :: HomeModInfo -> Maybe InternalModBreaks
- readIModBreaks :: HomeUnitGraph -> InternalBreakpointId -> IO InternalModBreaks
- readIModBreaksMaybe :: HomeUnitGraph -> Module -> IO (Maybe InternalModBreaks)
- readIModModBreaks :: HomeUnitGraph -> Module -> IO ModBreaks
- seqHValue :: Interp -> UnitEnv -> ForeignHValue -> IO (EvalResult ())
- evalBreakpointToId :: EvalBreakpoint -> InternalBreakpointId
- initObjLinker :: Interp -> IO ()
- lookupSymbol :: forall (s :: SuffixOrInterpreted). Interp -> InterpSymbol s -> IO (Maybe (Ptr ()))
- lookupSymbolInDLL :: forall (s :: SuffixOrInterpreted). Interp -> RemotePtr LoadedDLL -> InterpSymbol s -> IO (Maybe (Ptr ()))
- lookupClosure :: forall (s :: SuffixOrInterpreted). Interp -> InterpSymbol s -> IO (Maybe HValueRef)
- loadDLL :: Interp -> String -> IO (Either String (RemotePtr LoadedDLL))
- loadArchive :: Interp -> String -> IO ()
- loadObj :: Interp -> String -> IO ()
- unloadObj :: Interp -> String -> IO ()
- addLibrarySearchPath :: Interp -> String -> IO (Ptr ())
- removeLibrarySearchPath :: Interp -> Ptr () -> IO Bool
- resolveObjs :: Interp -> IO SuccessFlag
- findSystemLibrary :: Interp -> String -> IO (Maybe String)
- interpCmd :: Binary a => Interp -> Message a -> IO a
- withExtInterp :: ExceptionMonad m => ExtInterp -> (forall d. ExtInterpInstance d -> m a) -> m a
- withExtInterpStatus :: forall {k} m (a :: k). ExtInterp -> (forall d. ExtInterpStatusVar d -> m a) -> m a
- withIServ :: ExceptionMonad m => IServ -> (ExtInterpInstance () -> m a) -> m a
- withJSInterp :: ExceptionMonad m => JSInterp -> (ExtInterpInstance JSInterpExtra -> m a) -> m a
- stopInterp :: Interp -> IO ()
- purgeLookupSymbolCache :: Interp -> IO ()
- freeReallyRemoteRef :: ExtInterpInstance d -> RemoteRef a -> IO ()
- freeHValueRefs :: Interp -> [HValueRef] -> IO ()
- mkFinalizedHValue :: Interp -> RemoteRef a -> IO (ForeignRef a)
- wormhole :: Interp -> ForeignRef a -> IO a
- wormholeRef :: Interp -> RemoteRef a -> IO a
- fromEvalResult :: EvalResult a -> IO a
- data Message a where
  - Shutdown :: Message ()
  - RtsRevertCAFs :: Message ()
  - InitLinker :: Message ()
  - LookupSymbol :: String -> Message (Maybe (RemotePtr ()))
  - LookupSymbolInDLL :: RemotePtr LoadedDLL -> String -> Message (Maybe (RemotePtr ()))
  - LookupClosure :: String -> Message (Maybe HValueRef)
  - LoadDLL :: String -> Message (Either String (RemotePtr LoadedDLL))
  - LoadArchive :: String -> Message ()
  - LoadObj :: String -> Message ()
  - UnloadObj :: String -> Message ()
  - AddLibrarySearchPath :: String -> Message (RemotePtr ())
  - RemoveLibrarySearchPath :: RemotePtr () -> Message Bool
  - ResolveObjs :: Message Bool
  - FindSystemLibrary :: String -> Message (Maybe String)
  - CreateBCOs :: [ResolvedBCO] -> Message [HValueRef]
  - FreeHValueRefs :: [HValueRef] -> Message ()
  - AddSptEntry :: Fingerprint -> HValueRef -> Message ()
  - MallocData :: ByteString -> Message (RemotePtr ())
  - MallocStrings :: [ByteString] -> Message [RemotePtr ()]
  - PrepFFI :: [FFIType] -> FFIType -> Message (RemotePtr C_ffi_cif)
  - FreeFFI :: RemotePtr C_ffi_cif -> Message ()
  - MkConInfoTable :: !ConInfoTable -> Message (RemotePtr StgInfoTable)
  - EvalStmt :: EvalOpts -> EvalExpr HValueRef -> Message (EvalStatus_ [HValueRef] [HValueRef])
  - ResumeStmt :: EvalOpts -> RemoteRef (ResumeContext [HValueRef]) -> Message (EvalStatus_ [HValueRef] [HValueRef])
  - AbandonStmt :: RemoteRef (ResumeContext [HValueRef]) -> Message ()
  - EvalString :: HValueRef -> Message (EvalResult String)
  - EvalStringToString :: HValueRef -> String -> Message (EvalResult String)
  - EvalIO :: HValueRef -> Message (EvalResult ())
  - MkCostCentres :: String -> [(String, String)] -> Message [RemotePtr CostCentre]
  - CostCentreStackInfo :: RemotePtr CostCentreStack -> Message [String]
  - NewBreakArray :: Int -> Message (RemoteRef BreakArray)
  - SetupBreakpoint :: RemoteRef BreakArray -> Int -> Int -> Message ()
  - BreakpointStatus :: RemoteRef BreakArray -> Int -> Message Bool
  - GetBreakpointVar :: HValueRef -> Int -> Message (Maybe HValueRef)
  - StartTH :: Message (RemoteRef (IORef QState))
  - RunTH :: RemoteRef (IORef QState) -> HValueRef -> THResultType -> Maybe Loc -> Message (QResult ByteString)
  - RunModFinalizers :: RemoteRef (IORef QState) -> [RemoteRef (Q ())] -> Message (QResult ())
  - GetClosure :: HValueRef -> Message (GenClosure HValueRef)
  - WhereFrom :: HValueRef -> Message (Maybe InfoProv)
  - Seq :: HValueRef -> Message (EvalStatus_ () ())
  - ResumeSeq :: RemoteRef (ResumeContext ()) -> Message (EvalStatus_ () ())
- module GHC.Runtime.Interpreter.Process

# Documentation

module GHC.Runtime.Interpreter.Types

# High-level interface to the interpreter

evalStmt :: Interp -> EvalOpts -> EvalExpr ForeignHValue -> IO (EvalStatus_ [ForeignHValue] [HValueRef]) Source #

Execute an action of type `IO [a]`, returning `ForeignHValue`s for each of the results.

data EvalStatus_ a b Source #

Constructors

EvalComplete Word64 (EvalResult a) |
EvalBreak HValueRef (Maybe EvalBreakpoint) (RemoteRef (ResumeContext b)) (RemotePtr CostCentreStack) |

#### Instances

Instances details

Binary a => Binary (EvalStatus_ a b) Source # |
Instance details Defined in GHCi.Message Methods put :: EvalStatus_ a b -> Put Source # get :: Get (EvalStatus_ a b) Source # putList :: [EvalStatus_ a b] -> Put Source #
Generic (EvalStatus_ a b) Source # |
Instance details Defined in GHCi.Message Associated Types
type Rep (EvalStatus_ a b) |
Instance details Defined in GHCi.Message type Rep (EvalStatus_ a b) = D1 ('MetaData "EvalStatus_" "GHCi.Message" "ghci-9.14.0.20251028-dd3f" 'False) (C1 ('MetaCons "EvalComplete" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (EvalResult a))) :+: C1 ('MetaCons "EvalBreak" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HValueRef) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe EvalBreakpoint))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RemoteRef (ResumeContext b))) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RemotePtr CostCentreStack)))))
Methods from :: EvalStatus_ a b -> Rep (EvalStatus_ a b) x Source # to :: Rep (EvalStatus_ a b) x -> EvalStatus_ a b Source #
Show a => Show (EvalStatus_ a b) Source # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> EvalStatus_ a b -> ShowS Source # show :: EvalStatus_ a b -> String Source # showList :: [EvalStatus_ a b] -> ShowS Source #
type Rep (EvalStatus_ a b) Source # |
Instance details Defined in GHCi.Message type Rep (EvalStatus_ a b) = D1 ('MetaData "EvalStatus_" "GHCi.Message" "ghci-9.14.0.20251028-dd3f" 'False) (C1 ('MetaCons "EvalComplete" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word64) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (EvalResult a))) :+: C1 ('MetaCons "EvalBreak" 'PrefixI 'False) ((S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 HValueRef) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe EvalBreakpoint))) :*: (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RemoteRef (ResumeContext b))) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (RemotePtr CostCentreStack)))))

type EvalStatus a = EvalStatus_ a a Source #

data EvalResult a Source #

Constructors

EvalException SerializableException |
EvalSuccess a |

#### Instances

Instances details

Binary a => Binary (EvalResult a) Source # |
Instance details Defined in GHCi.Message Methods put :: EvalResult a -> Put Source # get :: Get (EvalResult a) Source # putList :: [EvalResult a] -> Put Source #
Generic (EvalResult a) Source # |
Instance details Defined in GHCi.Message Associated Types
type Rep (EvalResult a) |
Instance details Defined in GHCi.Message type Rep (EvalResult a) = D1 ('MetaData "EvalResult" "GHCi.Message" "ghci-9.14.0.20251028-dd3f" 'False) (C1 ('MetaCons "EvalException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SerializableException)) :+: C1 ('MetaCons "EvalSuccess" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))
Methods from :: EvalResult a -> Rep (EvalResult a) x Source # to :: Rep (EvalResult a) x -> EvalResult a Source #
Show a => Show (EvalResult a) Source # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> EvalResult a -> ShowS Source # show :: EvalResult a -> String Source # showList :: [EvalResult a] -> ShowS Source #
type Rep (EvalResult a) Source # |
Instance details Defined in GHCi.Message type Rep (EvalResult a) = D1 ('MetaData "EvalResult" "GHCi.Message" "ghci-9.14.0.20251028-dd3f" 'False) (C1 ('MetaCons "EvalException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SerializableException)) :+: C1 ('MetaCons "EvalSuccess" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))

data EvalExpr a Source #

We can pass simple expressions to EvalStmt, consisting of values and application. This allows us to wrap the statement to be executed in another function, which is used by GHCi to implement :set args and :set prog. It might be worthwhile to extend this little language in the future.

Constructors

EvalThis a |
EvalApp (EvalExpr a) (EvalExpr a) |

#### Instances

Instances details

Binary a => Binary (EvalExpr a) Source # |
Instance details Defined in GHCi.Message Methods put :: EvalExpr a -> Put Source # get :: Get (EvalExpr a) Source # putList :: [EvalExpr a] -> Put Source #
Generic (EvalExpr a) Source # |
Instance details Defined in GHCi.Message Associated Types
type Rep (EvalExpr a) |
Instance details Defined in GHCi.Message type Rep (EvalExpr a) = D1 ('MetaData "EvalExpr" "GHCi.Message" "ghci-9.14.0.20251028-dd3f" 'False) (C1 ('MetaCons "EvalThis" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "EvalApp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (EvalExpr a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (EvalExpr a))))
Methods from :: EvalExpr a -> Rep (EvalExpr a) x Source # to :: Rep (EvalExpr a) x -> EvalExpr a Source #
Show a => Show (EvalExpr a) Source # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> EvalExpr a -> ShowS Source # show :: EvalExpr a -> String Source # showList :: [EvalExpr a] -> ShowS Source #
type Rep (EvalExpr a) Source # |
Instance details Defined in GHCi.Message type Rep (EvalExpr a) = D1 ('MetaData "EvalExpr" "GHCi.Message" "ghci-9.14.0.20251028-dd3f" 'False) (C1 ('MetaCons "EvalThis" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)) :+: C1 ('MetaCons "EvalApp" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (EvalExpr a)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (EvalExpr a))))

resumeStmt :: Interp -> EvalOpts -> ForeignRef (ResumeContext [HValueRef]) -> IO (EvalStatus_ [ForeignHValue] [HValueRef]) Source #

abandonStmt :: Interp -> ForeignRef (ResumeContext [HValueRef]) -> IO () Source #

evalIO :: Interp -> ForeignHValue -> IO () Source #

Execute an action of type `IO ()`

evalString :: Interp -> ForeignHValue -> IO String Source #

Execute an action of type `IO String`

evalStringToIOString :: Interp -> ForeignHValue -> String -> IO String Source #

Execute an action of type `String -> IO String`

mallocData :: Interp -> ByteString -> IO (RemotePtr ()) Source #

Allocate and store the given bytes in memory, returning a pointer to the memory in the remote process.

createBCOs :: Interp -> [ResolvedBCO] -> IO [HValueRef] Source #

Create a set of BCOs that may be mutually recursive.

addSptEntry :: Interp -> Fingerprint -> ForeignHValue -> IO () Source #

mkCostCentres :: Interp -> String -> [(String, String)] -> IO [RemotePtr CostCentre] Source #

costCentreStackInfo :: Interp -> RemotePtr CostCentreStack -> IO [String] Source #

newBreakArray :: Interp -> Int -> IO (ForeignRef BreakArray) Source #

storeBreakpoint :: Interp -> ForeignRef BreakArray -> Int -> Int -> IO () Source #

breakpointStatus :: Interp -> ForeignRef BreakArray -> Int -> IO Bool Source #

getBreakpointVar :: Interp -> ForeignHValue -> Int -> IO (Maybe ForeignHValue) Source #

getClosure :: Interp -> ForeignHValue -> IO (GenClosure ForeignHValue) Source #

whereFrom :: Interp -> ForeignHValue -> IO (Maybe InfoProv) Source #

getModBreaks :: HomeModInfo -> Maybe InternalModBreaks Source #

Get the breakpoint information from the ByteCode object associated to this `HomeModInfo`.

readIModBreaks :: HomeUnitGraph -> InternalBreakpointId -> IO InternalModBreaks Source #

Read the `InternalModBreaks` of the given home `Module` (via `InternalBreakpointId`) from the `HomeUnitGraph`.

readIModBreaksMaybe :: HomeUnitGraph -> Module -> IO (Maybe InternalModBreaks) Source #

Read the `InternalModBreaks` of the given home `Module` from the `HomeUnitGraph`.

readIModModBreaks :: HomeUnitGraph -> Module -> IO ModBreaks Source #

Read the `ModBreaks` from the given module's `InternalModBreaks`

seqHValue :: Interp -> UnitEnv -> ForeignHValue -> IO (EvalResult ()) Source #

Send a Seq message to the iserv process to force a value #2950

evalBreakpointToId :: EvalBreakpoint -> InternalBreakpointId Source #

# The object-code linker

initObjLinker :: Interp -> IO () Source #

lookupSymbol :: forall (s :: SuffixOrInterpreted). Interp -> InterpSymbol s -> IO (Maybe (Ptr ())) Source #

lookupSymbolInDLL :: forall (s :: SuffixOrInterpreted). Interp -> RemotePtr LoadedDLL -> InterpSymbol s -> IO (Maybe (Ptr ())) Source #

lookupClosure :: forall (s :: SuffixOrInterpreted). Interp -> InterpSymbol s -> IO (Maybe HValueRef) Source #

loadDLL :: Interp -> String -> IO (Either String (RemotePtr LoadedDLL)) Source #

loadDLL loads a dynamic library using the OS's native linker (i.e. dlopen() on Unix, LoadLibrary() on Windows). It takes either an absolute pathname to the file, or a relative filename (e.g. "libfoo.so" or "foo.dll"). In the latter case, loadDLL searches the standard locations for the appropriate library.

loadArchive :: Interp -> String -> IO () Source #

loadObj :: Interp -> String -> IO () Source #

unloadObj :: Interp -> String -> IO () Source #

addLibrarySearchPath :: Interp -> String -> IO (Ptr ()) Source #

removeLibrarySearchPath :: Interp -> Ptr () -> IO Bool Source #

resolveObjs :: Interp -> IO SuccessFlag Source #

findSystemLibrary :: Interp -> String -> IO (Maybe String) Source #

interpCmd :: Binary a => Interp -> Message a -> IO a Source #

Run a command in the interpreter's context. With `-fexternal-interpreter`, the command is serialized and sent to an external iserv process, and the response is deserialized (hence the `Binary` constraint). With `-fno-external-interpreter` we execute the command directly here.

withExtInterp :: ExceptionMonad m => ExtInterp -> (forall d. ExtInterpInstance d -> m a) -> m a Source #

withExtInterpStatus :: forall {k} m (a :: k). ExtInterp -> (forall d. ExtInterpStatusVar d -> m a) -> m a Source #

withIServ :: ExceptionMonad m => IServ -> (ExtInterpInstance () -> m a) -> m a Source #

Grab a lock on the `IServ` and do something with it. Overloaded because this is used from TcM as well as IO.

withJSInterp :: ExceptionMonad m => JSInterp -> (ExtInterpInstance JSInterpExtra -> m a) -> m a Source #

Spawn JS interpreter if it isn't already running and execute the given action

Update the interpreter state.

stopInterp :: Interp -> IO () Source #

Stop the interpreter

purgeLookupSymbolCache :: Interp -> IO () Source #

freeReallyRemoteRef :: ExtInterpInstance d -> RemoteRef a -> IO () Source #

freeHValueRefs :: Interp -> [HValueRef] -> IO () Source #

mkFinalizedHValue :: Interp -> RemoteRef a -> IO (ForeignRef a) Source #

Creates a `ForeignRef` that will automatically release the `RemoteRef` when it is no longer referenced.

wormhole :: Interp -> ForeignRef a -> IO a Source #

Convert a `ForeignRef` to the value it references directly. This only works when the interpreter is running in the same process as the compiler, so it fails when `-fexternal-interpreter` is on.

wormholeRef :: Interp -> RemoteRef a -> IO a Source #

Convert an `RemoteRef` to the value it references directly. This only works when the interpreter is running in the same process as the compiler, so it fails when `-fexternal-interpreter` is on.

fromEvalResult :: EvalResult a -> IO a Source #

# Reexport for convenience

data Message a where Source #

A `Message a` is a message that returns a value of type `a`. These are requests sent from GHC to the server.

Constructors

Shutdown :: Message () | Exit the iserv process
RtsRevertCAFs :: Message () |
InitLinker :: Message () |
LookupSymbol :: String -> Message (Maybe (RemotePtr ())) |
LookupSymbolInDLL :: RemotePtr LoadedDLL -> String -> Message (Maybe (RemotePtr ())) |
LookupClosure :: String -> Message (Maybe HValueRef) |
LoadDLL :: String -> Message (Either String (RemotePtr LoadedDLL)) |
LoadArchive :: String -> Message () |
LoadObj :: String -> Message () |
UnloadObj :: String -> Message () |
AddLibrarySearchPath :: String -> Message (RemotePtr ()) |
RemoveLibrarySearchPath :: RemotePtr () -> Message Bool |
ResolveObjs :: Message Bool |
FindSystemLibrary :: String -> Message (Maybe String) |
CreateBCOs :: [ResolvedBCO] -> Message [HValueRef] | Create a set of BCO objects, and return HValueRefs to them See `createBCOs` in compilerGHCRuntime/Interpreter.hs. NB: this has a custom Binary behavior, see Note [Parallelize CreateBCOs serialization]
FreeHValueRefs :: [HValueRef] -> Message () | Release `HValueRef`s
AddSptEntry :: Fingerprint -> HValueRef -> Message () | Add entries to the Static Pointer Table
MallocData :: ByteString -> Message (RemotePtr ()) | Malloc some data and return a `RemotePtr` to it
MallocStrings :: [ByteString] -> Message [RemotePtr ()] |
PrepFFI :: [FFIType] -> FFIType -> Message (RemotePtr C_ffi_cif) | Calls `prepareForeignCall`
FreeFFI :: RemotePtr C_ffi_cif -> Message () | Free data previously created by `PrepFFI`
MkConInfoTable :: !ConInfoTable -> Message (RemotePtr StgInfoTable) | Create an info table for a constructor
EvalStmt :: EvalOpts -> EvalExpr HValueRef -> Message (EvalStatus_ [HValueRef] [HValueRef]) | Evaluate a statement
ResumeStmt :: EvalOpts -> RemoteRef (ResumeContext [HValueRef]) -> Message (EvalStatus_ [HValueRef] [HValueRef]) | Resume evaluation of a statement after a breakpoint
AbandonStmt :: RemoteRef (ResumeContext [HValueRef]) -> Message () | Abandon evaluation of a statement after a breakpoint
EvalString :: HValueRef -> Message (EvalResult String) | Evaluate something of type `IO String`
EvalStringToString :: HValueRef -> String -> Message (EvalResult String) | Evaluate something of type `String -> IO String`
EvalIO :: HValueRef -> Message (EvalResult ()) | Evaluate something of type `IO ()`
MkCostCentres :: String -> [(String, String)] -> Message [RemotePtr CostCentre] | Create a set of CostCentres with the same module name
CostCentreStackInfo :: RemotePtr CostCentreStack -> Message [String] | Show a `CostCentreStack` as a `[String]`
NewBreakArray :: Int -> Message (RemoteRef BreakArray) | Create a new array of breakpoint flags
SetupBreakpoint :: RemoteRef BreakArray -> Int -> Int -> Message () | Set how many times a breakpoint should be ignored also used for enable/disable
BreakpointStatus :: RemoteRef BreakArray -> Int -> Message Bool | Query the status of a breakpoint (True = enabled)
GetBreakpointVar :: HValueRef -> Int -> Message (Maybe HValueRef) | Get a reference to a free variable at a breakpoint
StartTH :: Message (RemoteRef (IORef QState)) | Start a new TH module, return a state token that should be
RunTH :: RemoteRef (IORef QState) -> HValueRef -> THResultType -> Maybe Loc -> Message (QResult ByteString) | Evaluate a TH computation. Returns a ByteString, because we have to force the result before returning it to ensure there are no errors lurking in it. The TH types don't have NFData instances, and even if they did, we have to serialize the value anyway, so we might as well serialize it to force it.
RunModFinalizers :: RemoteRef (IORef QState) -> [RemoteRef (Q ())] -> Message (QResult ()) | Run the given mod finalizers.
GetClosure :: HValueRef -> Message (GenClosure HValueRef) | Remote interface to GHC.Internal.Heap.getClosureData. This is used by the GHCi debugger to inspect values in the heap for :print and type reconstruction.
WhereFrom :: HValueRef -> Message (Maybe InfoProv) | Remote interface to GHC.InfoProv.whereFrom. This is used by the GHCi debugger to inspect the provenance of thunks for :print.
Seq :: HValueRef -> Message (EvalStatus_ () ()) | Evaluate something. This is used to support :force in GHCi.
ResumeSeq :: RemoteRef (ResumeContext ()) -> Message (EvalStatus_ () ()) | Resume forcing a free variable in a breakpoint (#2950)

#### Instances

Instances details

Show (Message a) Source # |
Instance details Defined in GHCi.Message Methods showsPrec :: Int -> Message a -> ShowS Source # show :: Message a -> String Source # showList :: [Message a] -> ShowS Source #

module GHC.Runtime.Interpreter.Process