Esempio n. 1
0
        /// <summary>
        /// Intializes a new instance.
        /// </summary>
        /// <param name="debuggerController">The parent Debugger Controller.</param>
        public BreakpointController(DebuggerController debuggerController)
        {
            Breakpoints = new List <BreakpointDefinition>();

            DebuggerController = debuggerController;
            DebuggerController.StateChanged += new DebuggerController.StateChangedHandler(DebuggerController_StateChanged);
        }
Esempio n. 2
0
        /// <summary>
        /// Intializes a new instance.
        /// </summary>
        /// <param name="debuggerController">The parent Debugger Controller.</param>
        public BreakpointController(DebuggerController debuggerController)
        {
            Breakpoints = new List<BreakpointDefinition>();

            DebuggerController = debuggerController;
            DebuggerController.StateChanged += new DebuggerController.StateChangedHandler(DebuggerController_StateChanged);
        }
Esempio n. 3
0
 public NotLoadedState(DebuggerController controller)
 {
     Controller = controller;
     Platform   = controller.Platform;
 }
Esempio n. 4
0
 public RunningState(DebuggerController controller)
 {
     Controller = controller;
     Platform   = controller.Platform;
 }
Esempio n. 5
0
 public SuspendedState(DebuggerController controller)
 {
     Controller = controller;
     Platform   = controller.Platform;
 }
Esempio n. 6
0
 public SuspendedState(DebuggerController controller)
 {
     Controller = controller;
     Platform = controller.Platform;
 }
Esempio n. 7
0
 public RunningState(DebuggerController controller)
 {
     Controller = controller;
     Platform = controller.Platform;
 }
Esempio n. 8
0
 public NotLoadedState(DebuggerController controller)
 {
     Controller = controller;
     Platform = controller.Platform;
 }
Esempio n. 9
0
 /// <summary>
 /// Updates the content of the Watch pad according to the specified debugger state.
 /// </summary>
 /// <param name="state">The debugger state.</param>
 protected virtual void UpdateWatchPad(DebuggerController.States state)
 {
     WatchPad.CanEdit = state == DebuggerController.States.Suspended;
     foreach (var item in WatchPad.WatchItems)
     {
         UpdateWatchItem(item);
     }
 }
Esempio n. 10
0
 /// <summary>
 /// Updates the content of the Hardware pad according to the specified debugger state.
 /// </summary>
 /// <param name="state">The debugger state.</param>
 protected abstract void UpdateHardwarePad(DebuggerController.States state);
Esempio n. 11
0
            /// <summary>
            /// Updates Debug Menus and Toolbars according to the specified debugger state.
            /// </summary>
            /// <param name="state">The debugger state.</param>
            protected virtual void UpdateDebugMenusAndToolbars(DebuggerController.States state)
            {
                DebugToolStripMenuItem.Enabled = DebugToolStripButton.Enabled =
                    state != DebuggerController.States.Running;

                PauseToolStripMenuItem.Enabled = PauseToolStripButton.Enabled =
                    state == DebuggerController.States.Running;

                StopToolStripMenuItem.Enabled = StopToolStripButton.Enabled =
                    state != DebuggerController.States.NotLoaded;

                RestartToolStripMenuItem.Enabled = RestartToolStripButton.Enabled =
                    state != DebuggerController.States.NotLoaded;

                StepIntoToolStripMenuItem.Enabled =
                    state == DebuggerController.States.NotLoaded ||
                    state == DebuggerController.States.Suspended;

                bool suspended = state == DebuggerController.States.Suspended;
                StepOverToolStripMenuItem.Enabled = suspended;
                StepOutToolStripMenuItem.Enabled = suspended;
                StepBackIntoToolStripMenuItem.Enabled = suspended;
                StepBackOverToolStripMenuItem.Enabled = suspended;
                StepBackOutToolStripMenuItem.Enabled = suspended;
            }
Esempio n. 12
0
 /// <summary>
 /// Updates the content of the Breakpoints pad according to the specified debugger state.
 /// </summary>
 /// <param name="state">The debugger state.</param>
 protected virtual void UpdateBreakpointsPad(DebuggerController.States state)
 {
     if (state == DebuggerController.States.Suspended)
     {
         var reason = Platform.DebuggerController.ExecutionInterruptReason;
         if (reason != null && reason.HitBreakpoints != null)
         {
             BreakpointsPad.HighlightBreakpoints(reason.HitBreakpoints);
         }
     }
 }
Esempio n. 13
0
            /// <summary>
            /// Updates GUI elements according to the specified debugger state.
            /// </summary>
            /// <param name="state">The debugger state.</param>
            public virtual void Update(DebuggerController.States state)
            {
                UpdateDebugMenusAndToolbars(state);
                UpdateWatchPad(state);
                UpdateHardwarePad(state);
                UpdateBreakpointsPad(state);

                // Debugger Exception handling.
                if (state == DebuggerController.States.Suspended)
                {
                    HandleDebuggerException();
                }
            }
Esempio n. 14
0
 /// <summary>
 /// Updates editors according to the specified debugger state.
 /// </summary>
 /// <param name="state">The debugger state.</param>
 public virtual void Update(DebuggerController.States state)
 {
     switch (state)
     {
         case DebuggerController.States.NotLoaded:
             EditorsReadOnly = false;
             ClearHighlightedLines();
             break;
         case DebuggerController.States.Suspended:
             EditorsReadOnly = true;
             var dc = Platform.DebuggerController;
             HighlightLine(dc.HighlightedFile, dc.HighlightedLine);
             break;
         case DebuggerController.States.Running:
             EditorsReadOnly = true;
             ClearHighlightedLines();
             break;
     }
 }
Esempio n. 15
0
        /// <summary>
        /// Handles the debugger state change.
        /// </summary>
        /// <param name="state"></param>
        protected void DebuggerController_StateChanged(DebuggerController.States state)
        {
            var editors = Editors as DebuggableEditorProvider;
            editors.Update(state);
            var gui = Gui as DebuggableGuiProvider;
            gui.Update(state);

            // Note: Using a reverse order, i.e. GUI, then Editors would cause
            // the editor not the highlight the current line at the prompt
            // displayed by the GUI update on exception.
            // It would not be a bug per se, but it would be an inconvenience
            // for the user..
        }
Esempio n. 16
0
 /// <summary>
 /// Loads breakpoints to debugger on program start.
 /// </summary>
 /// <param name="state">The current debugger state.</param>
 protected void DebuggerController_StateChanged(DebuggerController.States state)
 {
     if (state != DebuggerController.States.NotLoaded)
     {
         if (_debuggerControllerState == DebuggerController.States.NotLoaded)
         {
             LoadLineBreakpointsFromOpenEditors();
             LoadBreakpointsToDebugger();
         }
     }
     _debuggerControllerState = state;
 }