Author: martin
Date: 2007-09-10 20:58:54 -0400 (Mon, 10 Sep 2007)
New Revision: 85616

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


Modified: 
branches/martin/debugger-generics/languages/mono/MonoGenericParameterType.cs
===================================================================
--- 
branches/martin/debugger-generics/languages/mono/MonoGenericParameterType.cs    
    2007-09-11 00:29:03 UTC (rev 85615)
+++ 
branches/martin/debugger-generics/languages/mono/MonoGenericParameterType.cs    
    2007-09-11 00:58:54 UTC (rev 85616)
@@ -19,10 +19,7 @@
                }
 
                public override bool IsByRef {
-                       get {
-                               Console.WriteLine ("GP ISBYREF: {0}", 
Environment.StackTrace);
-                               return false;
-                       }
+                       get { return false; }
                }
 
                public override bool HasFixedSize {
@@ -44,8 +41,6 @@
                        if (info == null)
                                return null;
 
-                       Console.WriteLine ("GET OBJECT: {0} {1}", info, 
gen_param.Owner.GetType ());
-
                        MonoGenericInst inst;
                        if (gen_param.Owner is Cecil.MethodDefinition)
                                inst = info.MethodInst;

Modified: branches/martin/debugger-generics/languages/mono/MonoType.cs
===================================================================
--- branches/martin/debugger-generics/languages/mono/MonoType.cs        
2007-09-11 00:29:03 UTC (rev 85615)
+++ branches/martin/debugger-generics/languages/mono/MonoType.cs        
2007-09-11 00:58:54 UTC (rev 85616)
@@ -92,17 +92,65 @@
                                return mono.BuiltinTypes.DoubleType;
                        case MonoTypeEnum.MONO_TYPE_STRING:
                                return mono.BuiltinTypes.StringType;
+                       case MonoTypeEnum.MONO_TYPE_OBJECT:
+                               return mono.BuiltinTypes.ObjectType;
+                       case MonoTypeEnum.MONO_TYPE_I:
+                               return mono.BuiltinTypes.IntType;
+                       case MonoTypeEnum.MONO_TYPE_U:
+                               return mono.BuiltinTypes.UIntType;
 
                        case MonoTypeEnum.MONO_TYPE_VALUETYPE:
                        case MonoTypeEnum.MONO_TYPE_CLASS:
                                return mono.GetClass (memory, data);
 
-                       default:
-                               break;
+                       case MonoTypeEnum.MONO_TYPE_SZARRAY: {
+                               TargetType element_type = mono.GetClass 
(memory, data);
+                               return new MonoArrayType (element_type, 1);
+                       }
 
+                       case MonoTypeEnum.MONO_TYPE_ARRAY: {
+                               TargetReader reader = new TargetReader 
(memory.ReadMemory (
+                                       data, 4 * 
memory.TargetInfo.TargetAddressSize));
+                               TargetType element_type = mono.GetClass 
(memory, reader.ReadAddress ());
+                               int rank = reader.ReadByte ();
+                               int numsizes = reader.ReadByte ();
+                               int numlobounds = reader.ReadByte ();
+
+                               if ((numsizes != 0) || (numlobounds != 0))
+                                       throw new InternalError ();
+
+                               return new MonoArrayType (element_type, rank);
                        }
 
-                       return null;
+                       case MonoTypeEnum.MONO_TYPE_GENERICINST: {
+                               TargetReader reader = new TargetReader 
(memory.ReadMemory (
+                                       data, 3 * 
memory.TargetInfo.TargetAddressSize));
+
+                               TargetAddress container_addr = 
reader.ReadAddress ();
+                               TargetAddress class_inst_addr = 
reader.ReadAddress ();
+                               TargetAddress method_inst_addr = 
reader.ReadAddress ();
+
+                               TargetType container_type = mono.GetClass 
(memory, container_addr);
+
+                               MonoGenericInst class_inst = null;
+                               if (!class_inst_addr.IsNull)
+                                       class_inst = new MonoGenericInst (mono, 
memory, class_inst_addr);
+
+                               MonoGenericInst method_inst = null;
+                               if (!method_inst_addr.IsNull)
+                                       method_inst = new MonoGenericInst 
(mono, memory, method_inst_addr);
+
+                               Console.WriteLine ("GENERIC CLASS: {0} {1} {2} 
{3}",
+                                                  container_addr, 
container_type,
+                                                  class_inst, method_inst);
+
+                               return null;
+                       }
+
+                       default:
+                               Report.Error ("UNKNOWN TYPE: {0}", type);
+                               return null;
+                       }
                }
        }
 }

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

Reply via email to