Author: raja
Date: 2006-02-18 11:35:17 -0500 (Sat, 18 Feb 2006)
New Revision: 57030

Modified:
   trunk/mono/mono/dis/ChangeLog
   trunk/mono/mono/dis/dump.c
   trunk/mono/mono/dis/get.c
   trunk/mono/mono/dis/get.h
Log:
* get.c (get_typespec): Don't use mono_type_create_from_typespec_full().
Use get_type() instead.
(get_type): Add 'is_def' parameter.
(get_field_signature, get_ret_type, get_param): Update.
* dump.c (dump_table_property): Likewise.
* get.h (get_type): Update prototype.


Modified: trunk/mono/mono/dis/ChangeLog
===================================================================
--- trunk/mono/mono/dis/ChangeLog       2006-02-18 16:24:57 UTC (rev 57029)
+++ trunk/mono/mono/dis/ChangeLog       2006-02-18 16:35:17 UTC (rev 57030)
@@ -1,3 +1,12 @@
+2006-02-18  Raja R Harinath  <[EMAIL PROTECTED]>
+
+       * get.c (get_typespec): Don't use mono_type_create_from_typespec_full().
+       Use get_type() instead.
+       (get_type): Add 'is_def' parameter.
+       (get_field_signature, get_ret_type, get_param): Update.
+       * dump.c (dump_table_property): Likewise.
+       * get.h (get_type): Update prototype.
+
 2006-02-16  Raja R Harinath  <[EMAIL PROTECTED]>
 
        * get.c (get_typespec): Pass MonoGenericContainer to

Modified: trunk/mono/mono/dis/dump.c
===================================================================
--- trunk/mono/mono/dis/dump.c  2006-02-18 16:24:57 UTC (rev 57029)
+++ trunk/mono/mono/dis/dump.c  2006-02-18 16:35:17 UTC (rev 57030)
@@ -392,7 +392,7 @@
                        g_warning("incorrect signature in propert blob: 0x%x", 
*ptr);
                ptr++;
                pcount = mono_metadata_decode_value (ptr, &ptr);
-               ptr = get_type (m, ptr, &type, NULL);
+               ptr = get_type (m, ptr, &type, FALSE, NULL);
                fprintf (output, "%d: %s %s (",
                         i + 1, type, mono_metadata_string_heap (m, cols 
[MONO_PROPERTY_NAME]));
                g_free (type);

Modified: trunk/mono/mono/dis/get.c
===================================================================
--- trunk/mono/mono/dis/get.c   2006-02-18 16:24:57 UTC (rev 57029)
+++ trunk/mono/mono/dis/get.c   2006-02-18 16:35:17 UTC (rev 57030)
@@ -180,15 +180,12 @@
        char *s, *result;
        GString *res = g_string_new ("");
        int len;
+       MonoMethodSignature *sig;
 
-       MonoType *type;
-
-       type = mono_type_create_from_typespec_full (m, context ? 
context->container : NULL, idx);
-
        mono_metadata_decode_row (&m->tables [MONO_TABLE_TYPESPEC], idx-1, 
cols, MONO_TYPESPEC_SIZE);
        ptr = mono_metadata_blob_heap (m, cols [MONO_TYPESPEC_SIGNATURE]);
        len = mono_metadata_decode_value (ptr, &ptr);
-       
+
        switch (*ptr++){
        case MONO_TYPE_PTR:
                ptr = get_custom_mod (m, ptr, &s);
@@ -197,26 +194,27 @@
                        g_string_append_c (res, ' ');
                        g_free (s);
                }
-               
+
                if (*ptr == MONO_TYPE_VOID)
                        g_string_append (res, "void");
                else {
-                       ptr = get_type (m, ptr, &s, context);
+                       ptr = get_type (m, ptr, &s, is_def, context);
                        if (s)
                                g_string_append (res, s);
                }
                g_string_append (res, "*");
                break;
-               
+
        case MONO_TYPE_FNPTR:
-               s = dis_stringify_function_ptr (m, type->data.method);
+               sig = mono_metadata_parse_method_signature_full (m, context ? 
context->container : NULL, 0, ptr, &ptr);
+               s = dis_stringify_function_ptr (m, sig);
                g_string_append (res, "method ");
                g_string_append (res, s);
                g_free (s);
                break;
-                       
+
        case MONO_TYPE_ARRAY:
-               ptr = get_type (m, ptr, &s, context);
+               ptr = get_type (m, ptr, &s, is_def, context);
                g_string_append (res, s);
                g_free (s);
                g_string_append_c (res, ' ');
@@ -224,7 +222,7 @@
                g_string_append (res, s);
                g_free (s);
                break;
-               
+
        case MONO_TYPE_SZARRAY:
                ptr = get_custom_mod (m, ptr, &s);
                if (s){
@@ -232,14 +230,14 @@
                        g_string_append_c (res, ' ');
                        g_free (s);
                }
-               ptr = get_type (m, ptr, &s, context);
+               ptr = get_type (m, ptr, &s, is_def, context);
                g_string_append (res, s);
                g_string_append (res, "[]");
                g_free (s);
                break;
 
        default:
-               s = dis_stringify_type (m, type, is_def);
+               ptr = get_type (m, ptr - 1, &s, is_def, context);
                g_string_append (res, s);
                g_free (s);
                break;
@@ -1218,7 +1216,7 @@
  * Returns: the new ptr to continue decoding
  */
 const char *
-get_type (MonoImage *m, const char *ptr, char **result, MonoGenericContext 
*context)
+get_type (MonoImage *m, const char *ptr, char **result, gboolean is_def, 
MonoGenericContext *context)
 {
        const char *start = ptr;
        guint32 type;
@@ -1249,7 +1247,7 @@
                int count, i;
                char *temp;
 
-               ptr = get_type (m, ptr, &temp, context);
+               ptr = get_type (m, ptr, &temp, is_def, context);
                g_string_append (str, temp);
                g_free (temp);
 
@@ -1259,7 +1257,7 @@
                for (i = 0; i < count; i++) {
                        if (i)
                                g_string_append (str, ",");
-                       ptr = get_type (m, ptr, &temp, context);
+                       ptr = get_type (m, ptr, &temp, is_def, context);
                        g_string_append (str, temp);
                }
 
@@ -1271,7 +1269,7 @@
 
        default:
                t = mono_metadata_parse_type_full (m, context ? 
context->container : NULL, MONO_PARSE_TYPE, 0, start, &ptr);
-               *result = dis_stringify_type (m, t, FALSE);
+               *result = dis_stringify_type (m, t, is_def);
                mono_metadata_free_type (t);
                break;
        }
@@ -1300,7 +1298,7 @@
        ptr++; len--;
        
        ptr = get_custom_mod (m, ptr, &allocated_modifier_string);
-       ptr = get_type (m, ptr, &allocated_type_string, context);
+       ptr = get_type (m, ptr, &allocated_type_string, FALSE, context);
 
        res = g_strdup_printf (
                "%s %s",
@@ -1386,7 +1384,7 @@
                        ptr++;
                }
 
-               ptr = get_type (m, ptr, &allocated_type_string, context);
+               ptr = get_type (m, ptr, &allocated_type_string, FALSE, context);
                g_string_append (str, allocated_type_string);
                if (has_byref)
                        g_string_append (str, "& ");
@@ -1432,7 +1430,7 @@
                        ptr++;
                        by_ref = 1;
                }
-               ptr = get_type (m, ptr, &allocated_type_string, context);
+               ptr = get_type (m, ptr, &allocated_type_string, FALSE, context);
                g_string_append (str, allocated_type_string);
                if (by_ref)
                        g_string_append_c (str, '&');

Modified: trunk/mono/mono/dis/get.h
===================================================================
--- trunk/mono/mono/dis/get.h   2006-02-18 16:24:57 UTC (rev 57029)
+++ trunk/mono/mono/dis/get.h   2006-02-18 16:35:17 UTC (rev 57030)
@@ -63,7 +63,7 @@
 const char *get_custom_mod             (MonoImage *m, const char *ptr,
                                        char **return_value);
 const char *get_type                   (MonoImage *m, const char *ptr,
-                                       char **result, MonoGenericContext 
*context);
+                                       char **result, gboolean is_def, 
MonoGenericContext *context);
 const char *get_ret_type               (MonoImage *m, const char *ptr,
                                        char **ret_type, MonoGenericContext 
*context);
 const char *get_param                  (MonoImage *m, const char *ptr,

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

Reply via email to