void Registers_PropertyChanged(object?sender, PropertyChangedEventArgs e) { ushort?address = Registers.Current.PC; if (address.HasValue) { var matchingLine = acmePdbManager.FindLineUsingAddress(address.Value); if (matchingLine is not null) { var file = acmePdbManager.FindFileOfLine(matchingLine) !; int matchingLineNumber = file.Lines.IndexOf(matchingLine); dispatcher.Dispatch( new OpenSourceFileMessage(file, ExecutingLine: matchingLineNumber) ); return; } } SourceFileViewerViewModel.ClearExecutionRow(); }
internal void OpenSourceFile(object?item) { switch (item) { case AcmeFile acmeFile: dispatcher.Dispatch(new OpenSourceFileMessage(acmeFile)); break; case AcmeLabel label: var line = acmePdbManager.FindLineUsingAddress(label.Address); if (line is not null) { var file = acmePdbManager.FindFileOfLine(line); // file can't be null actually if (file is not null) { int lineNumber = file.Lines.IndexOf(line); dispatcher.Dispatch(new OpenSourceFileMessage(file, lineNumber, null)); } } break; } }