[arm64] Allow v8..v15 in unwind info on arm64. Fixes part of #21615.
[mono.git] / mono / profiler / mono-profiler-aot.c
index 5d6ae17ae314e74b4e3fd311d1db8a74b4c41c91..ba614b4de7e0f6c55e4cd49ce7c433522f6344c1 100644 (file)
@@ -11,6 +11,7 @@
  * allowing more efficient function ordering in the AOT files.
  */
 
+#include <config.h>
 #include <mono/metadata/profiler.h>
 #include <mono/metadata/tokentype.h>
 #include <mono/metadata/tabledefs.h>
 #include <string.h>
 #include <errno.h>
 #include <stdlib.h>
+#include <glib.h>
 #include <sys/stat.h>
 
+#ifdef HOST_WIN32
+#include <direct.h>
+#endif
+
 struct _MonoProfiler {
        GHashTable *images;
 };
@@ -41,11 +47,14 @@ foreach_method (gpointer data, gpointer user_data)
 {
        ForeachData *udata = (ForeachData*)user_data;
        MonoMethod *method = (MonoMethod*)data;
+       char *name;
 
        if (!mono_method_get_token (method) || mono_class_get_image (mono_method_get_class (method)) != udata->image)
                return;
 
-       fprintf (udata->outfile, "%d\n", mono_method_get_token (method));
+       name = mono_method_full_name (method, TRUE);
+       fprintf (udata->outfile, "%s\n", name);
+       g_free (name);
 }
 
 static void
@@ -75,7 +84,7 @@ output_image (gpointer key, gpointer value, gpointer user_data)
 
        i = 0;
        while (TRUE) {
-               outfile_name = g_strdup_printf ("%s/%s-%s-%d", tmp, mono_image_get_name (image), mono_image_get_guid (image), i);
+               outfile_name = g_strdup_printf ("%s/%s-%d", tmp, mono_image_get_name (image), i);
 
                if (!g_file_test (outfile_name, G_FILE_TEST_IS_REGULAR))
                        break;
@@ -88,7 +97,7 @@ output_image (gpointer key, gpointer value, gpointer user_data)
        outfile = fopen (outfile_name, "w+");
        g_assert (outfile);
 
-       fprintf (outfile, "#VER:%d\n", 1);
+       fprintf (outfile, "#VER:%d\n", 2);
 
        data.prof = prof;
        data.outfile = outfile;