예제 #1
0
 internal ScriptDebugInfo(
     ScriptBreakpointInfo breakpointInfo,
     ScriptBlock script,
     bool fromScript)
 {
     this._breakpointInfo = breakpointInfo;
     this._numReferences  = 1;
     this._isRecursive    = false;
     this._fromScript     = fromScript;
     this.SetBreakpoints(script);
 }
예제 #2
0
        private ScriptBreakpointInfo GetScriptBreakpointInfo(string path)
        {
            ScriptBreakpointInfo scriptBreakpointInfo;

            if (!this._scriptPathToBreakpointInfo.TryGetValue(path, out scriptBreakpointInfo))
            {
                scriptBreakpointInfo = new ScriptBreakpointInfo(this._context, path);
                this._scriptPathToBreakpointInfo[path] = scriptBreakpointInfo;
            }
            return(scriptBreakpointInfo);
        }
예제 #3
0
        private Breakpoint NewCommandBreakpoint(
            ScriptBreakpointInfo breakpointInfo,
            string command,
            ScriptBlock action)
        {
            Breakpoint breakpoint = breakpointInfo.NewCommandBreakpoint(command, action);

            this._idToBreakpoint[breakpoint.Id] = breakpoint;
            this.OnBreakpointUpdated(new BreakpointUpdatedEventArgs(breakpoint, BreakpointUpdateType.Set));
            return(breakpoint);
        }
예제 #4
0
        private Breakpoint NewVariableBreakpoint(
            ScriptBreakpointInfo breakpointInfo,
            string variableName,
            VariableAccessMode accessMode,
            ScriptBlock action)
        {
            Breakpoint breakpoint = breakpointInfo.NewVariableBreakpoint(variableName, accessMode, action);

            this._idToBreakpoint[breakpoint.Id] = breakpoint;
            this.OnBreakpointUpdated(new BreakpointUpdatedEventArgs(breakpoint, BreakpointUpdateType.Set));
            return(breakpoint);
        }
예제 #5
0
 internal Debugger(ExecutionContext context)
 {
     this._context                    = context;
     this._runningScriptStack         = new Stack <Debugger.ScriptBlockInfo>();
     this._scriptPathToBreakpointInfo = new Dictionary <string, ScriptBreakpointInfo>((IEqualityComparer <string>)StringComparer.OrdinalIgnoreCase);
     this._scriptPathToDebugInfo      = new Dictionary <string, ScriptDebugInfo>((IEqualityComparer <string>)StringComparer.OrdinalIgnoreCase);
     this._statementStack             = new Stack <ParseTreeNode>();
     this._globalScriptBreakpointInfo = new ScriptBreakpointInfo(context, (string)null);
     this._currentScriptDebugInfo     = (ScriptDebugInfo)null;
     this._inBreakpoint               = false;
     this._idToBreakpoint             = new Dictionary <int, Breakpoint>();
     this._steppingMode               = Debugger.SteppingMode.None;
     this._callStack                  = new Stack <Debugger.CallStackInfo>();
     this._evaluatingBreakpointAction = false;
 }
예제 #6
0
        internal void RemoveBreakpoint(Breakpoint breakpoint)
        {
            if (this._idToBreakpoint.ContainsKey(breakpoint.Id))
            {
                this._idToBreakpoint.Remove(breakpoint.Id);
            }
            ScriptBreakpointInfo scriptBreakpointInfo = (ScriptBreakpointInfo)null;

            if (breakpoint.IsScriptBreakpoint)
            {
                if (!this._scriptPathToBreakpointInfo.TryGetValue(breakpoint.Script, out scriptBreakpointInfo))
                {
                    return;
                }
            }
            else
            {
                scriptBreakpointInfo = this._globalScriptBreakpointInfo;
            }
            switch (breakpoint.Type)
            {
            case Breakpoint.BreakpointType.Line:
            case Breakpoint.BreakpointType.Statement:
                LineBreakpoint breakpoint1 = (LineBreakpoint)breakpoint;
                scriptBreakpointInfo.Remove(breakpoint1);
                this.RemoveBreakpointFromRunningScripts(breakpoint1);
                break;

            case Breakpoint.BreakpointType.Variable:
                scriptBreakpointInfo.Remove((VariableBreakpoint)breakpoint);
                break;

            case Breakpoint.BreakpointType.Command:
                scriptBreakpointInfo.Remove((CommandBreakpoint)breakpoint);
                break;
            }
            if (scriptBreakpointInfo.NumBreakpoints == 0 && breakpoint.IsScriptBreakpoint)
            {
                this._scriptPathToBreakpointInfo.Remove(breakpoint.Script);
            }
            this.OnBreakpointUpdated(new BreakpointUpdatedEventArgs(breakpoint, BreakpointUpdateType.Removed));
        }