internal ScriptDebugInfo( ScriptBreakpointInfo breakpointInfo, ScriptBlock script, bool fromScript) { this._breakpointInfo = breakpointInfo; this._numReferences = 1; this._isRecursive = false; this._fromScript = fromScript; this.SetBreakpoints(script); }
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); }
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); }
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); }
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; }
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)); }