Debugger: Fixed bug that copied watch entries from rom to rom

While the debugger was active and the current rom had watch entries, opening a new rom for the same console that had never been opened in the debugger would end up copying the watch entries from the previous rom into the new rom's workspace
This commit is contained in:
Sour 2025-02-26 20:38:46 +09:00
parent fadf7c4d44
commit 16d6d70376
2 changed files with 9 additions and 0 deletions

View file

@ -282,6 +282,8 @@ namespace Mesen.Debugger.Utilities
LabelManager.ResetLabels();
BreakpointManager.ClearBreakpoints();
WatchManager.ClearEntries();
if(dbgWorkspace.WorkspaceByCpu.Count == 0) {
DefaultLabelHelper.SetDefaultLabels();
} else {

View file

@ -37,6 +37,13 @@ namespace Mesen.Debugger
return manager;
}
public static void ClearEntries()
{
foreach(WatchManager wm in _watchManagers.Values) {
wm.WatchEntries = new();
}
}
public WatchManager(CpuType cpuType)
{
_cpuType = cpuType;