Beispiel #1
0
        SymbolDocument[] ReadDocuments()
        {
            Debug.Assert(module is not null);
            var docTbl     = pdbMetadata.TablesStream.DocumentTable;
            var docs       = new SymbolDocument[docTbl.Rows];
            var nameReader = new DocumentNameReader(pdbMetadata.BlobStream);
            var custInfos  = ListCache <PdbCustomDebugInfo> .AllocList();

            var gpContext = new GenericParamContext();

            for (int i = 0; i < docs.Length; i++)
            {
                bool b = pdbMetadata.TablesStream.TryReadDocumentRow((uint)i + 1, out var row);
                Debug.Assert(b);
                var url                 = nameReader.ReadDocumentName(row.Name);
                var language            = pdbMetadata.GuidStream.Read(row.Language) ?? Guid.Empty;
                var languageVendor      = GetLanguageVendor(language);
                var documentType        = PdbDocumentConstants.DocumentTypeText;
                var checkSumAlgorithmId = pdbMetadata.GuidStream.Read(row.HashAlgorithm) ?? Guid.Empty;
                var checkSum            = pdbMetadata.BlobStream.ReadNoNull(row.Hash);

                var token = new MDToken(Table.Document, i + 1).ToInt32();
                custInfos.Clear();
                GetCustomDebugInfos(token, gpContext, custInfos);
                var custInfosArray = custInfos.Count == 0 ? Array2.Empty <PdbCustomDebugInfo>() : custInfos.ToArray();

                docs[i] = new SymbolDocumentImpl(url, language, languageVendor, documentType, checkSumAlgorithmId, checkSum, custInfosArray);
            }
            ListCache <PdbCustomDebugInfo> .Free(ref custInfos);

            return(docs);
        }
Beispiel #2
0
        SymbolDocument[] ReadDocuments()
        {
            Debug.Assert(module != null);
            var docTbl     = pdbMetaData.TablesStream.DocumentTable;
            var docs       = new SymbolDocument[docTbl.Rows];
            var nameReader = new DocumentNameReader(pdbMetaData.BlobStream);
            var custInfos  = ListCache <PdbCustomDebugInfo> .AllocList();

            var gpContext = new GenericParamContext();

            for (int i = 0; i < docs.Length; i++)
            {
                uint nameOffset, hashAlgorithmIndex, hashOffset;
                uint languageIndex       = pdbMetaData.TablesStream.ReadDocumentRow2((uint)i + 1, out nameOffset, out hashAlgorithmIndex, out hashOffset);
                var  url                 = nameReader.ReadDocumentName(nameOffset);
                var  language            = pdbMetaData.GuidStream.Read(languageIndex) ?? Guid.Empty;
                var  languageVendor      = GetLanguageVendor(language);
                var  documentType        = PdbDocumentConstants.DocumentTypeText;
                var  checkSumAlgorithmId = pdbMetaData.GuidStream.Read(hashAlgorithmIndex) ?? Guid.Empty;
                var  checkSum            = pdbMetaData.BlobStream.ReadNoNull(hashOffset);

                var token = new MDToken(Table.Document, i + 1).ToInt32();
                custInfos.Clear();
                GetCustomDebugInfos(token, gpContext, custInfos);
                var custInfosArray = custInfos.Count == 0 ? emptyPdbCustomDebugInfos : custInfos.ToArray();

                docs[i] = new SymbolDocumentImpl(url, language, languageVendor, documentType, checkSumAlgorithmId, checkSum, custInfosArray);
            }
            ListCache <PdbCustomDebugInfo> .Free(ref custInfos);

            return(docs);
        }