示例#1
0
            /// <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);
            }
示例#2
0
            /// <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);
                }
            }
示例#3
0
            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;
            }
示例#4
0
            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;
            }
示例#5
0
			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;
			}
示例#6
0
			/// <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;
			}
示例#7
0
			/// <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);
				}
			}
示例#8
0
			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;
			}