/// <summary> /// Tries to add a break point. If insertion fails, null will be returned. /// </summary> public static BreakpointWrapper AddBreakpoint(string file, int line) { var tbp = GetBreakpointAt(file, line); if (tbp != null) { return(tbp); } tbp = new BreakpointWrapper(); tbp.File = file; tbp.Line = line; if (DebugManagement.IsDebugging) { ulong off = 0; if (!DebugManagement.Engine.Symbols.GetOffsetByLine(file, (uint)line, out off)) { return(null); } var bp = DebugManagement.Engine.AddBreakPoint(BreakPointOptions.Enabled); bp.Offset = off; tbp.Breakpoint = bp; } Breakpoints.Add(tbp); return(tbp); }
/// <summary> /// Clears local breakpoint array and fills it using the 'Online' Breakpoint array of the Engine /// </summary> public static void RetrieveBreakpointsFromEngine() { if (!DebugManagement.IsDebugging) { return; } Breakpoints.Clear(); var bps = DebugManagement.Engine.Breakpoints; foreach (var bp in bps) { var bpw = new BreakpointWrapper() { Breakpoint = bp }; uint line = 0; string file = null; DebugManagement.Engine.Symbols.GetLineByOffset(bp.Offset, out file, out line); bpw.File = file; bpw.Line = (int)line + 1; Breakpoints.Add(bpw); } }
public BreakpointMarker(EditorDocument EditorDoc, BreakpointWrapper breakPoint) : base(EditorDoc.MarkerStrategy, EditorDoc.Editor.Document.GetOffset(breakPoint.Line, 0), true) { this.Breakpoint = breakPoint; MarkerType = TextMarkerType.None; BackgroundColor = Colors.DarkRed; ForegroundColor = Colors.White; }
public static void RemoveBreakpoint(BreakpointWrapper bpw) { if (bpw == null) { return; } if (Breakpoints.Contains(bpw)) { Breakpoints.Remove(bpw); } if (DebugManagement.IsDebugging && bpw.IsExisting) { DebugManagement.Engine.RemoveBreakPoint(bpw.Breakpoint); } bpw.Breakpoint = null; }
public static void RemoveBreakpoint(BreakpointWrapper bpw) { if (bpw == null) return; if (Breakpoints.Contains(bpw)) Breakpoints.Remove(bpw); if (DebugManagement.IsDebugging && bpw.IsExisting) DebugManagement.Engine.RemoveBreakPoint(bpw.Breakpoint); bpw.Breakpoint = null; }
/// <summary> /// Tries to add a break point. If insertion fails, null will be returned. /// </summary> public static BreakpointWrapper AddBreakpoint(string file, int line) { var tbp = GetBreakpointAt(file, line); if (tbp != null) return tbp; tbp = new BreakpointWrapper(); tbp.File = file; tbp.Line = line; if (DebugManagement.IsDebugging) { ulong off = 0; if (!DebugManagement.Engine.Symbols.GetOffsetByLine(file, (uint)line, out off)) return null; var bp = DebugManagement.Engine.AddBreakPoint(BreakPointOptions.Enabled); bp.Offset = off; tbp.Breakpoint = bp; } Breakpoints.Add(tbp); return tbp; }
/// <summary> /// Clears local breakpoint array and fills it using the 'Online' Breakpoint array of the Engine /// </summary> public static void RetrieveBreakpointsFromEngine() { if (!DebugManagement.IsDebugging) return; Breakpoints.Clear(); var bps = DebugManagement.Engine.Breakpoints; foreach (var bp in bps) { var bpw = new BreakpointWrapper() { Breakpoint = bp }; uint line = 0; string file = null; DebugManagement.Engine.Symbols.GetLineByOffset(bp.Offset, out file, out line); bpw.File = file; bpw.Line = (int)line+1; Breakpoints.Add(bpw); } }
public BreakpointMarker(EditorDocument EditorDoc, BreakpointWrapper breakPoint) :base(EditorDoc.MarkerStrategy,EditorDoc.Editor.Document.GetOffset(breakPoint.Line,0),true) { this.Breakpoint = breakPoint; MarkerType = TextMarkerType.None; BackgroundColor = Colors.DarkRed; ForegroundColor = Colors.White; }