2010-06-15 Zoltan Varga <vargaz@gmail.com>
+ * tramp-x86.c (mono_arch_create_generic_trampoline): Emit unwind info for
+ these trampolines.
+
+ * mini-x86.c (mono_arch_get_cie_program): Implement this for x86.
+
* mini-llvm.c: Fix compilation with llvm 2.6.
* mini-amd64.c (CallInfo): Fix the position of the vret_arg_index field.
return (MonoVTable*) regs [MONO_ARCH_RGCTX_REG];
}
+GSList*
+mono_arch_get_cie_program (void)
+{
+ GSList *l = NULL;
+
+ mono_add_unwind_op_def_cfa (l, (guint8*)NULL, (guint8*)NULL, X86_ESP, 4);
+ mono_add_unwind_op_offset (l, (guint8*)NULL, (guint8*)NULL, X86_NREG, -4);
+
+ return l;
+}
+
MonoInst*
mono_arch_emit_inst_for_method (MonoCompile *cfg, MonoMethod *cmethod, MonoMethodSignature *fsig, MonoInst **args)
{
GSList *unwind_ops = NULL;
MonoJumpInfo *ji = NULL;
+ unwind_ops = mono_arch_get_cie_program ();
+
code = buf = mono_global_codeman_reserve (256);
/* Note that there is a single argument to the trampoline
x86_breakpoint (buf);*/
#endif
+ mono_add_unwind_op_def_cfa (unwind_ops, code, buf, X86_ESP, ((pushed_args + 2) * 4));
+
if (aot) {
char *icall_name = g_strdup_printf ("trampoline_func_%d", tramp_type);
code = mono_arch_emit_load_aotconst (buf, code, &ji, MONO_PATCH_INFO_JIT_ICALL_ADDR, icall_name);
GSList*
mono_unwind_get_cie_program (void)
{
-#ifdef TARGET_AMD64
+#if defined(TARGET_AMD64) || defined(TARGET_X86)
return mono_arch_get_cie_program ();
#elif defined(TARGET_POWERPC)
GSList *l = NULL;