/////////////////////////////////////////////////////////////////////// #region Public Constructors public Debugger( bool isolated, string culture, CreateFlags createFlags, InitializeFlags initializeFlags, ScriptFlags scriptFlags, InterpreterFlags interpreterFlags, AppDomain appDomain, IHost host, string libraryPath, StringList autoPathList ) { interpreter = isolated ? DebuggerOps.CreateInterpreter( culture, createFlags, initializeFlags, scriptFlags, interpreterFlags, appDomain, host, libraryPath, autoPathList) : null; ReturnCode code; Result error = null; code = Initialize(ref error); if (code != ReturnCode.Ok) { DebugOps.Complain(interpreter, code, error); } }
/////////////////////////////////////////////////////////////////////// public static Interpreter CreateInterpreter( string culture, CreateFlags createFlags, InitializeFlags initializeFlags, ScriptFlags scriptFlags, InterpreterFlags interpreterFlags, AppDomain appDomain, IHost host, string libraryPath, StringList autoPathList, ref Result result ) { // // NOTE: First, mask off flags that we know to be invalid for all // debugger interpreters. Next, add flags to force a cloned // interpreter host to be created and used. Finally, create // an isolated debugging interpreter with the right set of // options. // createFlags &= ~CreateFlags.NonDebuggerUse; createFlags |= CreateFlags.CloneHost; return(Interpreter.Create( culture, createFlags, initializeFlags, scriptFlags, interpreterFlags, appDomain, host, libraryPath, autoPathList, ref result)); }
/////////////////////////////////////////////////////////////////////// #region Debugger Interpreter Support Methods #if DEBUGGER public static Interpreter CreateInterpreter( string culture, CreateFlags createFlags, InitializeFlags initializeFlags, ScriptFlags scriptFlags, InterpreterFlags interpreterFlags, AppDomain appDomain, IHost host, string libraryPath, StringList autoPathList ) { Result result = null; Interpreter interpreter = CreateInterpreter( culture, createFlags, initializeFlags, scriptFlags, interpreterFlags, appDomain, host, libraryPath, autoPathList, ref result); if (interpreter == null) { DebugOps.Complain(interpreter, ReturnCode.Error, result); } return(interpreter); }
/////////////////////////////////////////////////////////////////////// /* NOTE: For use by [test2] and CreateSlaveInterpreter ONLY. */ internal static InterpreterHelper Create( AppDomain appDomain, IEnumerable <string> args, CreateFlags createFlags, InitializeFlags initializeFlags, ScriptFlags scriptFlags, InterpreterFlags interpreterFlags, string text, string libraryPath, StringList autoPathList, ref Result result ) { if (appDomain == null) { result = "invalid application domain"; return(null); } if (assemblyName == null) { result = "invalid assembly name"; return(null); } if (typeName == null) { result = "invalid type name"; return(null); } try { object[] ctorArgs = { args, createFlags, initializeFlags, scriptFlags, interpreterFlags, text, libraryPath, autoPathList, result }; InterpreterHelper interpreterHelper = (InterpreterHelper)appDomain.CreateInstanceAndUnwrap( assemblyName.ToString(), typeName, false, MarshalOps.PrivateCreateInstanceBindingFlags, null, ctorArgs, null, null, null); // // NOTE: Grab the result as it may have been modified. // result = ctorArgs[ctorArgs.Length - 1] as Result; return(interpreterHelper); } catch (Exception e) { result = e; } return(null); }
/////////////////////////////////////////////////////////////////////// public static bool HasFlags( InitializeFlags flags, InitializeFlags hasFlags, bool all ) { if (all) { return((flags & hasFlags) == hasFlags); } else { return((flags & hasFlags) != InitializeFlags.None); } }
/////////////////////////////////////////////////////////////////////// public static IDebugger Create( bool isolated, string culture, CreateFlags createFlags, InitializeFlags initializeFlags, ScriptFlags scriptFlags, InterpreterFlags interpreterFlags, AppDomain appDomain, IHost host, string libraryPath, StringList autoPathList ) { return(new Debugger( isolated, culture, createFlags, initializeFlags, scriptFlags, interpreterFlags, appDomain, host, libraryPath, autoPathList)); }
/////////////////////////////////////////////////////////////////////// // // NOTE: For use by the associated InterpreterHelper.Create method // overload ONLY. // private InterpreterHelper( IEnumerable <string> args, CreateFlags createFlags, InitializeFlags initializeFlags, ScriptFlags scriptFlags, InterpreterFlags interpreterFlags, string text, string libraryPath, StringList autoPathList, ref Result result ) { interpreter = Interpreter.Create( args, createFlags, initializeFlags, scriptFlags, interpreterFlags, text, libraryPath, autoPathList, ref result); }
internal static extern ulong HttpTerminate(InitializeFlags flags, IntPtr mustBeZero);
internal static extern ulong HttpInitialize( ApiVersion version, InitializeFlags flags, IntPtr reserved );
internal static extern Result HttpTerminate(InitializeFlags flags, IntPtr mustBeZero);
internal static extern Result HttpInitialize( ApiVersion version, InitializeFlags flags, IntPtr reserved );