Пример #1
0
        /// <summary>
        /// Parses the compilation units.
        /// </summary>
        /// <param name="debugData">The debug data.</param>
        /// <param name="debugDataDescription">The debug data description.</param>
        /// <param name="debugStrings">The debug strings.</param>
        /// <param name="addressNormalizer">Normalize address delegate (<see cref="NormalizeAddressDelegate"/>)</param>
        private static DwarfCompilationUnit[] ParseCompilationUnits(byte[] debugData, byte[] debugDataDescription, byte[] debugStrings, NormalizeAddressDelegate addressNormalizer)
        {
            using (DwarfMemoryReader debugDataReader = new DwarfMemoryReader(debugData))
                using (DwarfMemoryReader debugDataDescriptionReader = new DwarfMemoryReader(debugDataDescription))
                    using (DwarfMemoryReader debugStringsReader = new DwarfMemoryReader(debugStrings))
                    {
                        List <DwarfCompilationUnit> compilationUnits = new List <DwarfCompilationUnit>();

                        while (!debugDataReader.IsEnd)
                        {
                            DwarfCompilationUnit compilationUnit = new DwarfCompilationUnit(debugDataReader, debugDataDescriptionReader, debugStringsReader, addressNormalizer);

                            compilationUnits.Add(compilationUnit);
                        }

                        return(compilationUnits.ToArray());
                    }
        }
Пример #2
0
        /// <summary>
        /// Parses the compilation units.
        /// </summary>
        /// <param name="debugData">The debug data.</param>
        /// <param name="debugDataDescription">The debug data description.</param>
        /// <param name="debugStrings">The debug strings.</param>
        /// <param name="codeSegmentOffset">The code segment offset.</param>
        private static DwarfCompilationUnit[] ParseCompilationUnits(byte[] debugData, byte[] debugDataDescription, byte[] debugStrings, ulong codeSegmentOffset)
        {
            using (DwarfMemoryReader debugDataReader = new DwarfMemoryReader(debugData))
                using (DwarfMemoryReader debugDataDescriptionReader = new DwarfMemoryReader(debugDataDescription))
                    using (DwarfMemoryReader debugStringsReader = new DwarfMemoryReader(debugStrings))
                    {
                        List <DwarfCompilationUnit> compilationUnits = new List <DwarfCompilationUnit>();

                        while (!debugDataReader.IsEnd)
                        {
                            DwarfCompilationUnit compilationUnit = new DwarfCompilationUnit(debugDataReader, debugDataDescriptionReader, debugStringsReader, codeSegmentOffset);

                            compilationUnits.Add(compilationUnit);
                        }

                        return(compilationUnits.ToArray());
                    }
        }