internal SymbolFile( Func <string, bool> symlinkTester, Client bxlClient, string filePath, string fileId, ContentHash hash, IEnumerable <DebugEntryData> debugEntries) { Contract.Requires(symlinkTester != null); Contract.Requires(bxlClient != null); Contract.Requires(!string.IsNullOrEmpty(filePath)); Contract.Requires(!string.IsNullOrEmpty(fileId)); Contract.Requires(debugEntries == null || debugEntries.All(de => de.BlobIdentifier == null)); // It's not clear whether the symbol endpoint can play nicely with dedup hashes, so locking it down to VSO0 for now. Contract.Requires(hash.HashType == HashType.Vso0, "support only VSO0 hashes (for now)"); m_symlinkTester = symlinkTester; m_bxlClient = bxlClient; FullFilePath = Path.GetFullPath(filePath); m_file = FileId.Parse(fileId); Hash = hash; if (debugEntries != null) { var blobIdentifier = new Microsoft.VisualStudio.Services.BlobStore.Common.BlobIdentifier(Hash.ToHashByteArray()); var entries = new List <DebugEntryData>(debugEntries); entries.ForEach(entry => entry.BlobIdentifier = blobIdentifier); m_debugEntries = entries; } }
/// <nodoc/> public void SetDebugEntries(List <DebugEntryData> entries) { Contract.Requires(entries != null); // check that either all entries are missing the blobId, or all the entries have the same blobId and that blobId matches this file var blobIdentifier = new Microsoft.VisualStudio.Services.BlobStore.Common.BlobIdentifier(Hash.ToHashByteArray()); Contract.Assert(entries.All(e => e.BlobIdentifier == null) || entries.All(e => e.BlobIdentifier == blobIdentifier)); // ensure that BlobIdentifier is not null // here we 'trust' that the debug entries are from the current symbol file entries.ForEach(entry => entry.BlobIdentifier = blobIdentifier); m_debugEntries = entries; }