private void AddSeqPoint(SequencePoint currentSeqPoint, LineNumberWriter lineNumberWriter) { if (currentSeqPoint != null) { if (fileName == null && currentSeqPoint.Document != null) { var url = currentSeqPoint.Document.Url; if (url != null) { try { fileName = new FileInfo(url).Name; } catch { // for mono } } } if (currentSeqPoint.StartLine == 0xFeeFee && currentSeqPoint.EndLine == 0xFeeFee) { if (lineNumberWriter.LineNo > 0) { lineNumberWriter.AddMapping(currentSeqPoint.Offset, -1); } } else { if (lineNumberWriter.LineNo != currentSeqPoint.StartLine) { lineNumberWriter.AddMapping(currentSeqPoint.Offset, currentSeqPoint.StartLine); } } } }
public void ProcessMethodBodyInstruction(Instruction instr, SequencePoint currentSeqPoint = null) { if (!enabled) { return; } #if !NETSTANDARD currentSeqPoint = instr.SequencePoint; #endif if (lineNumberWriter != null && currentSeqPoint != null) { if (fileName == null && currentSeqPoint.Document != null) { var url = currentSeqPoint.Document.Url; if (url != null) { try { fileName = new FileInfo(url).Name; } catch { // for mono } } } if (currentSeqPoint.StartLine == 0xFeeFee && currentSeqPoint.EndLine == 0xFeeFee) { if (lineNumberWriter.LineNo > 0) { lineNumberWriter.AddMapping(instr.Offset, -1); } } else { if (lineNumberWriter.LineNo != currentSeqPoint.StartLine) { lineNumberWriter.AddMapping(instr.Offset, currentSeqPoint.StartLine); } } } }