{-# LANGUAGE CPP #-}
module GHC.Runtime.Interpreter.Types
( Interp(..)
, InterpInstance(..)
, IServ(..)
, IServInstance(..)
, IServConfig(..)
, IServState(..)
)
where
import GHC.Prelude
import GHC.Linker.Types
import GHCi.RemoteTypes
import GHCi.Message ( Pipe )
import GHC.Types.Unique.FM
import GHC.Data.FastString ( FastString )
import Foreign
import Control.Concurrent
import System.Process ( ProcessHandle, CreateProcess )
data Interp = Interp
{ Interp -> InterpInstance
interpInstance :: !InterpInstance
, Interp -> Loader
interpLoader :: !Loader
}
data InterpInstance
= ExternalInterp !IServConfig !IServ
#if defined(HAVE_INTERNAL_INTERPRETER)
| InternalInterp
#endif
newtype IServ = IServ (MVar IServState)
data IServState
= IServPending
| IServRunning !IServInstance
data IServConfig = IServConfig
{ IServConfig -> String
iservConfProgram :: !String
, IServConfig -> [String]
iservConfOpts :: ![String]
, IServConfig -> Bool
iservConfProfiled :: !Bool
, IServConfig -> Bool
iservConfDynamic :: !Bool
, IServConfig -> Maybe (CreateProcess -> IO ProcessHandle)
iservConfHook :: !(Maybe (CreateProcess -> IO ProcessHandle))
, IServConfig -> IO ()
iservConfTrace :: IO ()
}
data IServInstance = IServInstance
{ IServInstance -> Pipe
iservPipe :: !Pipe
, IServInstance -> ProcessHandle
iservProcess :: !ProcessHandle
, IServInstance -> UniqFM FastString (Ptr ())
iservLookupSymbolCache :: !(UniqFM FastString (Ptr ()))
, IServInstance -> [HValueRef]
iservPendingFrees :: ![HValueRef]
}