2009-03-12 Jb Evain <jbevain@novell.com>
[mono.git] / mono / dis / dis-cil.c
index d7bbe6bcfe93ccafc40454d121a16f71789657c9..cea4a6fbea920771aec0251893f92de5a37636af 100644 (file)
@@ -18,6 +18,7 @@
 #include "dump.h"
 #include "dis-cil.h"
 #include "mono/metadata/opcodes.h"
+#include "mono/metadata/class-internals.h"
 #include "mono/utils/mono-compiler.h"
 
 #ifndef HAVE_ISINF
@@ -55,7 +56,7 @@ isinf (double num)
        indent[indent_level*2] = 0;
 
 void
-disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context)
+disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContainer *container)
 {
        const unsigned char *start = mh->code;
        int size = mh->code_size;
@@ -110,7 +111,7 @@ disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
                                 } else {
                                         char * klass = mh->clauses[i].flags ? g_strdup ("") :
                                                dis_stringify_object_with_class (m, mh->clauses[i].data.catch_class,
-                                                                                FALSE, FALSE);
+                                                                                TRUE, FALSE);
                                         fprintf (output, "\t%s%s %s { // %d\n", indent,
                                                         clause_names [mh->clauses[i].flags], klass, i);
                                         g_free (klass);
@@ -149,7 +150,7 @@ disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
                        guint32 token = read32 (ptr);
                        char *s;
                        
-                       s = get_field (m, token, context);
+                       s = get_field (m, token, container);
                        fprintf (output, "%s", s);
                        g_free (s);
                        ptr += 4;
@@ -176,7 +177,7 @@ disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
                        guint32 token = read32 (ptr);
                        char *s;
 
-                       s = get_method (m, token, context);
+                       s = get_method (m, token, container);
                        fprintf (output, "%s", s);
                        g_free (s);
                        ptr += 4;
@@ -218,7 +219,7 @@ disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
                        const char *us_ptr = mono_metadata_user_string (m, token & 0xffffff);
                        int len = mono_metadata_decode_blob_size (us_ptr, (const char**)&us_ptr);
 
-                       char *s = get_encoded_user_string_or_bytearray (us_ptr, len);
+                       char *s = get_encoded_user_string_or_bytearray ((const guchar*)us_ptr, len);
                        
                        /*
                         * See section 23.1.4 on the encoding of the #US heap
@@ -252,7 +253,7 @@ disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
                        guint32 token = read32 (ptr);
                        char *s;
                        
-                       s = get_token (m, token, context);
+                       s = get_token (m, token, container);
                        fprintf (output, "%s", s);
                        g_free (s);
                        
@@ -262,7 +263,7 @@ disassemble_cil (MonoImage *m, MonoMethodHeader *mh, MonoGenericContext *context
                
                case MonoInlineType: {
                        guint32 token = read32 (ptr);
-                       char *s = get_token_type (m, token, context);
+                       char *s = get_token_type (m, token, container);
                        fprintf (output, "%s", s);
                        g_free (s);
                        ptr += 4;