Browse Source

fix build

pull/520/merge
Siegfried Pammer 11 years ago
parent
commit
7a6df89318
  1. 31
      src/AddIns/Debugger/Debugger.Core/PdbSymbolSource.cs

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

@ -234,6 +234,8 @@ namespace Debugger
try { try {
uint validLine = symDoc.FindClosestLine((uint)line); uint validLine = symDoc.FindClosestLine((uint)line);
symMethods = symReader.GetMethodsFromDocumentPosition(symDoc, validLine, (uint)column); symMethods = symReader.GetMethodsFromDocumentPosition(symDoc, validLine, (uint)column);
if (validLine > 0)
line = (int)validLine;
} catch { } catch {
yield break; //Not found yield break; //Not found
} }
@ -250,35 +252,14 @@ namespace Debugger
SequencePoint FindNearestMatchingSequencePoint(SequencePoint[] seqPoints, int line, int column) SequencePoint FindNearestMatchingSequencePoint(SequencePoint[] seqPoints, int line, int column)
{ {
// value is nearest offset in lines;
// negative numbers: (Start|End)Line is same as line, value is offset in columns
int nearestOffset = 0;
SequencePoint bestMatch = null;
for (int i = 0; i < seqPoints.Length; i++) { for (int i = 0; i < seqPoints.Length; i++) {
var s = seqPoints[i]; var s = seqPoints[i];
if (s.ContainsLocation(line, column)) if (s.ContainsLocation(line, column))
return seqPoints[i]; return s;
if (s.StartLine > line)
if (bestMatch == null) { return s;
bestMatch = s;
nearestOffset = GetOffsetValue(s, line, column);
} else {
int newOffset = GetOffsetValue(s, line, column);
if ((newOffset < 0 && nearestOffset < 0 && newOffset > nearestOffset) || (newOffset < nearestOffset)) {
bestMatch = s;
nearestOffset = newOffset;
}
} }
} return null;
return bestMatch;
}
static int GetOffsetValue(SequencePoint s, int line, int column)
{
if (line == s.StartLine || s.EndLine == line)
return -Math.Min(Math.Abs(s.StartColumn - column), Math.Abs(s.EndColumn - column));
return Math.Min(Math.Abs(s.StartLine - line), Math.Abs(s.EndLine - line));
} }
public IEnumerable<ILRange> GetIgnoredILRanges(IMethod method) public IEnumerable<ILRange> GetIgnoredILRanges(IMethod method)

Loading…
Cancel
Save