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
{ interpInstance :: !InterpInstance
, 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
{ iservConfProgram :: !String
, iservConfOpts :: ![String]
, iservConfProfiled :: !Bool
, iservConfDynamic :: !Bool
, iservConfHook :: !(Maybe (CreateProcess -> IO ProcessHandle))
, iservConfTrace :: IO ()
}
data IServInstance = IServInstance
{ iservPipe :: !Pipe
, iservProcess :: !ProcessHandle
, iservLookupSymbolCache :: !(UniqFM FastString (Ptr ()))
, iservPendingFrees :: ![HValueRef]
}