Author: martin
Date: 2007-09-10 21:13:12 -0400 (Mon, 10 Sep 2007)
New Revision: 85617

Modified:
   branches/martin/debugger-generics/languages/mono/MonoClassType.cs
   branches/martin/debugger-generics/languages/mono/MonoType.cs
Log:


Modified: branches/martin/debugger-generics/languages/mono/MonoClassType.cs
===================================================================
--- branches/martin/debugger-generics/languages/mono/MonoClassType.cs   
2007-09-11 00:58:54 UTC (rev 85616)
+++ branches/martin/debugger-generics/languages/mono/MonoClassType.cs   
2007-09-11 01:13:12 UTC (rev 85617)
@@ -457,6 +457,8 @@
                        reader.ReadAddress ();
                        TargetAddress element_class = reader.ReadAddress ();
 
+                       Console.WriteLine ("READ MONO CLASS: {0} {1} {2}", 
address, element_class, file);
+
                        if (file == null)
                                return null;
 
@@ -474,10 +476,16 @@
                        reader.Offset = 
language.MonoMetadataInfo.KlassGenericContainerOffset;
                        TargetAddress generic_container = reader.ReadAddress ();
 
+                       Console.WriteLine ("READ MONO CLASS #1: {0:x} {1:x} {2} 
{3}",
+                                          token, type, generic_class, 
generic_container);
+
+#if FIXME
                        if (!generic_class.IsNull || !generic_container.IsNull)
                                return null;
+#endif
 
-                       if ((type == 0x11) || (type == 0x12)) { // 
MONO_TYPE_(VALUETYPE|CLASS)
+                       if ((type == 0x11) || (type == 0x12) || (type == 0x15)) 
{
+                               // MONO_TYPE_(VALUETYPE|CLASS), 
MONO_TYPE_GENERICINST
                                Cecil.TypeDefinition tdef;
 
                                if ((token & 0xff000000) != 0x02000000)
@@ -510,6 +518,8 @@
                                return new MonoArrayType (eklass, rank);
                        }
 
+                       Console.WriteLine ("UNKNOWN CLASS: {0:x}", type);
+
                        return null;
                }
 

Modified: branches/martin/debugger-generics/languages/mono/MonoType.cs
===================================================================
--- branches/martin/debugger-generics/languages/mono/MonoType.cs        
2007-09-11 00:58:54 UTC (rev 85616)
+++ branches/martin/debugger-generics/languages/mono/MonoType.cs        
2007-09-11 01:13:12 UTC (rev 85617)
@@ -124,12 +124,15 @@
 
                        case MonoTypeEnum.MONO_TYPE_GENERICINST: {
                                TargetReader reader = new TargetReader 
(memory.ReadMemory (
-                                       data, 3 * 
memory.TargetInfo.TargetAddressSize));
+                                       data, 5 * 
memory.TargetInfo.TargetAddressSize));
 
                                TargetAddress container_addr = 
reader.ReadAddress ();
                                TargetAddress class_inst_addr = 
reader.ReadAddress ();
                                TargetAddress method_inst_addr = 
reader.ReadAddress ();
 
+                               reader.ReadAddress ();
+                               TargetAddress cached = reader.ReadAddress ();
+
                                TargetType container_type = mono.GetClass 
(memory, container_addr);
 
                                MonoGenericInst class_inst = null;
@@ -140,10 +143,16 @@
                                if (!method_inst_addr.IsNull)
                                        method_inst = new MonoGenericInst 
(mono, memory, method_inst_addr);
 
-                               Console.WriteLine ("GENERIC CLASS: {0} {1} {2} 
{3}",
+                               Console.WriteLine ("GENERIC CLASS: {0} {1} {2} 
{3} - {4}",
                                                   container_addr, 
container_type,
-                                                  class_inst, method_inst);
+                                                  class_inst, method_inst, 
cached);
 
+                               if (!cached.IsNull) {
+                                       TargetType klass = mono.GetClass 
(memory, cached);
+                                       Console.WriteLine ("GENERIC CLASS #1: 
{0}", klass);
+                                       return klass;
+                               }
+
                                return null;
                        }
 

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

Reply via email to