Exemple #1
0
        public IEnumerator <CvSymbol> GetEnumerator()
        {
            CvStream cvStream = new CvStream(this.stream);

            using (BinaryReader reader = new BinaryReader(cvStream))
            {
                object state = Prepare(reader);

                do
                {
                    // Read the len+id of the symbol
                    long     startPos = cvStream.Position;
                    CvSymbol symbol   = CvSymbol.Read(reader);
                    yield return(symbol);

                    // Skip to the next 4 byte boundary
                    CvUtil.PadToBoundary(reader, 4);

                    long nextPos = startPos + symbol.Length + 2;
                    if (nextPos < cvStream.Length)
                    {
                        // Move to the next symbol
                        cvStream.Seek(nextPos, SeekOrigin.Begin);
                    }
                    else
                    {
                        break;
                    }
                }               while (IsComplete(state) == false);
            }
        }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CvPublicSymbol3"/> struct.
 /// </summary>
 /// <param name="length">The length of the symbol in the stream.</param>
 /// <param name="type">The type of the CodeView entry.</param>
 /// <param name="reader">The reader used to access the stream.</param>
 internal CvPublicSymbol3(ushort length, CvEntryType type, BinaryReader reader) :
     base(length, type)
 {
     this.symtype = reader.ReadInt32();
     this.offset  = reader.ReadInt32();
     this.segment = reader.ReadInt16();
     this.name    = CvUtil.ReadString(reader);
 }
Exemple #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="PdbType"/> class.
 /// </summary>
 /// <param name="reader">The reader to initialize From.</param>
 protected PdbType(BinaryReader reader)
 {
     this.unknown1    = reader.ReadInt32();
     this.range       = new PdbSymbolRangeEx(reader);
     this.flag        = reader.ReadInt16();
     this.stream      = reader.ReadInt16();
     this.symbol_size = reader.ReadInt32();
     this.lineno_size = reader.ReadInt32();
     this.unknown2    = reader.ReadInt32();
     this.nSrcFiles   = reader.ReadInt32();
     this.attribute   = reader.ReadInt32();
     this.reserved1   = reader.ReadInt32();
     this.reserved2   = reader.ReadInt32();
     this.name        = CvUtil.ReadString(reader);
     this.unknown3    = CvUtil.ReadString(reader);
     CvUtil.PadToBoundary(reader, 4);
 }