コード例 #1
0
        /// <summary>
        /// Reads <see cref="DefRangeFramePointerRelativeSymbol"/> from the stream.
        /// </summary>
        /// <param name="reader">Stream binary reader.</param>
        /// <param name="symbolStream">Symbol stream that contains this symbol record.</param>
        /// <param name="symbolStreamIndex">Index in symbol stream <see cref="SymbolStream.References"/> array.</param>
        /// <param name="kind">Symbol record kind.</param>
        /// <param name="dataLength">Record data length.</param>
        public static DefRangeFramePointerRelativeSymbol Read(IBinaryReader reader, SymbolStream symbolStream, int symbolStreamIndex, SymbolRecordKind kind, uint dataLength)
        {
            long start  = reader.Position;
            var  symbol = new DefRangeFramePointerRelativeSymbol
            {
                SymbolStream      = symbolStream,
                SymbolStreamIndex = symbolStreamIndex,
                Kind   = kind,
                Offset = reader.ReadUint(),
                Range  = LocalVariableAddressRange.Read(reader),
            };

            int count = (int)(dataLength - (reader.Position - start)) / LocalVariableAddressGap.Size;

            symbol.Gaps = new LocalVariableAddressGap[count];
            for (int i = 0; i < count; i++)
            {
                symbol.Gaps[i] = LocalVariableAddressGap.Read(reader);
            }
            return(symbol);
        }
コード例 #2
0
        /// <summary>
        /// Reads <see cref="DefRangeRegisterSymbol"/> from the stream.
        /// </summary>
        /// <param name="reader">Stream binary reader.</param>
        /// <param name="symbolStream">Symbol stream that contains this symbol record.</param>
        /// <param name="symbolStreamIndex">Index in symbol stream <see cref="SymbolStream.References"/> array.</param>
        /// <param name="kind">Symbol record kind.</param>
        /// <param name="dataLength">Record data length.</param>
        public static DefRangeRegisterSymbol Read(IBinaryReader reader, SymbolStream symbolStream, int symbolStreamIndex, SymbolRecordKind kind, uint dataLength)
        {
            long start  = reader.Position;
            var  symbol = new DefRangeRegisterSymbol
            {
                SymbolStream      = symbolStream,
                SymbolStreamIndex = symbolStreamIndex,
                Kind          = kind,
                Register      = (RegisterId)reader.ReadUshort(),
                MayHaveNoName = reader.ReadUshort(),
                Range         = LocalVariableAddressRange.Read(reader),
            };

            int count = (int)(dataLength - (reader.Position - start)) / LocalVariableAddressGap.Size;

            symbol.Gaps = new LocalVariableAddressGap[count];
            for (int i = 0; i < count; i++)
            {
                symbol.Gaps[i] = LocalVariableAddressGap.Read(reader);
            }
            return(symbol);
        }