public void NETBinaryWithPdb_PdbHash() { using (var stream = GetStream("NETBinaryWithPdb")) { string hash = manager.ReadPdbHash(stream); Assert.Equal("74D5496D80E64ED5A87D020228ACB5711", hash); } }
private IBinaryInfo BuildBinaryInfo(IAddInfo addInfo, IList <IPackageEntry> fileInfos, IPackageEntry binaryFileInfo) { var binaryInfo = new BinaryInfo(addInfo); binaryInfo.Name = Path.GetFileNameWithoutExtension(binaryFileInfo.FullPath); binaryInfo.Type = Path.GetExtension(binaryFileInfo.FullPath).Substring(1); binaryInfo.File = binaryFileInfo; using (var stream = binaryFileInfo.Stream) { binaryInfo.Hash = binaryStoreManager.ReadBinaryHash(stream); stream.Seek(0, SeekOrigin.Begin); binaryInfo.SymbolHash = binaryStoreManager.ReadPdbHash(stream); } string symbolName = Path.ChangeExtension(binaryFileInfo.FullPath, "pdb"); var symbolFileInfo = fileInfos.SingleOrDefault(s => s.FullPath == symbolName); if (symbolFileInfo != null) { var symbolInfo = new SymbolInfo(binaryInfo); symbolInfo.Type = Path.GetExtension(symbolFileInfo.FullPath).Substring(1); symbolInfo.File = symbolFileInfo; using (var stream = symbolFileInfo.Stream) { symbolInfo.Hash = symbolStoreManager.ReadHash(stream); } symbolInfo.SourceInfos = sourceDiscover.FindSources(fileInfos, binaryInfo, symbolInfo).OrderBy(s => s.KeyPath).ToArray(); binaryInfo.SymbolInfo = symbolInfo; } string documentationName = Path.ChangeExtension(binaryFileInfo.FullPath, "xml"); var documentationFileInfo = fileInfos.SingleOrDefault(s => s.FullPath == documentationName); if (documentationFileInfo != null) { var documentationInfo = new DocumentationInfo(binaryInfo); documentationInfo.Type = Path.GetExtension(documentationFileInfo.FullPath).Substring(1); documentationInfo.File = documentationFileInfo; binaryInfo.DocumentationInfo = documentationInfo; } return(binaryInfo); }