in src/ApiPort/ApiPort.VisualStudio.Common/SourceMapping/SourceLineMapper.cs [31:95]
public IEnumerable<ISourceMappedItem> GetSourceInfo(IEnumerable<string> assemblyPaths, ReportingResult report)
{
var items = new List<ISourceMappedItem>();
_textOutput.WriteLine();
_textOutput.WriteLine(LocalizedStrings.FindingSourceLineInformationFor);
int currentIssues = _progressReporter.Issues.Count;
foreach (var assembly in assemblyPaths)
{
using (var task = _progressReporter.StartTask(string.Format(CultureInfo.InvariantCulture, "\t{0}\b\b\b", Path.GetFileName(assembly))))
{
try
{
var pdbPath = _fileSystem.ChangeFileExtension(assembly, "pdb");
if (!_fileSystem.FileExists(pdbPath))
{
_progressReporter.ReportIssue(string.Format(CultureInfo.CurrentCulture, LocalizedStrings.PdbNotFoundFormat, assembly));
task.Abort();
}
else
{
try
{
var sourceItems = GetSourceInfo(assembly, pdbPath, report);
items.AddRange(sourceItems);
}
catch (OutOfMemoryException ex)
{
// TODO: Update Microsoft.CCI to support parsing portable pdbs.
// Due to an OutOfMemoryException thrown when trying to parse portable pdb files.
// https://github.com/icsharpcode/ILSpy/issues/789
// There is no public build for https://github.com/Microsoft/cci yet, which supports it.
Trace.TraceError("OOM while trying to parse pdb file." + Environment.NewLine + ex.ToString());
_progressReporter.ReportIssue(string.Format(CultureInfo.CurrentCulture, LocalizedStrings.SourceLineMappingNotSupportedPortablePdb, assembly));
task.Abort();
}
}
}
catch (PortabilityAnalyzerException)
{
task.Abort();
}
}
var issues = _progressReporter.Issues.ToArray();
// There were more issues reported while running this current task.
if (currentIssues < issues.Length)
{
for (int i = currentIssues; i < issues.Length; i++)
{
_textOutput.WriteLine(issues[i]);
}
currentIssues = issues.Length;
}
}
return items;
}