/// <summary>
        /// Creates a host factory.
        /// </summary>
        /// <param name="debuggerManager">A reference to the debugger manager.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="debuggerManager"/> is null.</exception>
        public IsolatedAppDomainHostFactory(IDebuggerManager debuggerManager)
        {
            if (debuggerManager == null)
                throw new ArgumentNullException("debuggerManager");

            this.debuggerManager = debuggerManager;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates a new <see cref="CreatedAcadProcess"/> instance.
        /// </summary>
        /// <param name="logger">A logger.</param>
        /// <param name="commandRunner">A AutoCAD command runner.</param>
        /// <param name="executable">The path to the AutoCAD executable.</param>
        /// <param name="processCreator">A process creator.</param>
        /// <param name="debuggerManager">A debugger mananger.</param>
        /// <param name="pluginLocator">A plugin locator.</param>
        public CreatedAcadProcess(ILogger logger, IAcadCommandRunner commandRunner,
                                  string executable, IProcessCreator processCreator, IDebuggerManager debuggerManager,
                                  IAcadPluginLocator pluginLocator)
            : base(logger, commandRunner, pluginLocator)
        {
            if (executable == null)
            {
                throw new ArgumentNullException("executable");
            }
            if (processCreator == null)
            {
                throw new ArgumentNullException("processCreator");
            }
            if (debuggerManager == null)
            {
                throw new ArgumentNullException("debuggerManager");
            }
            if (pluginLocator == null)
            {
                throw new ArgumentNullException("pluginLocator");
            }

            startInfo            = new ProcessStartInfo(executable);
            this.processCreator  = processCreator;
            this.debuggerManager = debuggerManager;
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates a host factory.
        /// </summary>
        /// <param name="debuggerManager">A reference to the debugger manager.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="debuggerManager"/> is null.</exception>
        public LocalHostFactory(IDebuggerManager debuggerManager)
        {
            if (debuggerManager == null)
                throw new ArgumentNullException("debuggerManager");

            this.debuggerManager = debuggerManager;
        }
Exemplo n.º 4
0
        /// <summary>
        /// 游戏框架组件初始化。
        /// </summary>
        private void Awake()
        {
            if (_instance == null)
            {
                _instance = this;
            }

            if (_instance != null && _instance != this)
            {
                Destroy(this.gameObject);
                return;
            }

            m_DebuggerManager = new DebuggerManager();

            if (m_ActiveWindow == DebuggerActiveWindowType.Auto)
            {
                ActiveWindow = Debug.isDebugBuild;
            }
            else
            {
                ActiveWindow = (m_ActiveWindow == DebuggerActiveWindowType.Open);
            }

            m_FpsCounter = new FpsCounter(0.5f);
        }
        /// <summary>
        /// 游戏框架组件初始化。
        /// </summary>
        protected override void Awake()
        {
            base.Awake();

            m_DebuggerManager = GameFrameworkEntry.GetModule <IDebuggerManager>();
            if (m_DebuggerManager == null)
            {
                Log.Fatal("Debugger manager is invalid.");
                return;
            }

            switch (m_ActiveWindow)
            {
            case DebuggerActiveWindowType.AlwaysOpen:
                ActiveWindow = true;
                break;

            case DebuggerActiveWindowType.OnlyOpenWhenDevelopment:
                ActiveWindow = Debug.isDebugBuild;
                break;

            case DebuggerActiveWindowType.OnlyOpenInEditor:
                ActiveWindow = Application.isEditor;
                break;

            default:
                ActiveWindow = false;
                break;
            }

            m_FpsCounter = new FpsCounter(0.5f);
        }
Exemplo n.º 6
0
        /// <summary>
        /// Intializes a new <see cref="AcadProcessFactory"/> instance.
        /// </summary>
        /// <param name="logger">An <see cref="ILogger"/> instance.</param>
        /// <param name="fileSystem">An <see cref="IFileSystem"/> instance.</param>
        /// <param name="processFinder">A process finder.</param>
        /// <param name="processCreator">A process creator.</param>
        /// <param name="debuggerManager">An <see cref="IDebuggerManager"/> instance.</param>
        /// <param name="preferenceManager">The AutoCAD preference manager.</param>
        /// <param name="acadLocator">The AutoCAD locator.</param>
        /// <param name="pluginLocator">An AutoCAD plugin locator.</param>
        public AcadProcessFactory(ILogger logger, IFileSystem fileSystem,
            IProcessFinder processFinder, IProcessCreator processCreator,
            IDebuggerManager debuggerManager, IAcadPreferenceManager preferenceManager,
            IAcadLocator acadLocator, IAcadPluginLocator pluginLocator)
        {
            if (logger == null)
                throw new ArgumentNullException("logger");
            if (fileSystem == null)
                throw new ArgumentNullException("fileSystem");
            if (processFinder == null)
                throw new ArgumentNullException("processFinder");
            if (processCreator == null)
                throw new ArgumentNullException("processCreator");
            if (debuggerManager == null)
                throw new ArgumentNullException("debuggerManager");
            if (preferenceManager == null)
                throw new ArgumentNullException("preferenceManager");
            if (acadLocator == null)
                throw new ArgumentNullException("acadLocator");
            if (pluginLocator == null)
                throw new ArgumentNullException("pluginLocator");

            this.logger = logger;
            this.fileSystem = fileSystem;
            this.processFinder = processFinder;
            this.processCreator = processCreator;
            this.debuggerManager = debuggerManager;
            this.preferenceManager = preferenceManager;
            this.acadLocator = acadLocator;
            this.pluginLocator = pluginLocator;
        }
Exemplo n.º 7
0
 /// <summary>
 ///     Constructor.
 /// </summary>
 /// <param name="manager">Debugger manager.</param>
 /// <param name="filename">File name.</param>
 /// <param name="line">Line number.</param>
 /// <param name="column">Column number.</param>
 /// <param name="condition">Condition.</param>
 public NodeBreakpoint(IDebuggerManager manager, string filename, int line, int column, string condition)
 {
     _manager   = manager;
     _filename  = filename;
     _condition = condition;
     Line       = line;
     Column     = column;
 }
        /// <summary>
        /// Creates an uninitialized host.
        /// </summary>
        /// <param name="hostSetup">The host setup.</param>
        /// <param name="logger">The logger for host message output.</param>
        /// <param name="debuggerManager">The debugger manager.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="hostSetup"/>, <paramref name="logger"/>
        /// or <paramref name="debuggerManager"/> is null.</exception>
        public IsolatedAppDomainHost(HostSetup hostSetup, ILogger logger, IDebuggerManager debuggerManager)
            : base(hostSetup, logger, null)
        {
            if (debuggerManager == null)
                throw new ArgumentNullException("debuggerManager");

            this.debuggerManager = debuggerManager;
        }
Exemplo n.º 9
0
 /// <summary>
 ///     Constructor.
 /// </summary>
 /// <param name="manager">Debugger manager.</param>
 /// <param name="filename">File name.</param>
 /// <param name="line">Line number.</param>
 /// <param name="column">Column number.</param>
 /// <param name="condition">Condition.</param>
 public NodeBreakpoint(IDebuggerManager manager, string filename, int line, int column, string condition)
 {
     _manager = manager;
     _filename = filename;
     _condition = condition;
     Line = line;
     Column = column;
 }
Exemplo n.º 10
0
        /// <summary>
        /// Creates a host factory.
        /// </summary>
        /// <param name="debuggerManager">A reference to the debugger manager.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="debuggerManager"/> is null.</exception>
        public LocalHostFactory(IDebuggerManager debuggerManager)
        {
            if (debuggerManager == null)
            {
                throw new ArgumentNullException("debuggerManager");
            }

            this.debuggerManager = debuggerManager;
        }
        /// <summary>
        /// Creates a host factory.
        /// </summary>
        /// <param name="debuggerManager">A reference to the debugger manager.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="debuggerManager"/> is null.</exception>
        public IsolatedAppDomainHostFactory(IDebuggerManager debuggerManager)
        {
            if (debuggerManager == null)
            {
                throw new ArgumentNullException("debuggerManager");
            }

            this.debuggerManager = debuggerManager;
        }
Exemplo n.º 12
0
 private void AttachThreadEvents(IDebuggerManager debugger)
 {
     debugger.ModuleLoaded            += OnModuleLoaded;
     debugger.BreakpointBindFailed    += OnBreakpointBindFailed;
     debugger.BreakpointBindSucceeded += OnBreakpointBindSucceeded;
     debugger.BreakpointHit           += OnBreakpointHit;
     debugger.AsyncBreakComplete      += OnAsyncBreakComplete;
     debugger.ExceptionRaised         += OnExceptionRaised;
     debugger.StepComplete            += OnStepComplete;
 }
Exemplo n.º 13
0
 public NodeStackFrame(IDebuggerManager debugger, string frameName, string filename, int startLine, int endLine, int lineNo, int frameId)
 {
     _debugger  = debugger;
     _frameName = frameName;
     _filename  = filename;
     Line       = lineNo;
     _frameId   = frameId;
     _startLine = startLine;
     _endLine   = endLine;
 }
Exemplo n.º 14
0
        /// <summary>
        /// Creates an uninitialized host.
        /// </summary>
        /// <param name="hostSetup">The host setup.</param>
        /// <param name="logger">The logger for host message output.</param>
        /// <param name="debuggerManager">The debugger manager.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="hostSetup"/>, <paramref name="logger"/>
        /// or <paramref name="debuggerManager"/> is null.</exception>
        public IsolatedAppDomainHost(HostSetup hostSetup, ILogger logger, IDebuggerManager debuggerManager)
            : base(hostSetup, logger, null)
        {
            if (debuggerManager == null)
            {
                throw new ArgumentNullException("debuggerManager");
            }

            this.debuggerManager = debuggerManager;
        }
Exemplo n.º 15
0
 public NodeStackFrame(IDebuggerManager debugger, string frameName, string filename, int startLine, int endLine, int lineNo, int frameId)
 {
     _debugger = debugger;
     _frameName = frameName;
     _filename = filename;
     Line = lineNo;
     _frameId = frameId;
     _startLine = startLine;
     _endLine = endLine;
 }
Exemplo n.º 16
0
        /// <summary>
        /// 游戏框架组件初始化。
        /// </summary>
        protected override void Awake()
        {
            base.Awake();

            m_DebuggerManager = GameFrameworkEntry.GetModule <IDebuggerManager>();
            if (m_DebuggerManager == null)
            {
                Log.Fatal("Debugger manager is invalid.");
                return;
            }

            m_FpsCounter = new FpsCounter(0.5f);
        }
Exemplo n.º 17
0
        private static List <NodeEvaluationResult> GetVariables(JArray variables, IDebuggerManager debugger, NodeStackFrame stackFrame)
        {
            var results = new List <NodeEvaluationResult>(variables.Count);

            for (int j = 0; j < variables.Count; j++)
            {
                JToken variable             = variables[j];
                var    variableProvider     = new BacktraceVariableProvider(variable, debugger, stackFrame);
                NodeEvaluationResult result = NodeMessageFactory.CreateVariable(variableProvider);
                results.Add(result);
            }
            return(results);
        }
 public BacktraceVariableProvider(JToken parameter, IDebuggerManager debugger, NodeStackFrame stackFrame)
 {
     Id = (int) parameter["value"]["ref"];
     Debugger = debugger;
     StackFrame = stackFrame;
     Parent = null;
     Name = (string) parameter["name"] ?? AnonymousVariable;
     TypeName = (string) parameter["value"]["type"];
     Value = (string) parameter["value"]["value"];
     Class = (string) parameter["value"]["className"];
     Text = (string) parameter["value"]["text"];
     Attributes = PropertyAttribute.None;
     Type = PropertyType.Normal;
 }
Exemplo n.º 19
0
 public BacktraceVariableProvider(JToken parameter, IDebuggerManager debugger, NodeStackFrame stackFrame)
 {
     Id         = (int)parameter["value"]["ref"];
     Debugger   = debugger;
     StackFrame = stackFrame;
     Parent     = null;
     Name       = (string)parameter["name"] ?? AnonymousVariable;
     TypeName   = (string)parameter["value"]["type"];
     Value      = (string)parameter["value"]["value"];
     Class      = (string)parameter["value"]["className"];
     Text       = (string)parameter["value"]["text"];
     Attributes = PropertyAttribute.None;
     Type       = PropertyType.Normal;
 }
Exemplo n.º 20
0
 public NewValueVariableProvider(JObject message, IDebuggerManager debugger, NodeStackFrame stackFrame, string name)
 {
     Id         = (int)message["body"]["newValue"]["handle"];
     Debugger   = debugger;
     StackFrame = stackFrame;
     Parent     = null;
     Name       = name;
     TypeName   = (string)message["body"]["newValue"]["type"];
     Value      = (string)message["body"]["newValue"]["value"];
     Class      = (string)message["body"]["newValue"]["className"];
     Text       = (string)message["body"]["newValue"]["text"];
     Attributes = PropertyAttribute.None;
     Type       = PropertyType.Normal;
 }
Exemplo n.º 21
0
 /// <summary>
 ///     Creates a evaluation result for an expression which successfully returned a value.
 /// </summary>
 public NodeEvaluationResult(IDebuggerManager debugger, string stringValue, string hexValue,
                             string typeName, string expression, string fullName,
                             NodeExpressionType type, NodeStackFrame stackFrame, int id)
 {
     Debugger     = debugger;
     Name         = expression;
     FullName     = fullName;
     StackFrame   = stackFrame;
     _stringValue = stringValue;
     HexValue     = hexValue;
     TypeName     = typeName;
     Id           = id;
     Type         = type;
 }
Exemplo n.º 22
0
 /// <summary>
 ///     Creates a evaluation result for an expression which successfully returned a value.
 /// </summary>
 public NodeEvaluationResult(IDebuggerManager debugger, string stringValue, string hexValue,
                             string typeName, string expression, string fullName,
                             NodeExpressionType type, NodeStackFrame stackFrame, int id)
 {
     Debugger = debugger;
     Name = expression;
     FullName = fullName;
     StackFrame = stackFrame;
     _stringValue = stringValue;
     HexValue = hexValue;
     TypeName = typeName;
     Id = id;
     Type = type;
 }
 public EvaluateVariableProvider(JObject message, IDebuggerManager debugger, NodeStackFrame stackFrame, string name)
 {
     Id = (int) message["body"]["handle"];
     Debugger = debugger;
     StackFrame = stackFrame;
     Parent = null;
     Name = name;
     TypeName = (string) message["body"]["type"];
     Value = (string) message["body"]["value"];
     Class = (string) message["body"]["className"];
     Text = (string) message["body"]["text"];
     Attributes = PropertyAttribute.None;
     Type = PropertyType.Normal;
 }
Exemplo n.º 24
0
        /// <summary>
        /// Intializes a new <see cref="AcadProcessFactory"/> instance.
        /// </summary>
        /// <param name="logger">An <see cref="ILogger"/> instance.</param>
        /// <param name="fileSystem">An <see cref="IFileSystem"/> instance.</param>
        /// <param name="processFinder">A process finder.</param>
        /// <param name="processCreator">A process creator.</param>
        /// <param name="debuggerManager">An <see cref="IDebuggerManager"/> instance.</param>
        /// <param name="preferenceManager">The AutoCAD preference manager.</param>
        /// <param name="acadLocator">The AutoCAD locator.</param>
        /// <param name="pluginLocator">An AutoCAD plugin locator.</param>
        public AcadProcessFactory(ILogger logger, IFileSystem fileSystem,
                                  IProcessFinder processFinder, IProcessCreator processCreator,
                                  IDebuggerManager debuggerManager, IAcadPreferenceManager preferenceManager,
                                  IAcadLocator acadLocator, IAcadPluginLocator pluginLocator)
        {
            if (logger == null)
            {
                throw new ArgumentNullException("logger");
            }
            if (fileSystem == null)
            {
                throw new ArgumentNullException("fileSystem");
            }
            if (processFinder == null)
            {
                throw new ArgumentNullException("processFinder");
            }
            if (processCreator == null)
            {
                throw new ArgumentNullException("processCreator");
            }
            if (debuggerManager == null)
            {
                throw new ArgumentNullException("debuggerManager");
            }
            if (preferenceManager == null)
            {
                throw new ArgumentNullException("preferenceManager");
            }
            if (acadLocator == null)
            {
                throw new ArgumentNullException("acadLocator");
            }
            if (pluginLocator == null)
            {
                throw new ArgumentNullException("pluginLocator");
            }

            this.logger            = logger;
            this.fileSystem        = fileSystem;
            this.processFinder     = processFinder;
            this.processCreator    = processCreator;
            this.debuggerManager   = debuggerManager;
            this.preferenceManager = preferenceManager;
            this.acadLocator       = acadLocator;
            this.pluginLocator     = pluginLocator;
        }
Exemplo n.º 25
0
        /// <summary>
        /// Creates a local host.
        /// </summary>
        /// <param name="hostSetup">The host setup.</param>
        /// <param name="logger">The logger for host message output.</param>
        /// <param name="debuggerManager">The debugger manager.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="hostSetup"/>, <paramref name="logger"/>
        /// or <paramref name="debuggerManager"/> is null.</exception>
        public LocalHost(HostSetup hostSetup, ILogger logger, IDebuggerManager debuggerManager)
            : base(hostSetup, logger)
        {
            if (debuggerManager == null)
                throw new ArgumentNullException("debuggerManager");

            this.debuggerManager = debuggerManager;

            if (! string.IsNullOrEmpty(hostSetup.WorkingDirectory))
                currentDirectorySwitcher = new CurrentDirectorySwitcher(hostSetup.WorkingDirectory);

            if (hostSetup.HintDirectories.Count != 0)
            {
                assemblyLoader = new DefaultAssemblyLoader();
                GenericCollectionUtils.ForEach(hostSetup.HintDirectories, assemblyLoader.AddHintDirectory);
            }
        }
Exemplo n.º 26
0
        /// <summary>
        /// Creates a new <see cref="CreatedAcadProcess"/> instance.
        /// </summary>
        /// <param name="logger">A logger.</param>
        /// <param name="commandRunner">A AutoCAD command runner.</param>
        /// <param name="executable">The path to the AutoCAD executable.</param>
        /// <param name="processCreator">A process creator.</param>
        /// <param name="debuggerManager">A debugger mananger.</param>
        /// <param name="pluginLocator">A plugin locator.</param>
        public CreatedAcadProcess(ILogger logger, IAcadCommandRunner commandRunner,
            string executable, IProcessCreator processCreator, IDebuggerManager debuggerManager,
            IAcadPluginLocator pluginLocator)
            : base(logger, commandRunner, pluginLocator)
        {
            if (executable == null)
                throw new ArgumentNullException("executable");
            if (processCreator == null)
                throw new ArgumentNullException("processCreator");
            if (debuggerManager == null)
                throw new ArgumentNullException("debuggerManager");
            if (pluginLocator == null)
                throw new ArgumentNullException("pluginLocator");

            startInfo = new ProcessStartInfo(executable);
            this.processCreator = processCreator;
            this.debuggerManager = debuggerManager;
        }
        /// <summary>
        /// 游戏框架组件初始化。
        /// </summary>
        private void Awake()
        {
            m_DebuggerManager = new DebuggerManager();
            if (m_DebuggerManager == null)
            {
                Debug.LogError("Debugger manager is invalid.");
                return;
            }

            if (m_ActiveWindow == DebuggerActiveWindowType.Auto)
            {
                ActiveWindow = Debug.isDebugBuild;
            }
            else
            {
                ActiveWindow = (m_ActiveWindow == DebuggerActiveWindowType.Open);
            }

            m_FpsCounter = new FpsCounter(0.5f);
        }
Exemplo n.º 28
0
        /// <summary>
        /// 游戏框架组件初始化。
        /// </summary>
        public DebuggerComponent()
        {
            m_DebuggerManager = GameFrameworkEntry.GetModule <IDebuggerManager>();
            if (m_DebuggerManager == null)
            {
                Log.Fatal("Debugger manager is invalid.");
                return;
            }

            if (m_ActiveWindow == DebuggerActiveWindowType.Auto)
            {
                ActiveWindow = Debug.isDebugBuild;
            }
            else
            {
                ActiveWindow = (m_ActiveWindow == DebuggerActiveWindowType.Open);
            }

            m_FpsCounter = new FpsCounter(0.5f);
        }
Exemplo n.º 29
0
        /// <summary>
        /// Creates a local host.
        /// </summary>
        /// <param name="hostSetup">The host setup.</param>
        /// <param name="logger">The logger for host message output.</param>
        /// <param name="debuggerManager">The debugger manager.</param>
        /// <exception cref="ArgumentNullException">Thrown if <paramref name="hostSetup"/>, <paramref name="logger"/>
        /// or <paramref name="debuggerManager"/> is null.</exception>
        public LocalHost(HostSetup hostSetup, ILogger logger, IDebuggerManager debuggerManager)
            : base(hostSetup, logger)
        {
            if (debuggerManager == null)
            {
                throw new ArgumentNullException("debuggerManager");
            }

            this.debuggerManager = debuggerManager;

            if (!string.IsNullOrEmpty(hostSetup.WorkingDirectory))
            {
                currentDirectorySwitcher = new CurrentDirectorySwitcher(hostSetup.WorkingDirectory);
            }

            if (hostSetup.HintDirectories.Count != 0)
            {
                assemblyLoader = new DefaultAssemblyLoader();
                GenericCollectionUtils.ForEach(hostSetup.HintDirectories, assemblyLoader.AddHintDirectory);
            }
        }
Exemplo n.º 30
0
        /// <summary>
        /// 游戏框架组件初始化。
        /// </summary>
        protected override void Awake()
        {
            base.Awake();

            m_DebuggerManager = GameFrameworkEntry.GetModule <IDebuggerManager>();
            if (m_DebuggerManager == null)
            {
                Log.Fatal("Debugger manager is invalid.");
                return;
            }

            if (m_ActiveWindow == DebuggerActiveWindowType.Auto)
            {
                ActiveWindow = Debug.isDebugBuild;
            }
            else
            {
                ActiveWindow = (m_ActiveWindow == DebuggerActiveWindowType.Open);
            }

            m_FpsCounter = new FpsCounter(0.5f);
        }
Exemplo n.º 31
0
        /// <summary>
        /// Attaches the debugger to a process if the host settings require it.
        /// </summary>
        protected void AttachDebuggerIfNeeded(IDebuggerManager debuggerManager, Process debuggedProcess)
        {
            if (HostSetup.DebuggerSetup != null)
            {
                IDebugger debugger = debuggerManager.GetDebugger(HostSetup.DebuggerSetup, Logger);

                if (!Debugger.IsAttached)
                {
                    Logger.Log(LogSeverity.Important, "Attaching debugger to the host.");

                    AttachDebuggerResult result = debugger.AttachToProcess(debuggedProcess);
                    if (result == AttachDebuggerResult.Attached)
                    {
                        this.debugger        = debugger;
                        this.debuggedProcess = debuggedProcess;
                    }
                    else if (result == AttachDebuggerResult.CouldNotAttach)
                    {
                        Logger.Log(LogSeverity.Warning, "Could not attach debugger to the host.");
                    }
                }
            }
        }
 public DebuggerStartHandler([NotNull] IDebuggerManager debuggerManager) : base("debugger/start", debuggerManager)
 {
 }
Exemplo n.º 33
0
        /// <summary>
        /// Attaches the debugger to a process if the host settings require it.
        /// </summary>
        protected void AttachDebuggerIfNeeded(IDebuggerManager debuggerManager, Process debuggedProcess)
        {
            if (HostSetup.DebuggerSetup != null)
            {
                IDebugger debugger = debuggerManager.GetDebugger(HostSetup.DebuggerSetup, Logger);

                if (! Debugger.IsAttached)
                {
                    Logger.Log(LogSeverity.Important, "Attaching debugger to the host.");

                    AttachDebuggerResult result = debugger.AttachToProcess(debuggedProcess);
                    if (result == AttachDebuggerResult.Attached)
                    {
                        this.debugger = debugger;
                        this.debuggedProcess = debuggedProcess;
                    }
                    else if (result == AttachDebuggerResult.CouldNotAttach)
                    {
                        Logger.Log(LogSeverity.Warning, "Could not attach debugger to the host.");
                    }
                }
            }
        }
Exemplo n.º 34
0
 public DebuggerClearBreakpointsHandler([NotNull] IDebuggerManager debuggerManager) : base("debugger/breakpoints/clear", debuggerManager)
 {
 }
 public DebuggerRemoveBreakpointHandler([NotNull] IDebuggerManager debuggerManager) : base("debugger/breakpoints/remove", debuggerManager)
 {
 }
Exemplo n.º 36
0
 private static List<NodeEvaluationResult> GetVariables(JArray variables, IDebuggerManager debugger, NodeStackFrame stackFrame)
 {
     var results = new List<NodeEvaluationResult>(variables.Count);
     for (int j = 0; j < variables.Count; j++)
     {
         JToken variable = variables[j];
         var variableProvider = new BacktraceVariableProvider(variable, debugger, stackFrame);
         NodeEvaluationResult result = NodeMessageFactory.CreateVariable(variableProvider);
         results.Add(result);
     }
     return results;
 }
 public DebuggerResetHandler([NotNull] IDebuggerManager debuggerManager) : base("debugger/reset", debuggerManager)
 {
 }
 public DebuggerStepToEndHandler([NotNull] IDebuggerManager debuggerManager) : base("debugger/step/end", debuggerManager)
 {
 }
Exemplo n.º 39
0
 protected DebuggerHandlerBase([NotNull] string path, [NotNull] IDebuggerManager debuggerManager) : base(path)
 {
     this.debuggerManager = debuggerManager;
 }
Exemplo n.º 40
0
        public static NodeEvaluationResult CreateVariable(IVariableProvider variable)
        {
            int id = variable.Id;
            IDebuggerManager     debugger   = variable.Debugger;
            NodeStackFrame       stackFrame = variable.StackFrame;
            NodeEvaluationResult parent     = variable.Parent;

            string             name     = variable.Name;
            string             fullName = GetFullName(parent, variable.Name, ref name);
            string             stringValue;
            string             typeName = variable.TypeName;
            NodeExpressionType type     = 0;

            if (variable.Attributes.HasFlag(PropertyAttribute.ReadOnly))
            {
                type |= NodeExpressionType.ReadOnly;
            }

            if (variable.Attributes.HasFlag(PropertyAttribute.DontEnum))
            {
                type |= NodeExpressionType.Private;
            }

            switch (typeName)
            {
            case "undefined":
                stringValue = "undefined";
                typeName    = "Undefined";
                break;

            case "null":
                stringValue = "null";
                typeName    = "Null";
                break;

            case "number":
                stringValue = variable.Value;
                typeName    = "Number";
                break;

            case "boolean":
                stringValue = variable.Value.ToLowerInvariant();
                typeName    = "Boolean";
                type       |= NodeExpressionType.Boolean;
                break;

            case "regexp":
                stringValue = variable.Value;
                typeName    = "Regular Expression";
                type       |= NodeExpressionType.Expandable;
                break;

            case "function":
                stringValue = string.IsNullOrEmpty(variable.Text) ? "{Function}" : variable.Text;
                typeName    = "Function";
                type       |= NodeExpressionType.Function | NodeExpressionType.Expandable;
                break;

            case "string":
                stringValue = variable.Value;
                typeName    = "String";
                type       |= NodeExpressionType.String;
                break;

            case "object":
                stringValue = variable.Class == "Object" ? "{...}" : string.Format("{{{0}}}", variable.Class);
                typeName    = "Object";
                type       |= NodeExpressionType.Expandable;
                break;

            case "error":
                stringValue = variable.Value;
                if (!string.IsNullOrEmpty(stringValue) && stringValue.StartsWith("Error: "))
                {
                    stringValue = variable.Value.Substring(7);
                }
                typeName = "Error";
                type    |= NodeExpressionType.Expandable;
                break;

            default:
                stringValue = variable.Value;
                break;
            }

            return(new NodeEvaluationResult(debugger, stringValue, null, typeName, name, fullName, type, stackFrame, id));
        }
Exemplo n.º 41
0
 private void AttachThreadEvents(IDebuggerManager debugger)
 {
     debugger.ModuleLoaded += OnModuleLoaded;
     debugger.BreakpointBindFailed += OnBreakpointBindFailed;
     debugger.BreakpointBindSucceeded += OnBreakpointBindSucceeded;
     debugger.BreakpointHit += OnBreakpointHit;
     debugger.AsyncBreakComplete += OnAsyncBreakComplete;
     debugger.ExceptionRaised += OnExceptionRaised;
     debugger.StepComplete += OnStepComplete;
 }
Exemplo n.º 42
0
 public DebuggerStepHandler([NotNull] IDebuggerManager debuggerManager) : base("debugger/step", debuggerManager)
 {
 }
Exemplo n.º 43
0
 public DebuggerLoadGameHandler([NotNull] IDebuggerManager debuggerManager, [NotNull] ArenaState arenaState)
     : base("debugger/load", debuggerManager)
 {
     this.arenaState = arenaState;
 }
        public GameHttpServer([NotNull] string prefix, [NotNull] ArenaState arenaState, [NotNull] SessionManager sessionManager, [NotNull] IDebuggerManager debuggerManager, [NotNull] ITournamentRunner tournamentRunner, [NotNull] string staticContentPath)
        {
            this.arenaState     = arenaState;
            this.sessionManager = sessionManager;
            var baseUri = new Uri(prefix.Replace("*", "localhost").Replace("+", "localhost"));

            DefaultUrl = new Uri(baseUri, string.Format("?godModeSecret={0}", arenaState.GodModeSecret)).AbsoluteUri;
            basePath   = baseUri.AbsolutePath;
            listener   = new HttpListener();
            listener.Prefixes.Add(prefix);
            handlers = new IHttpHandler[]
            {
                new RootHandler(),
                new IndexHandler(arenaState),
                new NavPanelHandler(arenaState),
                new DebuggerStartHandler(debuggerManager),
                new DebuggerStateHandler(debuggerManager),
                new DebuggerStepHandler(debuggerManager),
                new DebuggerStepToEndHandler(debuggerManager),
                new DebuggerRestartHandler(debuggerManager),
                new DebuggerResetHandler(debuggerManager),
                new DebuggerRemoveBreakpointHandler(debuggerManager),
                new DebuggerAddBreakpointHandler(debuggerManager),
                new DebuggerClearBreakpointsHandler(debuggerManager),
                new DebuggerLoadGameHandler(debuggerManager, arenaState),
                new StaticHandler(staticContentPath),
                new ArenaRankingHandler(arenaState),
                new ArenaSubmitHandler(arenaState, tournamentRunner),
                new ArenaPlayerHandler(arenaState),
                new ArenaRemovePlayerHandler(arenaState),
                new ArenaSubmitFormHandler(arenaState),
                new ArenaSetSubmitIsAllowedHandler(arenaState)
            };
            stopEvent = new ManualResetEvent(false);
        }