Debugger: Rework label/breakpoint updates when resetting/loading a rom
This commit is contained in:
parent
63d0017d68
commit
e963310112
10 changed files with 17 additions and 26 deletions
|
@ -45,6 +45,12 @@ namespace Mesen.GUI.Debugger
|
|||
case DebugWindow.Profiler: frm = new frmProfiler(); frm.Icon = Properties.Resources.Speed; break;
|
||||
case DebugWindow.WatchWindow: frm = new frmWatchWindow(); frm.Icon = Properties.Resources.Find; break;
|
||||
}
|
||||
|
||||
if(_openedWindows.Count == 0) {
|
||||
DebugWorkspaceManager.GetWorkspace();
|
||||
DebugWorkspaceManager.AutoLoadDbgFiles(true);
|
||||
}
|
||||
|
||||
_openedWindows.Add(frm);
|
||||
frm.FormClosed += Debugger_FormClosed;
|
||||
frm.Show();
|
||||
|
|
|
@ -87,22 +87,18 @@ namespace Mesen.GUI.Debugger
|
|||
//Load watch entries
|
||||
WatchManager.WatchEntries = _workspace.WatchValues;
|
||||
|
||||
//Load breakpoints
|
||||
BreakpointManager.SetBreakpoints(_workspace.Breakpoints);
|
||||
|
||||
//Setup labels
|
||||
if(_workspace.Labels.Count == 0) {
|
||||
LabelManager.ResetLabels();
|
||||
if(!ConfigManager.Config.DebugInfo.DisableDefaultLabels) {
|
||||
if(_workspace.Labels.Count == 0 && !ConfigManager.Config.DebugInfo.DisableDefaultLabels) {
|
||||
LabelManager.SetDefaultLabels(InteropEmu.GetRomInfo().MapperId);
|
||||
}
|
||||
} else {
|
||||
LabelManager.ResetLabels();
|
||||
LabelManager.SetLabels(_workspace.Labels, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Send breakpoints & labels to emulation core (even if the same game is running)
|
||||
BreakpointManager.SetBreakpoints(_workspace.Breakpoints);
|
||||
LabelManager.RefreshLabels();
|
||||
|
||||
return _workspace;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,7 +71,6 @@ namespace Mesen.GUI.Debugger
|
|||
|
||||
this.UpdateWorkspace();
|
||||
this.AutoLoadCdlFiles();
|
||||
DebugWorkspaceManager.AutoLoadDbgFiles(true);
|
||||
|
||||
if(!Program.IsMono) {
|
||||
this.mnuSplitView.Checked = ConfigManager.Config.DebugInfo.SplitView;
|
||||
|
|
|
@ -89,8 +89,6 @@ namespace Mesen.GUI.Debugger
|
|||
_binder.AddBinding(nameof(DebugInfo.EventViewerShowPreviousFrameEvents), chkShowPreviousFrameEvents);
|
||||
_binder.AddBinding(nameof(DebugInfo.EventViewerShowNtscBorders), chkShowNtscBorders);
|
||||
|
||||
DebugWorkspaceManager.GetWorkspace();
|
||||
|
||||
RestoreLocation(_config.EventViewerLocation, _config.EventViewerSize);
|
||||
|
||||
mnuAutoRefresh.Checked = _config.EventViewerAutoRefresh;
|
||||
|
|
|
@ -35,8 +35,6 @@ namespace Mesen.GUI.Debugger
|
|||
{
|
||||
base.OnLoad(e);
|
||||
|
||||
DebugWorkspaceManager.AutoLoadDbgFiles(true);
|
||||
|
||||
this._selectedTab = this.tabMain.SelectedTab;
|
||||
|
||||
DebugInfo config = ConfigManager.Config.DebugInfo;
|
||||
|
|
|
@ -19,8 +19,6 @@ namespace Mesen.GUI.Debugger
|
|||
InitializeComponent();
|
||||
|
||||
if(!DesignMode) {
|
||||
DebugWorkspaceManager.AutoLoadDbgFiles(true);
|
||||
|
||||
ctrlProfiler.RefreshData();
|
||||
ctrlProfiler.RefreshList();
|
||||
tmrRefresh.Start();
|
||||
|
|
|
@ -50,9 +50,6 @@ namespace Mesen.GUI.Debugger
|
|||
mnuBuiltInScripts
|
||||
);
|
||||
|
||||
//Make sure labels are loaded
|
||||
DebugWorkspaceManager.GetWorkspace();
|
||||
|
||||
DebugInfo config = ConfigManager.Config.DebugInfo;
|
||||
|
||||
_popupMenu = new AutocompleteMenu(txtScriptContent, this);
|
||||
|
|
|
@ -262,9 +262,6 @@ namespace Mesen.GUI.Debugger
|
|||
return;
|
||||
}
|
||||
|
||||
//Make sure labels are up to date
|
||||
DebugWorkspaceManager.GetWorkspace();
|
||||
|
||||
_refreshRunning = true;
|
||||
SetOptions();
|
||||
Task.Run(() => {
|
||||
|
|
|
@ -31,8 +31,6 @@ namespace Mesen.GUI.Debugger
|
|||
base.OnLoad(e);
|
||||
|
||||
if(!DesignMode) {
|
||||
DebugWorkspaceManager.GetWorkspace();
|
||||
DebugWorkspaceManager.AutoLoadDbgFiles(true);
|
||||
_notifListener = new InteropEmu.NotificationListener(ConfigManager.Config.DebugInfo.DebugConsoleId);
|
||||
_notifListener.OnNotification += _notifListener_OnNotification;
|
||||
ctrlWatch.UpdateWatch(true);
|
||||
|
|
|
@ -691,6 +691,10 @@ namespace Mesen.GUI.Forms
|
|||
|
||||
this.StartEmuThread();
|
||||
this.BeginInvoke((MethodInvoker)(() => {
|
||||
if(DebugWindowManager.HasOpenedWindow) {
|
||||
DebugWorkspaceManager.GetWorkspace();
|
||||
DebugWorkspaceManager.AutoLoadDbgFiles(true);
|
||||
}
|
||||
ctrlRecentGames.Visible = false;
|
||||
UpdateViewerSize();
|
||||
ProcessPostLoadCommandSwitches();
|
||||
|
|
Loading…
Add table
Reference in a new issue