From 895f16d703c0b684d25dbea3c7686cc09e609cfe Mon Sep 17 00:00:00 2001 From: zoltan Date: Thu, 18 Feb 2010 22:56:31 +0000 Subject: [PATCH] 2010-02-18 Zoltan Varga * exceptions-x86.c (mono_arch_get_restore_context): Changes this so it restores edx/ecx too. This is needed to support OP_SEQ_POINT. git-svn-id: svn+ssh://mono-cvs.ximian.com/source/trunk/mono@152032 e3ebcda4-bce8-0310-ba0a-eca2169e7518 --- mono/mini/ChangeLog | 5 +++++ mono/mini/exceptions-x86.c | 13 +++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mono/mini/ChangeLog b/mono/mini/ChangeLog index c26930e33..b24f8ba03 100755 --- a/mono/mini/ChangeLog +++ b/mono/mini/ChangeLog @@ -1,5 +1,10 @@ 2010-02-18 Zoltan Varga + * exceptions-x86.c (mono_arch_get_restore_context): Changes this so it restores + edx/ecx too. This is needed to support OP_SEQ_POINT. + +2010-02-18 Zoltan Varga + * exceptions-amd64.c (get_throw_trampoline): Add xdebug info. * method-to-ir.c (mono_method_to_ir): Fix SIZEOF in dynamic methods. diff --git a/mono/mini/exceptions-x86.c b/mono/mini/exceptions-x86.c index 732614236..6d1e69b51 100644 --- a/mono/mini/exceptions-x86.c +++ b/mono/mini/exceptions-x86.c @@ -270,15 +270,14 @@ mono_arch_get_restore_context (void) return start; /* restore_contect (MonoContext *ctx) */ - /* we do not restore X86_EDX */ start = code = mono_global_codeman_reserve (128); /* load ctx */ x86_mov_reg_membase (code, X86_EAX, X86_ESP, 4, 4); - /* get return address, stored in EDX */ - x86_mov_reg_membase (code, X86_EDX, X86_EAX, G_STRUCT_OFFSET (MonoContext, eip), 4); + /* get return address, stored in ECX */ + x86_mov_reg_membase (code, X86_ECX, X86_EAX, G_STRUCT_OFFSET (MonoContext, eip), 4); /* restore EBX */ x86_mov_reg_membase (code, X86_EBX, X86_EAX, G_STRUCT_OFFSET (MonoContext, ebx), 4); /* restore EDI */ @@ -287,13 +286,19 @@ mono_arch_get_restore_context (void) x86_mov_reg_membase (code, X86_ESI, X86_EAX, G_STRUCT_OFFSET (MonoContext, esi), 4); /* restore ESP */ x86_mov_reg_membase (code, X86_ESP, X86_EAX, G_STRUCT_OFFSET (MonoContext, esp), 4); + /* save the return addr to the restored stack */ + x86_push_reg (code, X86_ECX); /* restore EBP */ x86_mov_reg_membase (code, X86_EBP, X86_EAX, G_STRUCT_OFFSET (MonoContext, ebp), 4); + /* restore ECX */ + x86_mov_reg_membase (code, X86_ECX, X86_EAX, G_STRUCT_OFFSET (MonoContext, ecx), 4); + /* restore EDX */ + x86_mov_reg_membase (code, X86_EDX, X86_EAX, G_STRUCT_OFFSET (MonoContext, edx), 4); /* restore EAX */ x86_mov_reg_membase (code, X86_EAX, X86_EAX, G_STRUCT_OFFSET (MonoContext, eax), 4); /* jump to the saved IP */ - x86_jump_reg (code, X86_EDX); + x86_ret (code); return start; } -- 2.11.4.GIT