Debugger: Prevent power cycling from unloading .dbg file when .dbg file doesn't have the same name as the rom file

This commit is contained in:
Sour 2019-01-19 15:32:38 -05:00
parent bfcc990cb3
commit 65bba15d0a

View file

@ -135,14 +135,12 @@ namespace Mesen.GUI.Debugger
public static void AutoLoadDbgFiles(bool silent)
{
Ld65DbgImporter oldSymbolProvider = SymbolProvider;
if(ConfigManager.Config.DebugInfo.AutoLoadDbgFiles) {
RomInfo info = InteropEmu.GetRomInfo();
string dbgPath = Path.Combine(info.RomFile.Folder, info.GetRomName() + ".dbg");
if(File.Exists(dbgPath)) {
DateTime lastDbgUpdate = File.GetLastWriteTime(dbgPath);
if(lastDbgUpdate != oldSymbolProvider?.DbgFileStamp) {
if(lastDbgUpdate != SymbolProvider?.DbgFileStamp) {
ImportDbgFile(dbgPath, silent);
} else {
//Currently loaded symbol provider is still valid
@ -160,10 +158,6 @@ namespace Mesen.GUI.Debugger
}
}
}
if(oldSymbolProvider == SymbolProvider) {
SymbolProvider = null;
}
}
public static void ImportNesasmFnsFile(string fnsPath, bool silent = false)