Author: toshok
Date: 2005-02-24 00:58:28 -0500 (Thu, 24 Feb 2005)
New Revision: 41137

Modified:
   trunk/debugger/ChangeLog
   trunk/debugger/backends/mono/MonoSymbolFile.cs
Log:
2005-02-23  Chris Toshok  <[EMAIL PROTECTED]>

        Fix bug #72827.
        * backends/mono/MonoSymbolFile.cs (JitLexicalBlockEntry): add
        start and end IL Offsets here.  not sure we need them, but it
        makes things consistent with the line number entry.
        (MethodAddress..ctor): read in the lexical block entries.
        (MonoMethod.get_variables): fix the FIXME to use scope ranges for
        variables if local names are ambiguous.



Modified: trunk/debugger/ChangeLog
===================================================================
--- trunk/debugger/ChangeLog    2005-02-24 05:51:09 UTC (rev 41136)
+++ trunk/debugger/ChangeLog    2005-02-24 05:58:28 UTC (rev 41137)
@@ -1,3 +1,13 @@
+2005-02-23  Chris Toshok  <[EMAIL PROTECTED]>
+
+       Fix bug #72827.
+       * backends/mono/MonoSymbolFile.cs (JitLexicalBlockEntry): add
+       start and end IL Offsets here.  not sure we need them, but it
+       makes things consistent with the line number entry.
+       (MethodAddress..ctor): read in the lexical block entries.
+       (MonoMethod.get_variables): fix the FIXME to use scope ranges for
+       variables if local names are ambiguous.
+
 2005-02-21  Martin Baulig  <[EMAIL PROTECTED]>
 
        * backends/DaemonThreadRunner.cs: Removed this old file.

Modified: trunk/debugger/backends/mono/MonoSymbolFile.cs
===================================================================
--- trunk/debugger/backends/mono/MonoSymbolFile.cs      2005-02-24 05:51:09 UTC 
(rev 41136)
+++ trunk/debugger/backends/mono/MonoSymbolFile.cs      2005-02-24 05:58:28 UTC 
(rev 41137)
@@ -81,18 +81,23 @@
 
        internal struct JitLexicalBlockEntry
        {
+               public readonly int StartOffset;
                public readonly int StartAddress;
+               public readonly int EndOffset;
                public readonly int EndAddress;
 
-               public JitLexicalBlockEntry (TargetBinaryReader reader)
+               public JitLexicalBlockEntry (int start_offset, int 
start_address,
+                                            int end_offset, int end_address)
                {
-                       StartAddress = reader.ReadInt32 ();
-                       EndAddress = reader.ReadInt32 ();
+                       StartOffset = start_offset;
+                       StartAddress = start_address;
+                       EndOffset = end_offset;
+                       EndAddress = end_address;
                }
 
                public override string ToString ()
                {
-                       return String.Format ("[JitLexicalBlockEntry 
{0:x}:{1:x}]", StartAddress, EndAddress);
+                       return String.Format ("[JitLexicalBlockEntry 
{0:x}:{1:x}-{2:x}:{3:x}]", StartOffset, StartAddress, EndOffset, EndAddress);
                }
        }
 
@@ -104,6 +109,7 @@
                public readonly TargetAddress MethodEndAddress;
                public readonly TargetAddress WrapperAddress;
                public readonly JitLineNumberEntry[] LineNumbers;
+               public readonly JitLexicalBlockEntry[] LexicalBlocks;
                public readonly VariableInfo ThisVariableInfo;
                public readonly VariableInfo[] ParamVariableInfo;
                public readonly VariableInfo[] LocalVariableInfo;
@@ -139,6 +145,28 @@
                                LineNumbers [i] = new JitLineNumberEntry 
(il_offset, native_offset);
                        }
 
+                       int num_lexical_blocks = reader.ReadLeb128 ();
+                       LexicalBlocks = new JitLexicalBlockEntry 
[num_lexical_blocks];
+
+                       il_offset = 0;
+                       native_offset = 0;
+                       for (int i = 0; i < num_lexical_blocks; i ++) {
+                               int start_offset, end_offset, start_address, 
end_address;
+
+                               il_offset += reader.ReadSLeb128 ();
+                               start_offset = il_offset;
+                               native_offset += reader.ReadSLeb128 ();
+                               start_address = native_offset;
+
+                               il_offset += reader.ReadSLeb128 ();
+                               end_offset = il_offset;
+                               native_offset += reader.ReadSLeb128 ();
+                               end_address = native_offset;
+
+                               LexicalBlocks [i] = new JitLexicalBlockEntry 
(start_offset, start_address,
+                                                                             
end_offset, end_address);
+                       }
+
                        HasThis = reader.ReadByte () != 0;
                        if (HasThis)
                                ThisVariableInfo = new VariableInfo (reader);
@@ -612,7 +640,6 @@
 
                                        local_types [i] = 
file.MonoLanguage.LookupMonoType (type);
 
-#if FIXME
                                        if (method.LocalNamesAmbiguous && 
(local.BlockIndex > 0)) {
                                                int index = local.BlockIndex - 
1;
                                                JitLexicalBlockEntry block = 
address.LexicalBlocks [index];
@@ -627,12 +654,6 @@
                                                        true, local_types 
[i].IsByRef, this,
                                                        
address.LocalVariableInfo [i]);
                                        }
-#else
-                                       locals [i] = new MonoVariable (
-                                               file.backend, local.Name, 
local_types [i],
-                                               true, local_types [i].IsByRef, 
this,
-                                               address.LocalVariableInfo [i]);
-#endif
                                }
 
                                decl_type = (MonoClassType) 
file.MonoLanguage.LookupMonoType (rmethod.DeclaringType);

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to