Merge pull request #587 from madewokherd/gdipdllmap
[mono.git] / mono / mini / tramp-amd64.c
index 071175a440ec54dddc8e7637d1bd9259e25b3b40..a09d7d39be9d8c6c8d19ad27d40d3f32d6a31625 100644 (file)
@@ -29,7 +29,7 @@
 
 #if defined(__native_client_codegen__) && defined(__native_client__)
 #include <malloc.h>
-#include <sys/nacl_syscalls.h>
+#include <nacl/nacl_dyncode.h>
 #endif
 
 #define IS_REX(inst) (((inst) >= 0x40) && ((inst) <= 0x4f))
@@ -165,11 +165,11 @@ mono_arch_patch_callsite (guint8 *method_start, guint8 *orig_code, guint8 *addr)
                                /* Print some diagnostics */
                                MonoJitInfo *ji = mono_jit_info_table_find (mono_domain_get (), (char*)orig_code);
                                if (ji)
-                                       fprintf (stderr, "At %s, offset 0x%zx\n", mono_method_full_name (ji->method, TRUE), (guint8*)orig_code - (guint8*)ji->code_start);
+                                       fprintf (stderr, "At %s, offset 0x%zx\n", mono_method_full_name (jinfo_get_method (ji), TRUE), (guint8*)orig_code - (guint8*)ji->code_start);
                                fprintf (stderr, "Addr: %p\n", addr);
                                ji = mono_jit_info_table_find (mono_domain_get (), (char*)addr);
                                if (ji)
-                                       fprintf (stderr, "Callee: %s\n", mono_method_full_name (ji->method, TRUE));
+                                       fprintf (stderr, "Callee: %s\n", mono_method_full_name (jinfo_get_method (ji), TRUE));
                                g_assert_not_reached ();
 #else
                                /* 
@@ -412,6 +412,7 @@ stack_unaligned (MonoTrampolineType tramp_type)
 guchar*
 mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInfo **info, gboolean aot)
 {
+       char *tramp_name;
        guint8 *buf, *code, *tramp, *br [2], *r11_save_code, *after_r11_save_code;
        int i, lmf_offset, offset, res_offset, arg_offset, rax_offset, tramp_offset, saved_regs_offset;
        int saved_fpregs_offset, rbp_offset, framesize, orig_rsp_to_rbp_offset, cfa_offset;
@@ -724,8 +725,11 @@ mono_arch_create_generic_trampoline (MonoTrampolineType tramp_type, MonoTrampInf
                nullified_class_init_trampoline = mono_arch_get_nullified_class_init_trampoline (NULL);
        }
 
-       if (info)
-               *info = mono_tramp_info_create (mono_get_generic_trampoline_name (tramp_type), buf, code - buf, ji, unwind_ops);
+       if (info) {
+               tramp_name = mono_get_generic_trampoline_name (tramp_type);
+               *info = mono_tramp_info_create (tramp_name, buf, code - buf, ji, unwind_ops);
+               g_free (tramp_name);
+       }
 
        return buf;
 }