예제 #1
0
        /// <summary>
        /// Reads debug subsections from references for the specified index.
        /// </summary>
        /// <param name="index">Index of the debug subsection.</param>
        private DebugSubsection GetDebugSubsection(int index)
        {
            // Since DictionaryCache is allowing only single thread to call this function, we don't need to lock reader here.
            DebugSubsectionReference reference = references[index];

            Reader.Position = reference.DataOffset;
            switch (reference.Kind)
            {
            case DebugSubsectionKind.Lines:
                return(LinesSubsection.Read(Reader, reference.Kind, reference.DataLen));

            case DebugSubsectionKind.FileChecksums:
                return(FileChecksumSubsection.Read(Reader, reference.Kind));

            default:
#if DEBUG
                throw new NotImplementedException($"Unknown reference kind: {reference.Kind}");
#else
                return(null);
#endif
            }
        }