public BreakpointAlreadySetException(IBreakpoint breakpoint) : base("This breakpoint is already set.") { Contract.Requires(breakpoint != null); Breakpoint = breakpoint; }
public void Remove(IBreakpoint bp) { dispatcher.UI(() => { if (theDebugger.IsDebugging) { var bph = bp as IDnBreakpointHolder; if (bph != null) { var dnbp = bph.DnBreakpoint; if (dnbp != null) { theDebugger.Debugger.RemoveBreakpoint(bph.DnBreakpoint); } } else { Debug.Fail("Unknown breakpoint: " + bp); } } else { bool b = breakpointsToInitialize.Remove(bp); Debug.Assert(b); } }); }
private void debugger_Breakpoint(IWabbitemu debugger, IBreakpoint breakpoint) { if (OnBreakpoint != null) { OnBreakpoint(debugger, new BreakpointEventArgs(breakpoint)); } }
private bool BindBreakpoint(ITypeMirror type, IBreakpoint bp) { foreach (var method in type.Methods) { var bestLocation = BestLocationIn(method, bp); if (bestLocation == null) { continue; } var b = Factory.CreateBreakpoint(bestLocation); breakpoints[bp] = b; if (bp.Enabled) { b.Enable(); } if (BreakpointBound != null) { BreakpointBound(bp, b, b.Location); } return(true); } return(false); }
public bool RemoveBreakpoint(IBreakpoint breakpoint) { if (!breakpoints.ContainsKey (breakpoint)) return false; breakpoints.Remove (breakpoint); return true; }
/// <summary> /// Create a SLED style breakpoint from a SyntaxEditorControl style breakpoint /// </summary> /// <param name="ibp">SyntaxEditorControl style breakpoint</param> /// <returns>SLED breakpoint</returns> public static SledProjectFilesBreakpointType Create(IBreakpoint ibp) { var node = new DomNode(SledSchema.SledProjectFilesBreakpointType.Type); var bp = node.As <SledProjectFilesBreakpointType>(); bp.Setup(ibp); return(bp); }
private void OnBreakpointEnabled(IBreakpoint breakpoint) { IBreakpoint bp; if (breakpoints.TryGetValue (breakpoint, out bp)) bp.Enable (); else OnBreakpointAdded (breakpoint); }
private void OnBreakpointRemoved(IBreakpoint breakpoint) { IBreakpoint bp; if (breakpoints.TryGetValue (breakpoint, out bp)) { bp.Disable (); breakpoints.Remove (breakpoint); } }
private bool AddBreakpoint(IBreakpoint breakpoint) { if (breakpoints.ContainsKey(breakpoint)) { return(false); } breakpoints.Add(breakpoint, null); return(true); }
private void disableBreakpointToolStripMenuItem_Click(object sender, EventArgs e) { IBreakpoint bp = this.CurrentRow.Breakpoint; if (bp != null) { bp.Enabled = !bp.Enabled; } }
private void OnBreakpointDisabled(IBreakpoint breakpoint) { IBreakpoint bp; if (breakpoints.TryGetValue(breakpoint, out bp)) { bp.Disable(); } }
public bool RemoveBreakpoint(IBreakpoint breakpoint) { if (!breakpoints.ContainsKey(breakpoint)) { return(false); } breakpoints.Remove(breakpoint); return(true); }
public void RemoveBreakpoint(IBreakpoint bp) { Contract.Requires(bp != null); lock (syncBreakpoint) { if (breakpoints.Remove(bp)) { bp.Remove(process); } } }
private void NativeDebuggerOnBreakpoint(Wabbitemu calc, IBreakpoint breakpoint) { if (breakpoint.Address != _mapLoadBreak.Address) { return; } _debuggerService.CurrentDebugger.NativeDebugger.Breakpoint -= NativeDebuggerOnBreakpoint; _debuggerService.CurrentDebugger.NativeDebugger.Breakpoints.Remove(_mapLoadBreak); _debuggerService.CurrentDebugger.Run(); StartTesting(); }
public void PrintInstruction(X86Instruction instruction, IBreakpoint breakpoint) { var original = System.Console.ForegroundColor; System.Console.ForegroundColor = breakpoint != null ? ConsoleColor.Black : ConsoleColor.DarkGray; if (breakpoint != null) { System.Console.BackgroundColor = breakpoint.Enabled ? ConsoleColor.Red : ConsoleColor.Yellow; } System.Console.Write(instruction.Offset.ToString("X8")); System.Console.ForegroundColor = ConsoleColor.DarkGray; System.Console.BackgroundColor = ConsoleColor.Black; System.Console.Write(": "); ConsoleColor color; if (!MnemonicColors.TryGetValue(instruction.Mnemonic, out color)) { color = ConsoleColor.DarkGray; } System.Console.ForegroundColor = color; foreach (var prefix in instruction.Prefixes) { string formatted = _formatter.FormatPrefix(prefix); if (!string.IsNullOrEmpty(formatted)) { System.Console.Write(formatted + ' '); } } System.Console.Write(_formatter.FormatMnemonic(instruction.Mnemonic)); if (instruction.Operand1 != null) { System.Console.Write(' '); System.Console.Write(_formatter.FormatOperand(instruction.Operand1)); if (instruction.Operand2 != null) { System.Console.Write(", "); System.Console.Write(_formatter.FormatOperand(instruction.Operand2)); } } System.Console.WriteLine(); System.Console.ForegroundColor = original; }
private void OnBreakpointEnabled(IBreakpoint breakpoint) { IBreakpoint bp; if (breakpoints.TryGetValue(breakpoint, out bp)) { bp.Enable(); } else { OnBreakpointAdded(breakpoint); } }
private void Setup(IBreakpoint bp) { if (bp != null) { Line = bp.LineNumber; Enabled = bp.Enabled; LineText = bp.LineText; Breakpoint = bp; } // Assume true for now ConditionResult = true; }
public void AddBreakpoint(IBreakpoint breakpoint) { Contract.Requires(breakpoint != null); lock (syncBreakpoint) { if (!breakpoints.Add(breakpoint)) { throw new BreakpointAlreadySetException(breakpoint); } breakpoint.Set(process); } }
public void Set(IEnumerable <IDebugBoundBreakpoint2> boundBreakpoints) { if (!boundBreakpoints.Any()) { FiredBreakpoint = null; return; } IDebugPendingBreakpoint2 pendingBreakpoint; HResultChecker.Check( boundBreakpoints.First().GetPendingBreakpoint(out pendingBreakpoint)); FiredBreakpoint = _pendingToBreakpoint[pendingBreakpoint]; }
void Initialize(IBreakpoint bp) { Debug.Assert(theDebugger.IsDebugging); var bph = bp as IDnBreakpointHolder; if (bph != null) { bph.Initialize(theDebugger.Debugger); return; } Debug.Fail("Unknown breakpoint: " + bp); }
public int IndexOf(IBreakpoint breakpoint) { int i = 0; var keys = breakpoints.Keys.ToArray(); for (i = 0; i < keys.Length; i++) { if (keys[i] == breakpoint) { return(i); } } return(-1); }
public GDBSnapshot(GDBConnector connector, IDebuggerStop lastDebuggerStop) { _connector = connector; if(lastDebuggerStop == null) throw new ArgumentException("No last stop address found"); if(lastDebuggerStop.Address == 0 ) throw new ArgumentException("Last stop does not provide address"); _myBreakpoint = connector.SetSoftwareBreakpoint(lastDebuggerStop.Address, 0, "_snapshot"); //Activate reverse debugging connector.QueueCommand(new RecordCmd(_connector)); }
public void ClearBreakpoint(IBreakpoint breakpoint) { var breakpointNum = ThreadSafe(() => breakpoints .ToDictionary(x => x.Value, x => x.Key)); if (!breakpointNum.ContainsKey(breakpoint)) { return; } var reqClearBreak = Message.Create <ClearBreakpointRequest>(driver); reqClearBreak.Arguments.Breakpoint = breakpointNum[breakpoint]; reqClearBreak.SendAsync(); }
private void OnBreakpointAdded(IBreakpoint breakpoint) { var types = typeProvider.TypesFor (breakpoint.Location.SourceFile); foreach (var type in types) { foreach (var method in type.Methods) { var bestLocation = BestLocationIn (method, breakpoint); if (bestLocation == null) continue; breakpoints.Add (breakpoint, Factory.CreateBreakpoint (bestLocation)); break; } } }
void IComponentWithBreakpoints.DeleteBreakpoint(IBreakpoint breakpoint) { MemoryBreakpoint bp = breakpoint as MemoryBreakpoint; if (bp != null) { bp.PropertyChanged -= this.OnBreakpointPropertyChanged; this.disabledBreakpoints.Remove(bp); this.readBreakpoints.Remove(bp); this.writeBreakpoints.Remove(bp); this.readBreakpointsArray = this.readBreakpoints.ToArray(); this.writeBreakpointsArray = this.writeBreakpoints.ToArray(); } }
public void SetBreakpoint(IBreakpoint breakpoint) { var setBreakpoint = Message.Create <SetBreakpointRequest>(driver); setBreakpoint.Arguments.TargetType = SetBreakpointRequest.TargetType.ScriptRegExp; setBreakpoint.Arguments.Target = breakpoint.QrcPath; setBreakpoint.Arguments.Line = (int)breakpoint.Line; setBreakpoint.Tag = breakpoint; if (driver.ConnectionState == DebugClientState.Connected) { setBreakpoint.SendAsync(); } else { ThreadSafe(() => outbox.Add(setBreakpoint)); } }
public void StepOver() { if (_isStepping) { return; } _isStepping = true; // need to clear the old breakpoint so lets save it ushort currentPc = _debugger.CPU.PC; byte oldPage = GetRelativePageNum(currentPc); DocumentLocation key = _symbolService.ListTable.GetFileLocation(oldPage, currentPc, currentPc >= 0x8000); string line = _fileService.GetLine(key.FileName, key.LineNumber); int commentIndex = line.IndexOf(";", StringComparison.Ordinal); if (commentIndex != -1) { line = line.Substring(0, commentIndex); } // if the line contains a special commmand (i.e. one that will go to who knows where) // we just want to step over it string[] specialCommands = { "jp", "jr", "ret", "djnz" }; if (specialCommands.Any(s => line.Contains(s))) { _isStepping = false; Step(); return; } do { currentPc++; oldPage = GetRelativePageNum(currentPc); key = _symbolService.ListTable.GetFileLocation(oldPage, currentPc, currentPc >= 0x8000); } while (key == null); _stepOverBreakpoint = _debugger.SetBreakpoint(currentPc >= 0x8000, GetAbsolutePageNum(currentPc), currentPc); _debugger.OnBreakpoint += StepOverBreakpointEvent; _debugger.Step(); _debugger.Running = true; }
private EvaluationResult RunToBreakpoint(Node node, Context context, ModuleLiteral env, EvaluationStackFrame args, Func <EvaluationResult> continuation) { IBreakpointStore breakpoints = GetBreakpointStore(context); if (breakpoints.IsEmpty) { return(continuation()); } IBreakpoint atBreakpoint = breakpoints.Find(env.Path, node); // if at a breakpoint: if (atBreakpoint != null) { PauseEvaluation(node, context, env, args, PauseReasonBreakpoint); } return(continuation()); }
private void OnBreakpointAdded(IBreakpoint breakpoint) { var types = typeProvider.TypesFor(breakpoint.Location.SourceFile); foreach (var type in types) { foreach (var method in type.Methods) { var bestLocation = BestLocationIn(method, breakpoint); if (bestLocation == null) { continue; } breakpoints.Add(breakpoint, Factory.CreateBreakpoint(bestLocation)); break; } } }
public bool RemoveBreakpoint(IBreakpoint breakpoint) { if (!breakpoints.ContainsKey(breakpoint)) { return(false); } IBreakpoint bp; if (breakpoints.TryGetValue(breakpoint, out bp) && bp.Enabled) { breakpoint.Disable(); } if (BreakpointRemoved != null) { BreakpointRemoved(breakpoint); } breakpoints.Remove(breakpoint); return(true); }
private void DebuggerService_OnDebuggingStarted(object sender, DebuggingEventArgs e) { var debugger = e.Debugger; debugger.DebuggerRunningChanged += Debugger_DebuggerRunningChanged; var mapLoadAddress = _symbolService.SymbolTable.GetAddressFromLabel("load_map"); if (!mapLoadAddress.HasValue) { return; } var calcAddr = new CalcAddress(); var calcPage = debugger.NativeDebugger.Memory.Flash[0x15 - (mapLoadAddress.Value >> 16)]; calcAddr.Initialize(calcPage, (ushort)mapLoadAddress.Value); _mapLoadBreak = debugger.NativeDebugger.Breakpoints.Add(calcAddr); debugger.NativeDebugger.Breakpoint += NativeDebuggerOnBreakpoint; }
public void StepOut() { if (_isStepping) { return; } _isStepping = true; DocumentLocation lastCallLocation = CallStack.Last().CallLocation; CalcLocation calcLocation = _symbolService.ListTable.GetCalcLocation(lastCallLocation.FileName, lastCallLocation.LineNumber); DocumentLocation docLocation = null; ushort address = calcLocation.Address; while (docLocation == null) { address++; docLocation = _symbolService.ListTable.GetFileLocation(calcLocation.Page, address, calcLocation.IsRam); } _stepOutBreakpoint = _debugger.SetBreakpoint(calcLocation.IsRam, (byte)(_appPage - calcLocation.Page), address); _debugger.OnBreakpoint += StepOutBreakpointEvent; _debugger.Step(); _debugger.Running = true; }
private void SetupInternalBreakpoints() { if (_debugger == null) { return; } // this is the start _JForceCmdNoChar const ushort jforceCmdNoChar = 0x4027; const ushort insertMem = 0x42F7; const ushort delMem = 0x4357; CalcLocation location = LookupBcallAddress(jforceCmdNoChar); _jforceBreakpoint = _debugger.SetBreakpoint(location.IsRam, location.Page, location.Address); // most likely location that a crash will end up _ramClearBreakpoint = _debugger.SetBreakpoint(false, 0, 0x0000); // for restarts we want to manually delmem location = LookupBcallAddress(insertMem); _insertMemBreakpoint = _debugger.SetBreakpoint(location.IsRam, location.Page, location.Address); // we need to track any memory freed as well location = LookupBcallAddress(delMem); _delMemBreakpoint = _debugger.SetBreakpoint(location.IsRam, location.Page, location.Address); }
private bool AddBreakpoint(IBreakpoint breakpoint) { if (breakpoints.ContainsKey(breakpoint)) { return(false); } breakpoints.Add(breakpoint, null); breakpoint.Enable(); if (BreakpointAdded != null) { BreakpointAdded(breakpoint); } foreach (var type in typeProvider.TypesFor(breakpoint.Location.SourceFile)) { if (BindBreakpoint(type, breakpoint)) { break; } } return(true); }
private void _editorContextMenu_Opening(object sender, CancelEventArgs e) { IBreakpoint bp = this.CurrentRow.Breakpoint; undoToolStripMenuItem.Enabled = this.CanUndo; redoToolStripMenuItem.Enabled = this.CanRedo; insertBreakpointToolStripMenuItem.Text = bp == null ? "Insert Breakpoint" : "Delete Breakpoint"; if (bp != null) { disableBreakpointToolStripMenuItem.Text = bp.Enabled ? "Disable Breakpoint" : "Enable Breakpoint"; } disableBreakpointToolStripMenuItem.Visible = bp != null; toolStripMenuItem2.Visible = bp != null; conditionToolStripMenuItem.Visible = bp != null; hitCountToolStripMenuItem.Visible = bp != null; cutToolStripMenuItem.Enabled = this.Editor.Selection.SelLength != 0; copyToolStripMenuItem.Enabled = this.Editor.Selection.SelLength != 0; pasteToolStripMenuItem.Enabled = Clipboard.ContainsText(); stopOutliningToolStripMenuItem.Text = this.IsOutlining ? "Stop Outlining" : "Start Outlining"; toggleAllOutliningToolStripMenuItem.Visible = this.IsOutlining; toggleOutliningExpansionToolStripMenuItem.Visible = this.IsOutlining; }
public BreakpointEventArgs (IBreakpoint breakpoint) { this.breakpoint = breakpoint; }
public bool IsBound(IBreakpoint breakpoint) { IBreakpoint val = null; return breakpoints.TryGetValue (breakpoint, out val) && val != null; }
private static SledProjectFilesBreakpointType FindBreakpointInFile(SledProjectFilesFileType file, IBreakpoint ibp) { return file.Breakpoints.FirstOrDefault(bp => bp.Breakpoint == ibp); }
private void AddBreakpoint(ISledDocument sd, IBreakpoint ibp) { // Called when click-adding a breakpoint in an open document AddBreakpoints(sd, new[] { ibp }); }
public DebuggerStop(StopReasonEnum stopReason, IBreakpoint breakpoint, UInt64 address, Int64 status) { _stopReason = stopReason; _breakpoint = breakpoint; _address = address; _status = status; }
public IEnumerable<ILocation> GetBoundLocations(IBreakpoint breakpoint) { return breakpoints.Where (x => x.Key == breakpoint).Select (b => b.Value.Location as ILocation); }
public ILocation GetBoundLocation(IBreakpoint breakpoint) { IBreakpoint val = null; return breakpoints.TryGetValue (breakpoint, out val) && val != null ? val.Location : null; }
private bool BindBreakpoint(ITypeMirror type, IBreakpoint bp) { foreach (var method in type.Methods) { var bestLocation = BestLocationIn (method, bp); if (bestLocation == null) continue; var b = Factory.CreateBreakpoint (bestLocation); breakpoints[bp] = b; if (bp.Enabled) b.Enable (); if (BreakpointBound != null) BreakpointBound (bp, b, b.Location); return true; } return false; }
private bool AddBreakpoint(IBreakpoint breakpoint) { if (breakpoints.ContainsKey (breakpoint)) return false; breakpoints.Add (breakpoint, null); breakpoint.Enable (); if (BreakpointAdded != null) BreakpointAdded (breakpoint); foreach(var type in typeProvider.TypesFor (breakpoint.Location.SourceFile)) if (BindBreakpoint (type, breakpoint)) break; return true; }
public bool RemoveBreakpoint(IBreakpoint breakpoint) { if (!breakpoints.ContainsKey (breakpoint)) return false; IBreakpoint bp; if (breakpoints.TryGetValue (breakpoint, out bp) && bp.Enabled) breakpoint.Disable (); if (BreakpointRemoved != null) BreakpointRemoved (breakpoint); breakpoints.Remove (breakpoint); return true; }
public void Remove(IBreakpoint bp) { dispatcher.UI(() => { if (theDebugger.IsDebugging) { var bph = bp as IDnBreakpointHolder; if (bph != null) { var dnbp = bph.DnBreakpoint; if (dnbp != null) theDebugger.Debugger.RemoveBreakpoint(bph.DnBreakpoint); } else Debug.Fail("Unknown breakpoint: " + bp); } else { bool b = breakpointsToInitialize.Remove(bp); Debug.Assert(b); } }); }
private bool AddBreakpoint(IBreakpoint breakpoint) { if (breakpoints.ContainsKey (breakpoint)) return false; breakpoints.Add (breakpoint, null); return true; }
private void RemoveBreakpoint(ISledDocument sd, IBreakpoint ibp) { // Called when click-removing a breakpoint in an open document var file = sd.SledProjectFile; if (file == null) return; var bp = FindBreakpointInFile(file, ibp); if (bp == null) return; // Remove breakpoint from file (will fire event through Collection_Removing) if (file.Breakpoints.Contains(bp)) file.Breakpoints.Remove(bp); // Save changes m_projectService.SaveSettings(); }
private ILocation BestLocationIn(IMethodMirror method, IBreakpoint bp) { return method.Locations.FirstOrDefault (l => l.SourceFile == bp.Location.SourceFile && l.LineNumber == bp.Location.LineNumber); }
/// <summary> /// Constructor /// </summary> /// <param name="bp"></param> public IBreakpointEventArgs(IBreakpoint bp) { Breakpoint = bp; }
/// <summary> /// Create a SLED style breakpoint from a SyntaxEditorControl style breakpoint /// </summary> /// <param name="ibp">SyntaxEditorControl style breakpoint</param> /// <returns>SLED breakpoint</returns> public static SledProjectFilesBreakpointType Create(IBreakpoint ibp) { var node = new DomNode(SledSchema.SledProjectFilesBreakpointType.Type); var bp = node.As<SledProjectFilesBreakpointType>(); bp.Setup(ibp); return bp; }
private void OnBreakpointDisabled(IBreakpoint breakpoint) { IBreakpoint bp; if (breakpoints.TryGetValue (breakpoint, out bp)) bp.Disable (); }
public FuzzDescription(IBreakpoint snapshotBreakpoint, IBreakpoint restoreBreakpoint) { _snapshotBreakpoint = snapshotBreakpoint; _restoreBreakpoint = restoreBreakpoint; }
public int IndexOf(IBreakpoint breakpoint) { int i = 0; var keys = breakpoints.Keys.ToArray (); for (i = 0; i < keys.Length; i++) if (keys[i] == breakpoint) return i; return -1; }