public void ReseatWatches( Types.ASM.FileInfo ASMFileInfo ) { List<WatchEntry> entriesToRemove = new List<WatchEntry>(); bool hadChanges = false; foreach ( var watchEntry in m_WatchEntries ) { if ( watchEntry.LiteralValue ) { // is literal value, no need to reseat continue; } int addressOfEntry = ASMFileInfo.AddressFromToken( watchEntry.Name ); if ( addressOfEntry == -1 ) { entriesToRemove.Add( watchEntry ); hadChanges = true; } else { if ( watchEntry.Address != addressOfEntry ) { watchEntry.Address = addressOfEntry; hadChanges = true; } } } foreach ( var entryToRemove in entriesToRemove ) { m_WatchEntries.Remove( entryToRemove ); } if ( hadChanges ) { Core.TaskManager.AddTask( new Tasks.TaskUpdateWatches() ); } }
public void ReseatBreakpoints(Types.ASM.FileInfo ASMFileInfo) { foreach (var key in BreakPoints.Keys) { foreach (Types.Breakpoint breakPoint in BreakPoints[key]) { breakPoint.RemoteIndex = -1; breakPoint.IsVirtual = false; breakPoint.Virtual.Clear(); breakPoint.Virtual.Add(breakPoint); if (key != "C64Studio.DebugBreakpoints") { breakPoint.Address = -1; int globalLineIndex = 0; if (ASMFileInfo.FindGlobalLineIndex(breakPoint.LineIndex, breakPoint.DocumentFilename, out globalLineIndex)) { int address = ASMFileInfo.FindLineAddress(globalLineIndex); if (breakPoint.Address != address) { breakPoint.Address = address; Core.MainForm.Document_DocumentEvent(new BaseDocument.DocEvent(BaseDocument.DocEvent.Type.BREAKPOINT_UPDATED, breakPoint)); } if (address != -1) { //Debug.Log( "Found breakpoint at address " + address ); } } else if (breakPoint.AddressSource != null) { var address = ASMFileInfo.AddressFromToken(breakPoint.AddressSource); if (address != -1) { breakPoint.Address = address; Core.MainForm.Document_DocumentEvent(new BaseDocument.DocEvent(BaseDocument.DocEvent.Type.BREAKPOINT_UPDATED, breakPoint)); } } } } } }