Read() static private method

static private Read ( MonoSymbolFile file, MyBinaryReader br ) : LineNumberTable
file MonoSymbolFile
br MyBinaryReader
return LineNumberTable
Esempio n. 1
0
        //internal void Write(MyBinaryWriter bw)
        //{
        //    if (this.index <= 0 || this.DataOffset == 0)
        //    {
        //        throw new InvalidOperationException();
        //    }
        //    bw.Write(this.Token);
        //    bw.Write(this.DataOffset);
        //    bw.Write(this.LineNumberTableOffset);
        //}
        //internal void WriteData(MonoSymbolFile file, MyBinaryWriter bw)
        //{
        //    if (this.index <= 0)
        //    {
        //        throw new InvalidOperationException();
        //    }
        //    this.LocalVariableTableOffset = (int)bw.BaseStream.Position;
        //    int num_locals = (this.locals != null) ? this.locals.Length : 0;
        //    bw.WriteLeb128(num_locals);
        //    for (int i = 0; i < num_locals; i++)
        //    {
        //        this.locals[i].Write(file, bw);
        //    }
        //    file.LocalCount += num_locals;
        //    this.CodeBlockTableOffset = (int)bw.BaseStream.Position;
        //    int num_code_blocks = (this.code_blocks != null) ? this.code_blocks.Length : 0;
        //    bw.WriteLeb128(num_code_blocks);
        //    for (int i = 0; i < num_code_blocks; i++)
        //    {
        //        this.code_blocks[i].Write(bw);
        //    }
        //    this.ScopeVariableTableOffset = (int)bw.BaseStream.Position;
        //    int num_scope_vars = (this.scope_vars != null) ? this.scope_vars.Length : 0;
        //    bw.WriteLeb128(num_scope_vars);
        //    for (int i = 0; i < num_scope_vars; i++)
        //    {
        //        this.scope_vars[i].Write(bw);
        //    }
        //    if (this.real_name != null)
        //    {
        //        this.RealNameOffset = (int)bw.BaseStream.Position;
        //        bw.Write(this.real_name);
        //    }
        //    this.LineNumberTableOffset = (int)bw.BaseStream.Position;
        //    this.lnt.Write(file, bw);
        //    this.DataOffset = (int)bw.BaseStream.Position;
        //    bw.WriteLeb128(this.CompileUnitIndex);
        //    bw.WriteLeb128(this.LocalVariableTableOffset);
        //    bw.WriteLeb128(this.NamespaceID);
        //    bw.WriteLeb128(this.CodeBlockTableOffset);
        //    bw.WriteLeb128(this.ScopeVariableTableOffset);
        //    bw.WriteLeb128(this.RealNameOffset);
        //    bw.WriteLeb128((int)this.flags);
        //}
        public LineNumberTable GetLineNumberTable()
        {
            LineNumberTable result;

            lock (this.SymbolFile)
            {
                if (this.lnt != null)
                {
                    result = this.lnt;
                }
                else
                {
                    if (this.LineNumberTableOffset == 0)
                    {
                        result = null;
                    }
                    else
                    {
                        MyBinaryReader reader  = this.SymbolFile.BinaryReader;
                        long           old_pos = reader.BaseStream.Position;
                        reader.BaseStream.Position = (long)this.LineNumberTableOffset;
                        this.lnt = LineNumberTable.Read(this.SymbolFile, reader);
                        reader.BaseStream.Position = old_pos;
                        result = this.lnt;
                    }
                }
            }
            return(result);
        }
Esempio n. 2
0
        public LineNumberTable GetLineNumberTable()
        {
            lock (SymbolFile) {
                if (lnt != null)
                {
                    return(lnt);
                }

                if (LineNumberTableOffset == 0)
                {
                    return(null);
                }

                MyBinaryReader reader  = SymbolFile.BinaryReader;
                long           old_pos = reader.BaseStream.Position;
                reader.BaseStream.Position = LineNumberTableOffset;

                lnt = LineNumberTable.Read(SymbolFile, reader, (flags & Flags.ColumnsInfoIncluded) != 0, (flags & Flags.EndInfoIncluded) != 0);

                reader.BaseStream.Position = old_pos;
                return(lnt);
            }
        }
Esempio n. 3
0
        public LineNumberTable GetLineNumberTable()
        {
            lock (SymbolFile) {
                if (lnt != null)
                {
                    return(lnt);
                }

                if (LineNumberTableOffset == 0)
                {
                    return(null);
                }

                MyBinaryReader reader  = SymbolFile.BinaryReader;
                long           old_pos = reader.BaseStream.Position;
                reader.BaseStream.Position = LineNumberTableOffset;

                lnt = LineNumberTable.Read(SymbolFile, reader);

                reader.BaseStream.Position = old_pos;
                return(lnt);
            }
        }