Esempio n. 1
0
        MonoSymbolFile(Stream stream)
        {
            reader = new MyBinaryReader(stream);

            try {
                long magic         = reader.ReadInt64();
                int  major_version = reader.ReadInt32();
                int  minor_version = reader.ReadInt32();

                if (magic != OffsetTable.Magic)
                {
                    throw new MonoSymbolFileException("Symbol file is not a valid");
                }
                if (major_version != OffsetTable.MajorVersion)
                {
                    throw new MonoSymbolFileException(
                              "Symbol file has version {0} but expected {1}", major_version, OffsetTable.MajorVersion);
                }
                if (minor_version != OffsetTable.MinorVersion)
                {
                    throw new MonoSymbolFileException("Symbol file has version {0}.{1} but expected {2}.{3}",
                                                      major_version, minor_version,
                                                      OffsetTable.MajorVersion, OffsetTable.MinorVersion);
                }

                MajorVersion = major_version;
                MinorVersion = minor_version;
                guid         = new Guid(reader.ReadBytes(16));

                ot = new OffsetTable(reader, major_version, minor_version);
            } catch (Exception e) {
                throw new MonoSymbolFileException("Cannot read symbol file", e);
            }

            source_file_hash  = new Dictionary <int, SourceFileEntry> ();
            compile_unit_hash = new Dictionary <int, CompileUnitEntry> ();
        }
Esempio n. 2
0
 public MonoSymbolFile()
 {
     ot = new OffsetTable();
 }