private int GetRowForReference(AsmReference reference) { foreach (var pair in functionEntries) { var function = pair.Key; if (function.Name == reference.Name) { int targetOffset = reference.Offset; if (function.Assembly.Count() != 0) { targetOffset += function.Assembly.First().Offset; } int line = 0; foreach (var asm in function.Assembly) { line++; if (asm.Offset == targetOffset) { return(pair.Value.Item1 + line); } } break; } } return(-1); }
private void ShowBranchIndicator(int row, AsmReference reference) { branchRect.Visibility = Visibility.Collapsed; branchArrow.Visibility = Visibility.Collapsed; int otherRow = GetRowForReference(reference); if (otherRow == row || otherRow == -1) { return; } branchRect.SetValue(Grid.RowProperty, Math.Min(row, otherRow)); branchRect.SetValue(Grid.RowSpanProperty, Math.Abs(row - otherRow)); branchArrow.SetValue(Grid.RowProperty, otherRow); branchRect.Visibility = Visibility.Visible; branchArrow.Visibility = Visibility.Visible; }