Beispiel #1
0
 public static void ResetLabels()
 {
     LabelManager.ResetLabels();
     if (!ConfigManager.Config.DebugInfo.DisableDefaultLabels)
     {
         LabelManager.SetDefaultLabels(InteropEmu.GetRomInfo().MapperId);
     }
     SaveWorkspace();
     GetWorkspace();
 }
Beispiel #2
0
 private void mnuResetWorkspace_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("This operation will empty the watch window, remove all breakpoints, and reset labels to their default state." + Environment.NewLine + "Are you sure?", "", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK)
     {
         DebugWorkspaceManager.ResetWorkspace();
         LabelManager.ResetLabels();
         UpdateWorkspace();
         UpdateDebugger(false);
     }
 }
Beispiel #3
0
 public static void ResetWorkspace()
 {
     if (_workspace != null)
     {
         lock (_lock) {
             if (_workspace != null)
             {
                 _workspace.Breakpoints = new List <Breakpoint>();
                 _workspace.Labels      = new List <CodeLabel>();
                 _workspace.WatchValues = new List <string>();
                 LabelManager.ResetLabels();
                 WatchManager.WatchEntries = _workspace.WatchValues;
                 BreakpointManager.SetBreakpoints(_workspace.Breakpoints);
                 _workspace.Save();
                 Clear();
             }
         }
     }
 }
Beispiel #4
0
        public static DebugWorkspace GetWorkspace()
        {
            string romName = InteropEmu.GetRomInfo().GetRomName();

            if (_workspace == null || _romName != romName)
            {
                SymbolProvider = null;
                lock (_lock) {
                    if (_workspace == null || _romName != romName)
                    {
                        if (_workspace != null)
                        {
                            SaveWorkspace();
                        }
                        _romName   = InteropEmu.GetRomInfo().GetRomName();
                        _workspace = DebugWorkspace.GetWorkspace();

                        //Setup labels
                        if (_workspace.Labels.Count == 0)
                        {
                            LabelManager.ResetLabels();
                            if (!ConfigManager.Config.DebugInfo.DisableDefaultLabels)
                            {
                                LabelManager.SetDefaultLabels(InteropEmu.GetRomInfo().MapperId);
                            }
                        }
                        else
                        {
                            LabelManager.ResetLabels();
                            LabelManager.SetLabels(_workspace.Labels, true);
                        }

                        //Load watch entries
                        WatchManager.WatchEntries = _workspace.WatchValues;

                        //Load breakpoints
                        BreakpointManager.SetBreakpoints(_workspace.Breakpoints);
                    }
                }
            }
            return(_workspace);
        }
Beispiel #5
0
        public static DebugWorkspace GetWorkspace()
        {
            string romName = InteropEmu.GetRomInfo().GetRomName();

            if (_workspace == null || _romName != romName)
            {
                lock (_lock) {
                    if (_workspace == null || _romName != romName)
                    {
                        if (_workspace != null)
                        {
                            SaveWorkspace();
                        }
                        _romName   = InteropEmu.GetRomInfo().GetRomName();
                        _workspace = DebugWorkspace.GetWorkspace();

                        //Setup labels
                        if (_workspace.Labels.Count == 0)
                        {
                            LabelManager.ResetLabels();
                            if (!ConfigManager.Config.DebugInfo.DisableDefaultLabels)
                            {
                                LabelManager.SetDefaultLabels(InteropEmu.FdsGetSideCount() > 0);
                            }
                        }
                        else
                        {
                            LabelManager.ResetLabels();
                            LabelManager.SetLabels(_workspace.Labels, false);
                        }

                        //Load watch entries
                        WatchManager.WatchEntries = _workspace.WatchValues;

                        //Load breakpoints
                        BreakpointManager.Breakpoints.Clear();
                        BreakpointManager.Breakpoints.AddRange(_workspace.Breakpoints);
                    }
                }
            }
            return(_workspace);
        }
Beispiel #6
0
        public static void SetupWorkspace(bool saveCurrentWorkspace = true)
        {
            string romName = InteropEmu.GetRomInfo().GetRomName();

            lock (_lock) {
                if (_workspace != null && _romName == romName)
                {
                    if (saveCurrentWorkspace)
                    {
                        SaveWorkspace();
                    }

                    //Setup labels
                    if (_workspace.Labels.Count == 0)
                    {
                        LabelManager.ResetLabels();
                        if (!ConfigManager.Config.DebugInfo.DisableDefaultLabels)
                        {
                            LabelManager.SetDefaultLabels(InteropEmu.FdsGetSideCount() > 0);
                        }
                    }
                    else
                    {
                        LabelManager.ResetLabels();
                        LabelManager.SetLabels(_workspace.Labels, false);
                    }

                    //Load watch entries
                    WatchManager.WatchEntries = _workspace.WatchValues;

                    //Load breakpoints
                    BreakpointManager.SetBreakpoints(_workspace.Breakpoints);
                }
                else
                {
                    Clear();
                }
            }
        }