| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Remote GHCi message types and serialization.
For details on Remote GHCi, see Note [Remote GHCi] in compilerGHCRuntime/Interpreter.hs.
A Message a is a message that returns a value of type a. These are requests sent from GHC to the server.
| 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 |
| FreeHValueRefs :: [HValueRef] -> Message () | Release |
| AddSptEntry :: Fingerprint -> HValueRef -> Message () | Add entries to the Static Pointer Table |
| MallocData :: ByteString -> Message (RemotePtr ()) | Malloc some data and return a |
| MallocStrings :: [ByteString] -> Message [RemotePtr ()] | |
| PrepFFI :: [FFIType] -> FFIType -> Message (RemotePtr C_ffi_cif) | Calls |
| FreeFFI :: RemotePtr C_ffi_cif -> Message () | Free data previously created by |
| MkConInfoTable :: Bool -> Int -> Int -> Int -> Int -> ByteString -> 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 |
| EvalStringToString :: HValueRef -> String -> Message (EvalResult String) | Evaluate something of type |
| EvalIO :: HValueRef -> Message (EvalResult ()) | Evaluate something of type |
| MkCostCentres :: String -> [(String, String)] -> Message [RemotePtr CostCentre] | Create a set of CostCentres with the same module name |
| CostCentreStackInfo :: RemotePtr CostCentreStack -> Message [String] | Show a |
| 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.Exts.Heap.getClosureData. This is used by the GHCi debugger to inspect values in the heap for :print and type reconstruction. |
| 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) |
| NewBreakModule :: String -> Message (RemotePtr BreakModule) | Allocate a string for a breakpoint module name. This uses an empty dummy type because |
Messages sent back to GHC from GHCi.TH, to implement the methods of Quasi. For an overview of how TH works with Remote GHCi, see Note [Remote Template Haskell] in GHCi.TH.
Template Haskell return values
| QDone a | RunTH finished successfully; return value follows |
| QException String | RunTH threw an exception |
| QFail String | RunTH called |
data EvalStatus_ a b Source
| EvalComplete Word64 (EvalResult a) | |
| EvalBreak HValueRef (Maybe EvalBreakpoint) (RemoteRef (ResumeContext b)) (RemotePtr CostCentreStack) |
| Binary a => Binary (EvalStatus_ a b) Source | |||||
Defined in GHCi.Message Methodsput :: EvalStatus_ a b -> Put Source get :: Get (EvalStatus_ a b) Source putList :: [EvalStatus_ a b] -> Put Source | |||||
| Generic (EvalStatus_ a b) Source | |||||
Defined in GHCi.Message Associated Types
Methodsfrom :: EvalStatus_ a b -> Rep (EvalStatus_ a b) x to :: Rep (EvalStatus_ a b) x -> EvalStatus_ a b | |||||
| Show a => Show (EvalStatus_ a b) Source | |||||
Defined in GHCi.Message MethodsshowsPrec :: Int -> EvalStatus_ a b -> ShowS show :: EvalStatus_ a b -> String showList :: [EvalStatus_ a b] -> ShowS | |||||
| type Rep (EvalStatus_ a b) Source | |||||
Defined in GHCi.Message type Rep (EvalStatus_ a b) = D1 ('MetaData "EvalStatus_" "GHCi.Message" "ghci-9.12.1-fde5" '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
| EvalException SerializableException | |
| EvalSuccess a |
| Binary a => Binary (EvalResult a) Source | |||||
Defined in GHCi.Message Methodsput :: EvalResult a -> Put Source get :: Get (EvalResult a) Source putList :: [EvalResult a] -> Put Source | |||||
| Generic (EvalResult a) Source | |||||
Defined in GHCi.Message Associated Types
| |||||
| Show a => Show (EvalResult a) Source | |||||
Defined in GHCi.Message MethodsshowsPrec :: Int -> EvalResult a -> ShowS show :: EvalResult a -> String showList :: [EvalResult a] -> ShowS | |||||
| type Rep (EvalResult a) Source | |||||
Defined in GHCi.Message type Rep (EvalResult a) = D1 ('MetaData "EvalResult" "GHCi.Message" "ghci-9.12.1-fde5" '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))) | |||||
| EvalOpts | |
Fields
| |
| Binary EvalOpts Source | |||||
| Generic EvalOpts Source | |||||
Defined in GHCi.Message Associated Types
| |||||
| Show EvalOpts Source | |||||
| type Rep EvalOpts Source | |||||
Defined in GHCi.Message type Rep EvalOpts = D1 ('MetaData "EvalOpts" "GHCi.Message" "ghci-9.12.1-fde5" 'False) (C1 ('MetaCons "EvalOpts" 'PrefixI 'True) ((S1 ('MetaSel ('Just "useSandboxThread") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "singleStep") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "breakOnException") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "breakOnError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) | |||||
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.
| Binary a => Binary (EvalExpr a) Source | |||||
| Generic (EvalExpr a) Source | |||||
Defined in GHCi.Message Associated Types
| |||||
| Show a => Show (EvalExpr a) Source | |||||
| type Rep (EvalExpr a) Source | |||||
Defined in GHCi.Message type Rep (EvalExpr a) = D1 ('MetaData "EvalExpr" "GHCi.Message" "ghci-9.12.1-fde5" '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)))) | |||||
data EvalBreakpoint Source
| EvalBreakpoint | |
Fields
| |
| Binary EvalBreakpoint Source | |||||
Defined in GHCi.Message Methodsput :: EvalBreakpoint -> Put Source get :: Get EvalBreakpoint Source putList :: [EvalBreakpoint] -> Put Source | |||||
| Generic EvalBreakpoint Source | |||||
Defined in GHCi.Message Associated Types
| |||||
| Show EvalBreakpoint Source | |||||
Defined in GHCi.Message MethodsshowsPrec :: Int -> EvalBreakpoint -> ShowS show :: EvalBreakpoint -> String showList :: [EvalBreakpoint] -> ShowS | |||||
| type Rep EvalBreakpoint Source | |||||
Defined in GHCi.Message type Rep EvalBreakpoint = D1 ('MetaData "EvalBreakpoint" "GHCi.Message" "ghci-9.12.1-fde5" 'False) (C1 ('MetaCons "EvalBreakpoint" 'PrefixI 'True) ((S1 ('MetaSel ('Just "eb_tick_mod") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "eb_tick_index") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)) :*: (S1 ('MetaSel ('Just "eb_info_mod") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String) :*: S1 ('MetaSel ('Just "eb_info_index") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Int)))) | |||||
data SerializableException Source
| EUserInterrupt | |
| EExitCode ExitCode | |
| EOtherException String |
| Binary SerializableException Source | |||||
Defined in GHCi.Message Methodsput :: SerializableException -> Put Source get :: Get SerializableException Source putList :: [SerializableException] -> Put Source | |||||
| Generic SerializableException Source | |||||
Defined in GHCi.Message Associated Types
Methodsfrom :: SerializableException -> Rep SerializableException x | |||||
| Show SerializableException Source | |||||
Defined in GHCi.Message MethodsshowsPrec :: Int -> SerializableException -> ShowS show :: SerializableException -> String showList :: [SerializableException] -> ShowS | |||||
| type Rep SerializableException Source | |||||
Defined in GHCi.Message type Rep SerializableException = D1 ('MetaData "SerializableException" "GHCi.Message" "ghci-9.12.1-fde5" 'False) (C1 ('MetaCons "EUserInterrupt" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "EExitCode" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ExitCode)) :+: C1 ('MetaCons "EOtherException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)))) | |||||
toSerializableException :: SomeException -> SerializableException Source
fromSerializableException :: SerializableException -> SomeException Source
| THException String | |
| THComplete a |
| Binary a => Binary (THResult a) Source | |||||
| Generic (THResult a) Source | |||||
Defined in GHCi.Message Associated Types
| |||||
| Show a => Show (THResult a) Source | |||||
| type Rep (THResult a) Source | |||||
Defined in GHCi.Message type Rep (THResult a) = D1 ('MetaData "THResult" "GHCi.Message" "ghci-9.12.1-fde5" 'False) (C1 ('MetaCons "THException" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 String)) :+: C1 ('MetaCons "THComplete" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a))) | |||||
data THResultType Source
| THExp | |
| THPat | |
| THType | |
| THDec | |
| THAnnWrapper |
| Binary THResultType Source | |||||
Defined in GHCi.Message Methodsput :: THResultType -> Put Source get :: Get THResultType Source putList :: [THResultType] -> Put Source | |||||
| Enum THResultType Source | |||||
Defined in GHCi.Message Methodssucc :: THResultType -> THResultType pred :: THResultType -> THResultType toEnum :: Int -> THResultType fromEnum :: THResultType -> Int enumFrom :: THResultType -> [THResultType] enumFromThen :: THResultType -> THResultType -> [THResultType] enumFromTo :: THResultType -> THResultType -> [THResultType] enumFromThenTo :: THResultType -> THResultType -> THResultType -> [THResultType] | |||||
| Generic THResultType Source | |||||
Defined in GHCi.Message Associated Types
| |||||
| Show THResultType Source | |||||
Defined in GHCi.Message MethodsshowsPrec :: Int -> THResultType -> ShowS show :: THResultType -> String showList :: [THResultType] -> ShowS | |||||
| type Rep THResultType Source | |||||
Defined in GHCi.Message type Rep THResultType = D1 ('MetaData "THResultType" "GHCi.Message" "ghci-9.12.1-fde5" 'False) ((C1 ('MetaCons "THExp" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "THPat" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "THType" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "THDec" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "THAnnWrapper" 'PrefixI 'False) (U1 :: Type -> Type)))) | |||||
data ResumeContext a Source
| ResumeContext | |
Fields
| |
The server-side Template Haskell state. This is created by the StartTH message. A new one is created per module that GHC typechecks.
| QState | |
getMessage :: Get Msg Source
putMessage :: Message a -> Put Source
getTHMessage :: Get THMsg Source
putTHMessage :: THMessage a -> Put Source
| Pipe | |
Fields
| |
remoteCall :: Binary a => Pipe -> Message a -> IO a Source
remoteTHCall :: Binary a => Pipe -> THMessage a -> IO a Source
readPipe :: Pipe -> Get a -> IO a Source
writePipe :: Pipe -> Put -> IO () Source
data BreakModule Source
A dummy type that tags the pointer to a breakpoint's ModuleName, because that type isn't available here.
A dummy type that tags pointers returned by LoadDLL.
| Binary PrimType Source | |
| Binary TsoFlags Source | |
| Binary WhatNext Source | |
| Binary WhyBlocked Source | |
Methodsput :: WhyBlocked -> Put Source get :: Get WhyBlocked Source putList :: [WhyBlocked] -> Put Source | |
| Binary StgInfoTable Source | |
Methodsput :: StgInfoTable -> Put Source get :: Get StgInfoTable Source putList :: [StgInfoTable] -> Put Source | |
| Binary CostCentre Source | |
Methodsput :: CostCentre -> Put Source get :: Get CostCentre Source putList :: [CostCentre] -> Put Source | |
| Binary CostCentreStack Source | |
Methodsput :: CostCentreStack -> Put Source get :: Get CostCentreStack Source putList :: [CostCentreStack] -> Put Source | |
| Binary IndexTable Source | |
Methodsput :: IndexTable -> Put Source get :: Get IndexTable Source putList :: [IndexTable] -> Put Source | |
| Binary StgTSOProfInfo Source | |
Methodsput :: StgTSOProfInfo -> Put Source get :: Get StgTSOProfInfo Source putList :: [StgTSOProfInfo] -> Put Source | |
| Binary ClosureType Source | |
Methodsput :: ClosureType -> Put Source get :: Get ClosureType Source putList :: [ClosureType] -> Put Source | |
| Binary ExitCode Source | |
| Binary a => Binary (GenClosure a) Source | |
Methodsput :: GenClosure a -> Put Source get :: Get (GenClosure a) Source putList :: [GenClosure a] -> Put Source | |
| Binary (FunPtr a) Source | |
| Binary (Ptr a) Source | |
© The University of Glasgow and others
Licensed under a BSD-style license (see top of the page).
https://downloads.haskell.org/~ghc/9.12.1/docs/libraries/ghci-9.12.1-fde5/GHCi-Message.html