/// <summary>
        /// Gets the parent symbol record if exists.
        /// </summary>
        /// <returns></returns>
        private SymbolRecord GetParent()
        {
            long parentPosition = GetParentPosition();

            if (parentPosition <= 0)
            {
                return(null);
            }
            return(SymbolStream.GetSymbolRecordByOffset(parentPosition));
        }
        private void ReadSymbolStream(SymbolStream symbolStream)
        {
            var references = symbolStream.References;

            Assert.NotNull(references);
            for (int i = 0; i < references.Count; i++)
            {
                Assert.NotNull(symbolStream[i]);
                Assert.Equal(symbolStream[i], symbolStream.GetSymbolRecordByOffset(references[i].DataOffset - RecordPrefix.Size));
            }
            var kinds = references.Select(r => r.Kind).Distinct().ToArray();

            foreach (var kind in kinds)
            {
                Assert.NotEmpty(symbolStream[kind]);
            }

            // Check symbol record kinds
            var allKinds = new[]
            {
                AnnotationReferenceSymbol.Kinds,
                AnnotationSymbol.Kinds,
                AttributeSlotSymbol.Kinds,
                BlockSymbol.Kinds,
                BuildInfoSymbol.Kinds,
                CallSiteInfoSymbol.Kinds,
                CoffGroupSymbol.Kinds,
                Compile2Symbol.Kinds,
                Compile3Symbol.Kinds,
                ConstantSymbol.Kinds,
                DataSymbol.Kinds,
                DefRangeFramePointerRelativeFullScopeSymbol.Kinds,
                DefRangeFramePointerRelativeSymbol.Kinds,
                DefRangeRegisterRelativeSymbol.Kinds,
                DefRangeRegisterSymbol.Kinds,
                DefRangeSubfieldRegisterSymbol.Kinds,
                EndSymbol.Kinds,
                EnvironmentBlockSymbol.Kinds,
                ExportSymbol.Kinds,
                FileStaticSymbol.Kinds,
                FrameCookieSymbol.Kinds,
                FrameProcedureSymbol.Kinds,
                FunctionListSymbol.Kinds,
                HeapAllocationSiteSymbol.Kinds,
                InlineSiteSymbol.Kinds,
                LabelSymbol.Kinds,
                LocalSymbol.Kinds,
                ManagedProcedureSymbol.Kinds,
                NamespaceSymbol.Kinds,
                ObjectNameSymbol.Kinds,
                OemSymbol.Kinds,
                ProcedureReferenceSymbol.Kinds,
                ProcedureSymbol.Kinds,
                Public32Symbol.Kinds,
                RegisterRelativeSymbol.Kinds,
                SectionSymbol.Kinds,
                ThreadLocalDataSymbol.Kinds,
                Thunk32Symbol.Kinds,
                TokenReferenceSymbol.Kinds,
                TrampolineSymbol.Kinds,
                UdtSymbol.Kinds,
            };

            Assert.NotEmpty(allKinds.SelectMany(ka => ka.SelectMany(k => symbolStream[k])));
        }