Пример #1
0
 public BreakpointMarker(TextMarkerService markerStrategy, Breakpoint bp, TextDocument doc, int line_begin, int line_end)
     : base(markerStrategy, doc, line_begin, line_end)
 {
     this.Breakpoint = bp;
     MarkerType = TextMarkerType.None;
     BackgroundColor = Colors.Red;
 }
Пример #2
0
        public Breakpoint CreateBreakpoint(IntPtr address, bool enabled = true)
        {
            var bp = new Breakpoint(Debuggee.MainProcess, address);
            bp.Enabled = enabled;

            breakpoints.Add(bp);

            return bp;
        }
Пример #3
0
 public bool Remove(Breakpoint bp)
 {
     if (bp != null)
     {
         breakpoints.Remove(bp);
         bp.Disable();
         return true;
     }
     return false;
 }
Пример #4
0
        void SkipAndRestoreLastBreakpoint(bool resetStepFlag = true)
        {
            if (lastUnhandledBreakpoint == null)
                throw new Exception("lastUnhandledBreakpoint must not be null");
            if (!lastUnhandledBreakpoint.temporarilyDisabled)
                throw new Exception("breakpoint must be marked as temporarily disabled!");
            if (lastUnhandledBreakpointThread == null)
                throw new Exception("lastUnhandledBreakpointThread must not be null");
            if (postBreakpointResetStepCompleted)
                throw new Exception("why is postBreakpointResetStepCompleted set to true?");

            // Immediately after the breakpoint was hit, the bp code was taken out of the code
            // and the instruction pointer was decreased, so the original instruction will be executed then afterwards.

            // 1) Enable single-stepping (SS flag)
            // 2) Step one forward (execute original instruction)
            // 3) Re-enable breakpoint
            // 4) (optionally) disable single-stepping again

            // 1)
            lastUnhandledBreakpointThread.Context.TrapFlagSet = true;

            // 2)
            lastUnhandledBreakpointThread.ContinueDebugging();

            postBreakpointResetStepCompleted = false;
            Debuggee.WaitForDebugEvent();

            if (!postBreakpointResetStepCompleted)
                return;

            // 3)
            lastUnhandledBreakpoint.Enable();

            // 4)
            if(resetStepFlag)
                lastUnhandledBreakpointThread.Context.TrapFlagSet = false;

            lastUnhandledBreakpointThread = null;
            lastUnhandledBreakpoint = null;
            postBreakpointResetStepCompleted = false;
        }
Пример #5
0
 public override void OnBreakpoint(DebugThread thread, DDebugger.Breakpoints.Breakpoint breakpoint)
 {
     form.HighlightCurrentInstruction(thread);
 }
Пример #6
0
 public virtual void OnBreakpoint(DebugThread thread, Breakpoint breakpoint)
 {
 }