예제 #1
0
        MonoSymbolFile(string filename)
        {
            this.FileName = filename;

            FileStream stream;

            try {
                stream = new FileStream(filename, FileMode.Open, FileAccess.Read);
                reader = new MyBinaryReader(stream);
            } catch (IOException ex) {
                throw new MonoSymbolFileException(
                          "Cannot read symbol file `{0}': {1}", filename, ex.Message);
            }

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

                if (magic != OffsetTable.Magic)
                {
                    throw new MonoSymbolFileException(
                              "Symbol file `{0}' is not a valid " +
                              "Mono symbol file", filename);
                }
                if (major_version != OffsetTable.MajorVersion)
                {
                    throw new MonoSymbolFileException(
                              "Symbol file `{0}' has version {1}, " +
                              "but expected {2}", filename, major_version,
                              OffsetTable.MajorVersion);
                }
                if (minor_version != OffsetTable.MinorVersion)
                {
                    throw new MonoSymbolFileException(
                              "Symbol file `{0}' has version {1}.{2}, " +
                              "but expected {3}.{4}", filename, 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 {
                throw new MonoSymbolFileException(
                          "Cannot read symbol file `{0}'", filename);
            }

            source_file_hash  = new Hashtable();
            compile_unit_hash = new Hashtable();
        }
예제 #2
0
        private MonoSymbolFile(string filename)
        {
            this.FileName = filename;
            FileStream stream = new FileStream(filename, FileMode.Open, FileAccess.Read);

            this.reader = new MyBinaryReader(stream);
            try
            {
                long magic         = this.reader.ReadInt64();
                int  major_version = this.reader.ReadInt32();
                int  minor_version = this.reader.ReadInt32();
                if (magic != 5037318119232611860L)
                {
                    throw new MonoSymbolFileException("Symbol file `{0}' is not a valid Mono symbol file", new object[]
                    {
                        filename
                    });
                }
                if (major_version != 50)
                {
                    throw new MonoSymbolFileException("Symbol file `{0}' has version {1}, but expected {2}", new object[]
                    {
                        filename,
                        major_version,
                        50
                    });
                }
                if (minor_version != 0)
                {
                    throw new MonoSymbolFileException("Symbol file `{0}' has version {1}.{2}, but expected {3}.{4}", new object[]
                    {
                        filename,
                        major_version,
                        minor_version,
                        50,
                        0
                    });
                }
                this.MajorVersion = major_version;
                this.MinorVersion = minor_version;
                this.guid         = new Guid(this.reader.ReadBytes(16));
                this.ot           = new OffsetTable(this.reader, major_version, minor_version);
            }
            catch
            {
                throw new MonoSymbolFileException("Cannot read symbol file `{0}'", new object[]
                {
                    filename
                });
            }
            this.source_file_hash  = new Dictionary <int, SourceFileEntry>();
            this.compile_unit_hash = new Dictionary <int, CompileUnitEntry>();
        }
        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> ();
        }
 internal MonoSymbolFile()
 {
     ot = new OffsetTable();
 }
예제 #5
0
		MonoSymbolFile (string filename)
		{
			this.FileName = filename;
			FileStream stream = new FileStream (filename, FileMode.Open, FileAccess.Read);
			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 `{0}' is not a valid " +
						"Mono symbol file", filename);
				if (major_version != OffsetTable.MajorVersion)
					throw new MonoSymbolFileException (
						"Symbol file `{0}' has version {1}, " +
						"but expected {2}", filename, major_version,
						OffsetTable.MajorVersion);
				if (minor_version != OffsetTable.MinorVersion)
					throw new MonoSymbolFileException (
						"Symbol file `{0}' has version {1}.{2}, " +
						"but expected {3}.{4}", filename, 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 {
				throw new MonoSymbolFileException (
					"Cannot read symbol file `{0}'", filename);
			}

			source_file_hash = new Dictionary<int, SourceFileEntry> ();
			compile_unit_hash = new Dictionary<int, CompileUnitEntry> ();
		}
예제 #6
0
		internal MonoSymbolFile ()
		{
			ot = new OffsetTable ();
		}
예제 #7
0
 public MonoSymbolFile()
 {
     ot = new OffsetTable();
 }
예제 #8
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> ();
        }
예제 #9
0
 public MonoSymbolFile()
 {
     ot = new OffsetTable ();
 }
예제 #10
0
        private MonoSymbolFile(string filename)
        {
            this.FileName = filename;
            FileStream stream = new FileStream(filename, FileMode.Open, FileAccess.Read);
            this.reader = new MyBinaryReader(stream);
            try
            {
                long magic = this.reader.ReadInt64();
                int major_version = this.reader.ReadInt32();
                int minor_version = this.reader.ReadInt32();
                if (magic != 5037318119232611860L)
                {
                    throw new MonoSymbolFileException("Symbol file `{0}' is not a valid Mono symbol file", new object[]
					{
						filename
					});
                }
                if (major_version != 50)
                {
                    throw new MonoSymbolFileException("Symbol file `{0}' has version {1}, but expected {2}", new object[]
					{
						filename,
						major_version,
						50
					});
                }
                if (minor_version != 0)
                {
                    throw new MonoSymbolFileException("Symbol file `{0}' has version {1}.{2}, but expected {3}.{4}", new object[]
					{
						filename,
						major_version,
						minor_version,
						50,
						0
					});
                }
                this.MajorVersion = major_version;
                this.MinorVersion = minor_version;
                this.guid = new Guid(this.reader.ReadBytes(16));
                this.ot = new OffsetTable(this.reader, major_version, minor_version);
            }
            catch
            {
                throw new MonoSymbolFileException("Cannot read symbol file `{0}'", new object[]
				{
					filename
				});
            }
            this.source_file_hash = new Dictionary<int, SourceFileEntry>();
            this.compile_unit_hash = new Dictionary<int, CompileUnitEntry>();
        }