Exemple #1
0
        /// <summary>
        /// Reads from stream.
        /// </summary>
        /// <param name="stream">The stream.</param>
        /// <exception cref="System.IO.InvalidDataException">Version of object is not supported!</exception>
        private void ReadFromStream(System.IO.BinaryReader stream)
        {
            int version = stream.ReadInt32();

            if (version <= 0 || version > StreamVersion)
            {
                throw new System.IO.InvalidDataException("Version of object is not supported!");
            }

            this.FileVersion = new int[4];
            for (int i = 0; i < 4; i++)
            {
                this.FileVersion[i] = stream.ReadInt32();
            }

            {
                int count = stream.ReadInt32();
                for (int i = 0; i < count; i++)
                {
                    DebugTypeInfo dt = new DebugTypeInfo();
                    dt.ReadFromStream(stream);
                    this.Types[dt.VTable] = dt;
                }
            }

            {
                int count = stream.ReadInt32();
                for (int i = 0; i < count; i++)
                {
                    var fi = new DebugFunctionInfo();
                    fi.ReadFromStream(stream);
                    this.Functions.Add(fi);
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Adds the function information.
        /// </summary>
        /// <param name="offsetBegin">The offset begin.</param>
        /// <param name="offsetEnd">The offset end.</param>
        /// <param name="shortName">The short name.</param>
        /// <param name="fullName">The full name.</param>
        /// <param name="id">The unique ID.</param>
        internal void AddFunctionInfo(ulong offsetBegin, ulong offsetEnd, string shortName, string fullName, ulong id)
        {
            var fi = new DebugFunctionInfo();

            fi.Id        = id;
            fi.Begin     = offsetBegin;
            fi.End       = offsetEnd;
            fi.ShortName = shortName;
            fi.FullName  = fullName;

            this.Functions.Add(fi);
        }