in Core/src/Impl/Commands/LocalFilesScanner.cs [70:103]
private async Task ScanFileAsync(string sourceDir, string sourceFile, ITracer tracer)
{
var srcFile = Path.GetRelativePath(sourceDir, sourceFile);
tracer.Information($" Scanning {srcFile}...");
foreach (var (symbolStoreKey, keyType) in GetKeyInfos(tracer, sourceFile))
{
var index = symbolStoreKey.Index;
if (!SymbolStoreKey.IsKeyValid(index))
{
tracer.Error($"Invalid key index in file {index}");
}
else if (keyType == KeyType.Elf && Path.GetExtension(sourceFile) == ".debug" && !index.EndsWith("/_.debug"))
{
// Bug: Check that ELF .debug was processed right way! See https://github.com/dotnet/symstore/issues/158
tracer.Error($"ELF file {sourceFile} was processed incorrectly because Microsoft.SymbolStore doesn't support .debug extension");
}
else
{
var dstFile = index;
if (
myCompressWPdb && keyType == KeyType.WPdb ||
myCompressPe && keyType == KeyType.Pe)
{
await myProcessCompressed(tracer, sourceDir, srcFile, SymbolStoragePath.FromSystemPath(Path.ChangeExtension(dstFile, PathUtil.GetPackedExtension(Path.GetExtension(dstFile.AsSpan())))));
if (myIsKeepNonCompressed)
await myProcessNormal(tracer, sourceDir, srcFile, SymbolStoragePath.FromSystemPath(dstFile));
}
else
{
await myProcessNormal(tracer, sourceDir, srcFile, SymbolStoragePath.FromSystemPath(dstFile));
}
}
}
}