In .:
[mono.git] / mono / mini / tramp-ia64.c
index 1d5d455d38c5908bc48e36f0a7ba6bb2740b2352..45c7377ecd4e618df4de412da5a9d3cf9367df6d 100644 (file)
@@ -13,6 +13,7 @@
 #include <mono/metadata/appdomain.h>
 #include <mono/metadata/marshal.h>
 #include <mono/metadata/tabledefs.h>
+#include <mono/metadata/mono-debug-debugger.h>
 #include <mono/arch/ia64/ia64-codegen.h>
 
 #include "mini.h"
@@ -81,7 +82,8 @@ mono_arch_patch_callsite (guint8 *code, guint8 *addr)
 {
        guint8 *callsite_begin;
        guint64 *callsite = (guint64*)(gpointer)(code - 16);
-       guint64 instructions [3];
+       guint64 *next_bundle;
+       guint64 ins, instructions [3];
        guint64 buf [16];
        Ia64CodegenState gen;
        gpointer func = ((gpointer*)(gpointer)addr)[0];
@@ -91,6 +93,15 @@ mono_arch_patch_callsite (guint8 *code, guint8 *addr)
                callsite -= 2;
        callsite_begin = (guint8*)callsite;
 
+       next_bundle = callsite + 2;
+       ins = ia64_bundle_ins1 (next_bundle);
+       if (ia64_ins_opcode (ins) == 5) {
+               /* ld8_inc_imm -> indirect call through a function pointer */
+               g_assert (ia64_ins_r1 (ins) == GP_SCRATCH_REG2);
+               g_assert (ia64_ins_r3 (ins) == GP_SCRATCH_REG);
+               return;
+       }
+
        /* Patch the code generated by emit_call */
 
        instructions [0] = ia64_bundle_ins1 (callsite);
@@ -407,8 +418,8 @@ mono_arch_invalidate_method (MonoJitInfo *ji, void *func, gpointer func_arg)
        NOT_IMPLEMENTED;
 }
 
-gpointer
-mono_debugger_create_notification_function (gpointer *notification_address)
+guint8*
+mono_debugger_create_notification_function (void)
 {
        NOT_IMPLEMENTED;