Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Commit 7a6df89

Browse files
fix build
1 parent e152b74 commit 7a6df89

1 file changed

Lines changed: 6 additions & 25 deletions

File tree

src/AddIns/Debugger/Debugger.Core/PdbSymbolSource.cs

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,8 @@ public IEnumerable<SequencePoint> GetSequencePoints(Module module, string filena
234234
try {
235235
uint validLine = symDoc.FindClosestLine((uint)line);
236236
symMethods = symReader.GetMethodsFromDocumentPosition(symDoc, validLine, (uint)column);
237+
if (validLine > 0)
238+
line = (int)validLine;
237239
} catch {
238240
yield break; //Not found
239241
}
@@ -250,35 +252,14 @@ public IEnumerable<SequencePoint> GetSequencePoints(Module module, string filena
250252

251253
SequencePoint FindNearestMatchingSequencePoint(SequencePoint[] seqPoints, int line, int column)
252254
{
253-
// value is nearest offset in lines;
254-
// negative numbers: (Start|End)Line is same as line, value is offset in columns
255-
int nearestOffset = 0;
256-
SequencePoint bestMatch = null;
257255
for (int i = 0; i < seqPoints.Length; i++) {
258256
var s = seqPoints[i];
259257
if (s.ContainsLocation(line, column))
260-
return seqPoints[i];
261-
262-
if (bestMatch == null) {
263-
bestMatch = s;
264-
nearestOffset = GetOffsetValue(s, line, column);
265-
} else {
266-
int newOffset = GetOffsetValue(s, line, column);
267-
if ((newOffset < 0 && nearestOffset < 0 && newOffset > nearestOffset) || (newOffset < nearestOffset)) {
268-
bestMatch = s;
269-
nearestOffset = newOffset;
270-
}
271-
}
258+
return s;
259+
if (s.StartLine > line)
260+
return s;
272261
}
273-
274-
return bestMatch;
275-
}
276-
277-
static int GetOffsetValue(SequencePoint s, int line, int column)
278-
{
279-
if (line == s.StartLine || s.EndLine == line)
280-
return -Math.Min(Math.Abs(s.StartColumn - column), Math.Abs(s.EndColumn - column));
281-
return Math.Min(Math.Abs(s.StartLine - line), Math.Abs(s.EndLine - line));
262+
return null;
282263
}
283264

284265
public IEnumerable<ILRange> GetIgnoredILRanges(IMethod method)

0 commit comments

Comments
 (0)