예제 #1
0
        private static void LoadDbiStream(
            BitAccess bits,
            out DbiModuleInfo[] modules,
            out DbiDbgHdr header,
            bool readStrings)
        {
            DbiHeader dh = new DbiHeader(bits);

            header = new DbiDbgHdr();

            //if (dh.sig != -1 || dh.ver != 19990903) {
            //  throw new PdbException("Unsupported DBI Stream version, sig={0}, ver={1}",
            //                         dh.sig, dh.ver);
            //}

            // Read gpmod section.
            List <DbiModuleInfo> modList = new List <DbiModuleInfo>();
            int end = bits.Position + dh.gpmodiSize;

            while (bits.Position < end)
            {
                DbiModuleInfo mod = new DbiModuleInfo(bits, readStrings);
                modList.Add(mod);
            }

            if (bits.Position != end)
            {
                throw new PdbDebugException(
                          "Error reading DBI stream, pos={0} != {1}",
                          bits.Position,
                          end);
            }

            if (modList.Count > 0)
            {
                modules = modList.ToArray();
            }
            else
            {
                modules = null;
            }

            // Skip the Section Contribution substream.
            bits.Position += dh.secconSize;

            // Skip the Section Map substream.
            bits.Position += dh.secmapSize;

            // Skip the File Info substream.
            bits.Position += dh.filinfSize;

            // Skip the TSM substream.
            bits.Position += dh.tsmapSize;

            // Skip the EC substream.
            bits.Position += dh.ecinfoSize;

            // Read the optional header.
            end = bits.Position + dh.dbghdrSize;
            if (dh.dbghdrSize > 0)
            {
                header = new DbiDbgHdr(bits);
            }

            bits.Position = end;
        }
예제 #2
0
        private static void LoadDbiStream(BitAccess bits,
                                  out DbiModuleInfo[] modules,
                                  out DbiDbgHdr header,
                                  bool readStrings)
        {
            DbiHeader dh = new DbiHeader(bits);
            header = new DbiDbgHdr();

            //if (dh.sig != -1 || dh.ver != 19990903) {
            //  throw new PdbException("Unsupported DBI Stream version, sig={0}, ver={1}",
            //                         dh.sig, dh.ver);
            //}

            // Read gpmod section.
            List<DbiModuleInfo> modList = new List<DbiModuleInfo>();
            int end = bits.Position + dh.gpmodiSize;
            while (bits.Position < end)
            {
                DbiModuleInfo mod = new DbiModuleInfo(bits, readStrings);
                modList.Add(mod);
            }
            if (bits.Position != end)
            {
                throw new PdbDebugException("Error reading DBI stream, pos={0} != {1}",
                                            bits.Position, end);
            }

            if (modList.Count > 0)
            {
                modules = modList.ToArray();
            }
            else
            {
                modules = null;
            }

            // Skip the Section Contribution substream.
            bits.Position += dh.secconSize;

            // Skip the Section Map substream.
            bits.Position += dh.secmapSize;

            // Skip the File Info substream.
            bits.Position += dh.filinfSize;

            // Skip the TSM substream.
            bits.Position += dh.tsmapSize;

            // Skip the EC substream.
            bits.Position += dh.ecinfoSize;

            // Read the optional header.
            end = bits.Position + dh.dbghdrSize;
            if (dh.dbghdrSize > 0)
            {
                header = new DbiDbgHdr(bits);
            }
            bits.Position = end;
        }