diff options
author | Martin Baulig <martin@novell.com> | 2002-10-13 23:31:52 +0400 |
---|---|---|
committer | Martin Baulig <martin@novell.com> | 2002-10-13 23:31:52 +0400 |
commit | 7f2e3af79a5780249b17b85d75ad12cbddc65c58 (patch) | |
tree | 62b4ec858e05927e69e1c41e54703bc0770583ec /mcs | |
parent | 4a996606a4d1b490b00f6b4cfb921386ff7dfd56 (diff) |
2002-10-13 Martin Baulig <martin@gnome.org>
* MonoSymbolTable.cs: Set version number to 28.
(SourceFileEntry): Read the methods when they're needed.
(MethodSourceEntry): Made this a struct, not a class.
svn path=/trunk/mcs/; revision=8223
Diffstat (limited to 'mcs')
-rw-r--r-- | mcs/class/Mono.CSharp.Debugger/ChangeLog | 6 | ||||
-rw-r--r-- | mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs | 37 |
2 files changed, 39 insertions, 4 deletions
diff --git a/mcs/class/Mono.CSharp.Debugger/ChangeLog b/mcs/class/Mono.CSharp.Debugger/ChangeLog index 143ecdd651a..82092649c2e 100644 --- a/mcs/class/Mono.CSharp.Debugger/ChangeLog +++ b/mcs/class/Mono.CSharp.Debugger/ChangeLog @@ -1,5 +1,11 @@ 2002-10-13 Martin Baulig <martin@gnome.org> + * MonoSymbolTable.cs: Set version number to 28. + (SourceFileEntry): Read the methods when they're needed. + (MethodSourceEntry): Made this a struct, not a class. + +2002-10-13 Martin Baulig <martin@gnome.org> + * MonoSymbolTable.cs: Set version number to 27. Added a source file table which is used to search a method by source file + line number. diff --git a/mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs b/mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs index ab6af05af19..0827736d273 100644 --- a/mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs +++ b/mcs/class/Mono.CSharp.Debugger/MonoSymbolTable.cs @@ -154,8 +154,9 @@ namespace Mono.CSharp.Debugger public class SourceFileEntry { public readonly string SourceFile; - public readonly MethodSourceEntry[] Methods = null; + IMonoBinaryReader reader; + long method_position; ArrayList methods; int count; @@ -191,9 +192,30 @@ namespace Mono.CSharp.Debugger SourceFile = Encoding.UTF8.GetString (name); count = reader.ReadInt32 (); - Methods = new MethodSourceEntry [count]; + this.reader = reader; + this.method_position = reader.Position; + + reader.Position += count * MethodSourceEntry.Size; + } + + public MethodSourceEntry[] Methods { + get { + read_methods (); + MethodSourceEntry[] retval = new MethodSourceEntry [methods.Count]; + methods.CopyTo (retval, 0); + return retval; + } + } + + void read_methods () + { + if (methods != null) + return; + + reader.Position = method_position; + methods = new ArrayList (); for (int i = 0; i < count; i++) - Methods [i] = new MethodSourceEntry (reader); + methods.Add (new MethodSourceEntry (reader)); } public override string ToString () @@ -202,7 +224,7 @@ namespace Mono.CSharp.Debugger } } - public class MethodSourceEntry : IComparable + public struct MethodSourceEntry : IComparable { public readonly int Index; public readonly int FileOffset; @@ -225,6 +247,13 @@ namespace Mono.CSharp.Debugger EndRow = reader.ReadInt32 (); } + public static int Size + { + get { + return 16; + } + } + internal void Write (BinaryWriter bw) { bw.Write (Index); |