示例#1
0
 public static void ResetWorkspace()
 {
     if (_workspace != null)
     {
         _workspace.Breakpoints       = new List <Breakpoint>();
         _workspace.WatchValues       = new List <string>();
         _workspace.SpcWatchValues    = new List <string>();
         _workspace.Sa1WatchValues    = new List <string>();
         _workspace.GsuWatchValues    = new List <string>();
         _workspace.NecDspWatchValues = new List <string>();
         _workspace.GbWatchValues     = new List <string>();
         _workspace.CpuLabels         = new List <CodeLabel>();
         _workspace.SpcLabels         = new List <CodeLabel>();
         _workspace.NecDspLabels      = new List <CodeLabel>();
         _workspace.GbLabels          = new List <CodeLabel>();
         WatchManager.GetWatchManager(CpuType.Cpu).WatchEntries     = _workspace.WatchValues;
         WatchManager.GetWatchManager(CpuType.Spc).WatchEntries     = _workspace.SpcWatchValues;
         WatchManager.GetWatchManager(CpuType.Sa1).WatchEntries     = _workspace.Sa1WatchValues;
         WatchManager.GetWatchManager(CpuType.Gsu).WatchEntries     = _workspace.GsuWatchValues;
         WatchManager.GetWatchManager(CpuType.NecDsp).WatchEntries  = _workspace.NecDspWatchValues;
         WatchManager.GetWatchManager(CpuType.Gameboy).WatchEntries = _workspace.GbWatchValues;
         BreakpointManager.SetBreakpoints(_workspace.Breakpoints);
         LabelManager.SetDefaultLabels();
         LabelManager.RefreshLabels();
         _workspace.Save();
         Clear();
     }
 }
        public static DebugWorkspace GetWorkspace()
        {
            string romName = EmuApi.GetRomInfo().GetRomName();

            if (_workspace == null || _romName != romName)
            {
                if (_workspace != null)
                {
                    SaveWorkspace();
                }
                _romName   = romName;
                _workspace = DebugWorkspace.GetWorkspace();

                //Load watch entries
                WatchManager.GetWatchManager(CpuType.Cpu).WatchEntries = _workspace.WatchValues;
                WatchManager.GetWatchManager(CpuType.Spc).WatchEntries = _workspace.SpcWatchValues;
                WatchManager.GetWatchManager(CpuType.Sa1).WatchEntries = _workspace.Sa1WatchValues;
                WatchManager.GetWatchManager(CpuType.Gsu).WatchEntries = _workspace.GsuWatchValues;

                LabelManager.ResetLabels();
                LabelManager.SetLabels(_workspace.CpuLabels);
                LabelManager.SetLabels(_workspace.SpcLabels);
                LabelManager.SetDefaultLabels();

                ImportDbgFile();
                LabelManager.RefreshLabels();

                //Load breakpoints
                BreakpointManager.SetBreakpoints(_workspace.Breakpoints);
            }
            return(_workspace);
        }
示例#3
0
        public static void ImportSymFile(string symPath, bool silent = false)
        {
            if (ConfigManager.Config.Debug.DbgIntegration.ResetLabelsOnImport)
            {
                ResetLabels();
            }

            string symContent = File.ReadAllText(symPath);

            if (symContent.Contains("[labels]"))
            {
                //Assume WLA-DX symbol files
                new WlaDxImporter().Import(symPath, silent);
            }
            else
            {
                RomInfo romInfo = EmuApi.GetRomInfo();
                if (romInfo.CoprocessorType == CoprocessorType.Gameboy)
                {
                    if (RgbdsSymbolFile.IsValidFile(symPath))
                    {
                        RgbdsSymbolFile.Import(symPath, silent);
                    }
                    else
                    {
                        BassLabelFile.Import(symPath, silent);
                    }
                }
                else
                {
                    BassLabelFile.Import(symPath, silent);
                }
            }
            LabelManager.RefreshLabels();
        }
示例#4
0
 public static void ImportMslFile(string mslPath, bool silent = false)
 {
     if (ConfigManager.Config.Debug.DbgIntegration.ResetLabelsOnImport)
     {
         ResetLabels();
     }
     MslLabelFile.Import(mslPath, silent);
     LabelManager.RefreshLabels();
 }
示例#5
0
        public static void ImportDbgFile(string dbgPath, bool silent = false)
        {
            _symbolProvider = null;

            _symbolProvider = new DbgImporter();
            (_symbolProvider as DbgImporter).Import(dbgPath, silent);
            SymbolProviderChanged?.Invoke(_symbolProvider);
            LabelManager.RefreshLabels();

            SymbolProviderChanged?.Invoke(_symbolProvider);
        }
 public static void ResetLabels()
 {
     if (_workspace != null)
     {
         _workspace.CpuLabels = new List <CodeLabel>();
         _workspace.SpcLabels = new List <CodeLabel>();
         LabelManager.ResetLabels();
         LabelManager.SetDefaultLabels();
         LabelManager.RefreshLabels();
     }
 }
        public static void ImportDbgFile()
        {
            _symbolProvider = null;

            if (ConfigManager.Config.Debug.DbgIntegration.AutoImport)
            {
                RomInfo romInfo = EmuApi.GetRomInfo();
                string  dbgPath = Path.Combine(((ResourcePath)romInfo.RomPath).Folder, romInfo.GetRomName() + ".dbg");
                if (File.Exists(dbgPath))
                {
                    _symbolProvider = new DbgImporter();
                    _symbolProvider.Import(dbgPath, true);
                    SymbolProviderChanged?.Invoke(_symbolProvider);
                    LabelManager.RefreshLabels();
                }
            }

            SymbolProviderChanged?.Invoke(_symbolProvider);
        }
示例#8
0
        public static void ImportSymFile(string symPath, bool silent = false)
        {
            if (ConfigManager.Config.Debug.DbgIntegration.ResetLabelsOnImport)
            {
                ResetLabels();
            }

            string symContent = File.ReadAllText(symPath);

            if (symContent.Contains("[labels]"))
            {
                //Assume WLA-DX symbol files
                new WlaDxImporter().Import(symPath, silent);
            }
            else
            {
                BassLabelFile.Import(symPath, silent);
            }
            LabelManager.RefreshLabels();
        }
示例#9
0
        public static DebugWorkspace GetWorkspace()
        {
            string romName = EmuApi.GetRomInfo().GetRomName();

            if (_workspace != null)
            {
                SaveWorkspace();
            }

            if (_workspace == null || _romName != romName)
            {
                _romName   = romName;
                _workspace = DebugWorkspace.GetWorkspace();

                //Load watch entries
                WatchManager.GetWatchManager(CpuType.Cpu).WatchEntries     = _workspace.WatchValues;
                WatchManager.GetWatchManager(CpuType.Spc).WatchEntries     = _workspace.SpcWatchValues;
                WatchManager.GetWatchManager(CpuType.Sa1).WatchEntries     = _workspace.Sa1WatchValues;
                WatchManager.GetWatchManager(CpuType.Gsu).WatchEntries     = _workspace.GsuWatchValues;
                WatchManager.GetWatchManager(CpuType.NecDsp).WatchEntries  = _workspace.NecDspWatchValues;
                WatchManager.GetWatchManager(CpuType.Gameboy).WatchEntries = _workspace.GbWatchValues;

                LabelManager.ResetLabels();
                LabelManager.SetLabels(_workspace.CpuLabels);
                LabelManager.SetLabels(_workspace.SpcLabels);
                LabelManager.SetLabels(_workspace.NecDspLabels);
                LabelManager.SetLabels(_workspace.GbLabels);
                LabelManager.SetDefaultLabels();

                AutoImportSymbols();
            }

            //Send breakpoints & labels to emulation core (even if the same game is running)
            LabelManager.RefreshLabels();
            BreakpointManager.SetBreakpoints(_workspace.Breakpoints);

            return(_workspace);
        }