{-# LANGUAGE CPP #-}
module GHC.Runtime.Interpreter.Types
( Interp(..)
, IServ(..)
, IServInstance(..)
, IServConfig(..)
, IServState(..)
)
where
import GHC.Prelude
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
= 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]
}