Merge pull request #5714 from alexischr/update_bockbuild
[mono.git] / mono / metadata / debug-helpers.c
index e5c5c23fb74ea025a01d51bdc960321404cd2c07..5fe0b9a77b528c38b85da04777331fb1bd842261 100644 (file)
@@ -223,6 +223,9 @@ mono_type_get_desc (GString *res, MonoType *type, gboolean include_namespace)
                g_string_append_c (res, '&');
 }
 
+/**
+ * mono_type_full_name:
+ */
 char*
 mono_type_full_name (MonoType *type)
 {
@@ -233,6 +236,9 @@ mono_type_full_name (MonoType *type)
        return g_string_free (str, FALSE);
 }
 
+/**
+ * mono_signature_get_desc:
+ */
 char*
 mono_signature_get_desc (MonoMethodSignature *sig, gboolean include_namespace)
 {
@@ -323,11 +329,11 @@ mono_context_get_desc (MonoGenericContext *context)
  * Creates a method description for \p name, which conforms to the following
  * specification:
  *
- * [namespace.]classname:methodname[(args...)]
+ * <code>[namespace.]classname:methodname[(args...)]</code>
  *
  * in all the loaded assemblies.
  *
- * Both classname and methodname can contain '*' which matches anything.
+ * Both classname and methodname can contain <code>*</code> which matches anything.
  *
  * \returns a parsed representation of the method description.
  */
@@ -400,6 +406,9 @@ mono_method_desc_new (const char *name, gboolean include_namespace)
        return result;
 }
 
+/**
+ * mono_method_desc_from_method:
+ */
 MonoMethodDesc*
 mono_method_desc_from_method (MonoMethod *method)
 {
@@ -417,7 +426,7 @@ mono_method_desc_from_method (MonoMethod *method)
 /**
  * mono_method_desc_free:
  * \param desc method description to be released
- * Releases the MonoMethodDesc object \p desc.
+ * Releases the \c MonoMethodDesc object \p desc.
  */
 void
 mono_method_desc_free (MonoMethodDesc *desc)
@@ -430,7 +439,7 @@ mono_method_desc_free (MonoMethodDesc *desc)
 }
 
 /**
- * mono_method_descr_match:
+ * mono_method_desc_match:
  * \param desc \c MonoMethoDescription
  * \param method \c MonoMethod to test
  *
@@ -505,6 +514,9 @@ match_class (MonoMethodDesc *desc, int pos, MonoClass *klass)
        return match_class (desc, pos, klass->nested_in);
 }
 
+/**
+ * mono_method_desc_full_match:
+ */
 gboolean
 mono_method_desc_full_match (MonoMethodDesc *desc, MonoMethod *method)
 {
@@ -516,6 +528,9 @@ mono_method_desc_full_match (MonoMethodDesc *desc, MonoMethod *method)
        return mono_method_desc_match (desc, method);
 }
 
+/**
+ * mono_method_desc_search_in_class:
+ */
 MonoMethod*
 mono_method_desc_search_in_class (MonoMethodDesc *desc, MonoClass *klass)
 {
@@ -528,6 +543,9 @@ mono_method_desc_search_in_class (MonoMethodDesc *desc, MonoClass *klass)
        return NULL;
 }
 
+/**
+ * mono_method_desc_search_in_image:
+ */
 MonoMethod*
 mono_method_desc_search_in_image (MonoMethodDesc *desc, MonoImage *image)
 {
@@ -753,6 +771,9 @@ default_dh = {
        NULL  /* user data */
 };
 
+/**
+ * mono_disasm_code_one:
+ */
 char*
 mono_disasm_code_one (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, const guchar **endp)
 {
@@ -771,6 +792,9 @@ mono_disasm_code_one (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, c
        return result;
 }
 
+/**
+ * mono_disasm_code:
+ */
 char*
 mono_disasm_code (MonoDisHelper *dh, MonoMethod *method, const guchar *ip, const guchar* end)
 {
@@ -814,6 +838,13 @@ mono_method_get_name_full (MonoMethod *method, gboolean signature, gboolean ret,
        char *inst_desc = NULL;
        MonoError error;
 
+       const char *class_method_separator = ":";
+       const char *method_sig_space = " ";
+       if (format == MONO_TYPE_NAME_FORMAT_REFLECTION) {
+               class_method_separator = ".";
+               method_sig_space = "";
+       }
+
        if (format == MONO_TYPE_NAME_FORMAT_IL)
                klass_desc = mono_type_full_name (&method->klass->byval_arg);
        else
@@ -873,16 +904,19 @@ mono_method_get_name_full (MonoMethod *method, gboolean signature, gboolean ret,
                        strcpy (wrapper, "");
                if (ret && sig) {
                        char *ret_str = mono_type_full_name (sig->ret);
-                       res = g_strdup_printf ("%s%s %s:%s%s (%s)", wrapper, ret_str, klass_desc,
-                                                                  method->name, inst_desc ? inst_desc : "", tmpsig);
+                       res = g_strdup_printf ("%s%s %s%s%s%s%s(%s)", wrapper, ret_str, klass_desc,
+                                                                  class_method_separator,
+                                                                  method->name, inst_desc ? inst_desc : "", method_sig_space, tmpsig);
                        g_free (ret_str);
                } else {
-                       res = g_strdup_printf ("%s%s:%s%s (%s)", wrapper, klass_desc,
-                                                                  method->name, inst_desc ? inst_desc : "", tmpsig);
+                       res = g_strdup_printf ("%s%s%s%s%s%s(%s)", wrapper, klass_desc,
+                                                                  class_method_separator,
+                                                                  method->name, inst_desc ? inst_desc : "", method_sig_space, tmpsig);
                }
                g_free (tmpsig);
        } else {
-               res = g_strdup_printf ("%s%s:%s%s", wrapper, klass_desc,
+               res = g_strdup_printf ("%s%s%s%s%s", wrapper, klass_desc,
+                                                          class_method_separator,
                                                           method->name, inst_desc ? inst_desc : "");
        }
 
@@ -892,6 +926,9 @@ mono_method_get_name_full (MonoMethod *method, gboolean signature, gboolean ret,
        return res;
 }
 
+/**
+ * mono_method_full_name:
+ */
 char *
 mono_method_full_name (MonoMethod *method, gboolean signature)
 {
@@ -904,6 +941,17 @@ mono_method_get_full_name (MonoMethod *method)
        return mono_method_get_name_full (method, TRUE, TRUE, MONO_TYPE_NAME_FORMAT_IL);
 }
 
+/**
+ * mono_method_get_reflection_name:
+ *
+ * Returns the name of the method, including signature, using the same formating as reflection.
+ */
+char *
+mono_method_get_reflection_name (MonoMethod *method)
+{
+       return mono_method_get_name_full (method, TRUE, FALSE, MONO_TYPE_NAME_FORMAT_REFLECTION);
+}
+
 static const char*
 print_name_space (MonoClass *klass)
 {