2004-08-02 Martin Baulig <martin@ximian.com>
authorMartin Baulig <martin@novell.com>
Mon, 2 Aug 2004 04:35:54 +0000 (04:35 -0000)
committerMartin Baulig <martin@novell.com>
Mon, 2 Aug 2004 04:35:54 +0000 (04:35 -0000)
* get.c (dis_stringify_object_with_class): Include our generic
arguments in the method's class name.

* main.c (dis_generic_param_and_constraints): Use the new
constraints syntax.

svn path=/trunk/mono/; revision=31728

mono/dis/ChangeLog
mono/dis/get.c
mono/dis/main.c

index e3e808cfe358cecfb8f733e0907f85fbbfc98dc0..24cad53c9d6a77a9ca0c8e2785588b5b645b26e1 100644 (file)
@@ -1,3 +1,11 @@
+2004-08-02  Martin Baulig  <martin@ximian.com>
+
+       * get.c (dis_stringify_object_with_class): Include our generic
+       arguments in the method's class name.
+
+       * main.c (dis_generic_param_and_constraints): Use the new
+       constraints syntax.
+
 2004-08-02  Martin Baulig  <martin@ximian.com>
 
        * dump.c (dump_stream_blob): Format this nicely.
index 133991bacb9c4bf6fb93f1cc96d8f98403b6840f..623237f2aad3fa36857ac0f26369c108cbca4b79 100644 (file)
@@ -698,7 +698,7 @@ dis_stringify_object_with_class (MonoImage *m, MonoClass *c)
 {
        /* FIXME: handle MONO_TYPE_OBJECT ... */
        const char *otype = c->byval_arg.type == MONO_TYPE_VALUETYPE ? "valuetype" : "class" ;
-       char *assemblyref = NULL, *result, *esname;
+       char *assemblyref = NULL, *result, *esname, *generic = NULL;
        if (m != c->image) {
                if (c->image->assembly_name) {
                        /* we cheat */
@@ -723,8 +723,28 @@ dis_stringify_object_with_class (MonoImage *m, MonoClass *c)
        esname = get_escaped_name (result);
        g_free (result);
 
-       result = g_strdup_printf ("%s %s%s", otype, assemblyref?assemblyref:"", esname);
+       if (c->generic_inst) {
+               MonoGenericInst *ginst = c->generic_inst;
+               GString *str = g_string_new ("");
+               int i;
+
+               for (i = 0; i < ginst->type_argc; i++){
+                       char *t = dis_stringify_type (m, ginst->type_argv [i]);
+
+                       g_string_append (str, t);
+                       if (i+1 != ginst->type_argc)
+                               g_string_append (str, ", ");
+                       g_free (t);
+               }
+               generic = g_strdup_printf ("<%s>", str->str);
+               g_string_free (str, TRUE);
+       }
+
+
+       result = g_strdup_printf ("%s %s%s%s", otype, assemblyref?assemblyref:"",
+                                 esname, generic?generic:"");
        
+       g_free (generic);
        g_free (assemblyref);
        g_free (esname);
        
index d56736932eb966fa3bb44f86893a0fa7dbb6b5ed..305b256fd14adf77f66196480c3d857741ac2a40 100644 (file)
@@ -915,9 +915,9 @@ dis_generic_param_and_constraints (MonoImage *m, int table_type, guint32 typedef
                         continue;
 
                 if (found_count == 0)
-                        fprintf (output, "<%s", mono_metadata_string_heap (m, cols [MONO_GENERICPARAM_NAME]));
+                        fprintf (output, "<");
                 else
-                        fprintf (output, ", %s", mono_metadata_string_heap (m, cols [MONO_GENERICPARAM_NAME]));
+                        fprintf (output, ", ");
 
                 for (cnst_ind = cnst_start; cnst_ind < ct->rows; cnst_ind++) {
                         char *sig;
@@ -927,12 +927,13 @@ dis_generic_param_and_constraints (MonoImage *m, int table_type, guint32 typedef
                         if (cnst_block == NULL)
                                 cnst_block = g_string_new ("");
                         sig = get_typedef_or_ref (m, ccols [MONO_GENPARCONSTRAINT_CONSTRAINT]);
-                        g_string_append_printf (cnst_block, "    .constraint !%d is %s\n",
-                                        cols [MONO_GENERICPARAM_NUMBER], sig);
+                       fprintf (output, "(%s) ", sig);
                         g_free (sig);
                         cnst_start = cnst_ind;
                 }
-                
+
+               fprintf (output, "%s", mono_metadata_string_heap (m, cols [MONO_GENERICPARAM_NAME]));
+               
                 found_count++;
        }