private static FileAndLineNumber FindNearestLine(PdbFunction function, int ilOffset) { int distance = int.MaxValue; FileAndLineNumber nearest = new FileAndLineNumber(); foreach (PdbSequencePointCollection sequenceCollection in function.SequencePoints) { foreach (PdbSequencePoint point in sequenceCollection.Lines) { int dist = (int)Math.Abs(point.Offset - ilOffset); if (dist < distance) { nearest.File = sequenceCollection.File.Name; nearest.Line = (int)point.LineBegin; } } } return(nearest); }
private static FileAndLineNumber FindNearestLine(PdbFunction function, int ilOffset) { int distance = int.MaxValue; FileAndLineNumber nearest = new FileAndLineNumber(); foreach (PdbSequencePointCollection sequenceCollection in function.SequencePoints) { foreach (PdbSequencePoint point in sequenceCollection.Lines) { int dist = (int)Math.Abs(point.Offset - ilOffset); if (dist < distance) { nearest.File = sequenceCollection.File.Name; nearest.Line = (int)point.LineBegin; } } } return nearest; }