int last_namespace_index;
public readonly int Version = OffsetTable.Version;
- public readonly bool CompatibilityMode = false;
public int NumLineNumbers;
}
ot.SourceTableSize = (int) bw.BaseStream.Position - ot.SourceTableOffset;
- if (!CompatibilityMode) {
- //
- // Write anonymous scope table.
- //
- ot.AnonymousScopeCount = anonymous_scopes != null ? anonymous_scopes.Count : 0;
- ot.AnonymousScopeTableOffset = (int) bw.BaseStream.Position;
- if (anonymous_scopes != null) {
- foreach (AnonymousScopeEntry scope in anonymous_scopes.Values)
- scope.Write (bw);
- }
- ot.AnonymousScopeTableSize = (int) bw.BaseStream.Position - ot.AnonymousScopeTableOffset;
+ //
+ // Write anonymous scope table.
+ //
+ ot.AnonymousScopeCount = anonymous_scopes != null ? anonymous_scopes.Count : 0;
+ ot.AnonymousScopeTableOffset = (int) bw.BaseStream.Position;
+ if (anonymous_scopes != null) {
+ foreach (AnonymousScopeEntry scope in anonymous_scopes.Values)
+ scope.Write (bw);
}
+ ot.AnonymousScopeTableSize = (int) bw.BaseStream.Position - ot.AnonymousScopeTableOffset;
//
// Fixup offset table.
throw new MonoSymbolFileException (
"Symbol file `{0}' is not a valid " +
"Mono symbol file", filename);
- if ((version != OffsetTable.Version) &&
- (version != OffsetTable.CompatibilityVersion))
+ if (version != OffsetTable.Version)
throw new MonoSymbolFileException (
"Symbol file `{0}' has version {1}, " +
"but expected {2}", filename, version,
OffsetTable.Version);
Version = (int) version;
- if (version == OffsetTable.CompatibilityVersion)
- CompatibilityMode = true;
-
guid = new Guid (reader.ReadBytes (16));
ot = new OffsetTable (reader, (int) version);
public struct OffsetTable
{
public const int Version = 41;
- public const int CompatibilityVersion = 39;
public const long Magic = 0x45e82623fd7fa614;
#region This is actually written to the symbol file
MethodTableSize = reader.ReadInt32 ();
TypeCount = reader.ReadInt32 ();
- if (version == CompatibilityVersion) {
- AnonymousScopeCount = 0;
- AnonymousScopeTableOffset = 0;
- AnonymousScopeTableSize = 0;
- } else {
- AnonymousScopeCount = reader.ReadInt32 ();
- AnonymousScopeTableOffset = reader.ReadInt32 ();
- AnonymousScopeTableSize = reader.ReadInt32 ();
- }
+ AnonymousScopeCount = reader.ReadInt32 ();
+ AnonymousScopeTableOffset = reader.ReadInt32 ();
+ AnonymousScopeTableSize = reader.ReadInt32 ();
}
internal void Write (BinaryWriter bw, int version)
bw.Write (MethodTableSize);
bw.Write (TypeCount);
- if (version == CompatibilityVersion)
- return;
-
bw.Write (AnonymousScopeCount);
bw.Write (AnonymousScopeTableOffset);
bw.Write (AnonymousScopeTableSize);
}
}
- [Obsolete("LexicalBlockEntry has been replaced by CodeBlockEntry.")]
- public class LexicalBlockEntry
- {
- public int Index;
- #region This is actually written to the symbol file
- public int StartOffset;
- public int EndOffset;
- #endregion
-
- public LexicalBlockEntry (int index, int start_offset)
- {
- this.Index = index;
- this.StartOffset = start_offset;
- }
-
- internal LexicalBlockEntry (int index, MyBinaryReader reader)
- {
- this.Index = index;
- this.StartOffset = reader.ReadInt32 ();
- this.EndOffset = reader.ReadInt32 ();
- }
-
- public void Close (int end_offset)
- {
- this.EndOffset = end_offset;
- }
-
- internal void Write (MyBinaryWriter bw)
- {
- bw.Write (StartOffset);
- bw.Write (EndOffset);
- }
-
- public override string ToString ()
- {
- return String.Format ("[LexicalBlock {0}:{1}]", StartOffset, EndOffset);
- }
- }
-
public class CodeBlockEntry
{
public int Index;
{
Index = reader.ReadLeb128 ();
Name = reader.ReadString ();
- if (file.CompatibilityMode) {
- int sig_length = reader.ReadLeb128 ();
- reader.BaseStream.Position += sig_length;
- }
BlockIndex = reader.ReadLeb128 ();
}
{
bw.WriteLeb128 (Index);
bw.Write (Name);
- if (file.CompatibilityMode)
- bw.WriteLeb128 (0);
bw.WriteLeb128 (BlockIndex);
}
namespaces = new ArrayList ();
}
- [Obsolete]
- public void DefineMethod (string name, int token, LocalVariableEntry[] locals,
- LineNumberEntry[] lines, LexicalBlockEntry[] blocks,
- int start, int end, int namespace_id)
- {
- DefineMethod (token, null, locals, lines, null, null,
- start, end, namespace_id);
- }
-
public void DefineMethod (int token, ScopeVariable[] scope_vars,
LocalVariableEntry[] locals, LineNumberEntry[] lines,
CodeBlockEntry[] blocks, string real_name,
public readonly CodeBlockEntry[] CodeBlocks;
public readonly ScopeVariable[] ScopeVariables;
- [Obsolete]
- public LexicalBlockEntry[] LexicalBlocks {
- get { return new LexicalBlockEntry [0]; }
- }
-
public readonly string RealName;
public readonly MonoSymbolFile SymbolFile;
NamespaceID = reader.ReadInt32 ();
LocalNamesAmbiguous = reader.ReadInt32 () != 0;
- if (!file.CompatibilityMode) {
- NumCodeBlocks = reader.ReadInt32 ();
- CodeBlockTableOffset = reader.ReadInt32 ();
+ NumCodeBlocks = reader.ReadInt32 ();
+ CodeBlockTableOffset = reader.ReadInt32 ();
- NumScopeVariables = reader.ReadInt32 ();
- ScopeVariableTableOffset = reader.ReadInt32 ();
+ NumScopeVariables = reader.ReadInt32 ();
+ ScopeVariableTableOffset = reader.ReadInt32 ();
- RealNameOffset = reader.ReadInt32 ();
- if (RealNameOffset != 0)
- RealName = file.ReadString (RealNameOffset);
- }
+ RealNameOffset = reader.ReadInt32 ();
+ if (RealNameOffset != 0)
+ RealName = file.ReadString (RealNameOffset);
SourceFile = file.GetSourceFile (SourceFileIndex);
bw.Write (NamespaceID);
bw.Write (LocalNamesAmbiguous ? 1 : 0);
- if (!file.CompatibilityMode) {
- bw.Write (NumCodeBlocks);
- bw.Write (CodeBlockTableOffset);
+ bw.Write (NumCodeBlocks);
+ bw.Write (CodeBlockTableOffset);
- bw.Write (NumScopeVariables);
- bw.Write (ScopeVariableTableOffset);
+ bw.Write (NumScopeVariables);
+ bw.Write (ScopeVariableTableOffset);
- bw.Write (RealNameOffset);
- }
+ bw.Write (RealNameOffset);
return new MethodSourceEntry (index, file_offset, StartRow, EndRow);
}