int LexicalBlockTableOffset;
#endregion
+ int index;
int file_offset;
- public readonly int Index;
public readonly SourceFileEntry SourceFile;
public readonly LineNumberEntry[] LineNumbers;
public readonly int[] LocalTypeIndices;
public readonly MonoSymbolFile SymbolFile;
+ public int Index {
+ get { return index; }
+ set { index = value; }
+ }
+
public static int Size {
get { return 52; }
}
internal MethodEntry (MonoSymbolFile file, MyBinaryReader reader, int index)
{
this.SymbolFile = file;
- this.Index = index;
+ this.index = index;
SourceFileIndex = reader.ReadInt32 ();
Token = reader.ReadInt32 ();
StartRow = reader.ReadInt32 ();
{
this.SymbolFile = file;
- Index = file.GetNextMethodIndex ();
+ index = -1;
Token = token;
SourceFileIndex = source.Index;
internal MethodSourceEntry Write (MonoSymbolFile file, MyBinaryWriter bw)
{
+ if (index <= 0)
+ throw new InvalidOperationException ();
+
NameOffset = (int) bw.BaseStream.Position;
TypeIndexTableOffset = (int) bw.BaseStream.Position;
bw.Write (NamespaceID);
bw.Write (LocalNamesAmbiguous ? 1 : 0);
- return new MethodSourceEntry (Index, file_offset, StartRow, EndRow);
+ return new MethodSourceEntry (index, file_offset, StartRow, EndRow);
}
internal void WriteIndex (BinaryWriter bw)
public override string ToString ()
{
return String.Format ("[Method {0}:{1}:{2}:{3}:{4} - {6}:{7} - {5}]",
- Index, Token, SourceFileIndex, StartRow, EndRow,
+ index, Token, SourceFileIndex, StartRow, EndRow,
SourceFile, NumLocals, NumLineNumbers);
}
}