From 1327ae235aef648adc554fe29bc5acdd23ff7241 Mon Sep 17 00:00:00 2001 From: Pavel Afremov Date: Thu, 6 Sep 2007 20:02:30 +0400 Subject: [PATCH] Fix JVMTI ExceptionCatch event support in DRLVM. During switch to store registers in thread local storage, JVMTI ExceptionCatch was broken for 1 of 2 possible way of execution. Fix consist in copping registers from stack iterator (si) to registers in thread local storage. --- vm/vmcore/src/exception/exceptions_jit.cpp | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/vm/vmcore/src/exception/exceptions_jit.cpp b/vm/vmcore/src/exception/exceptions_jit.cpp index c21fb8f..552fb37 100644 --- a/vm/vmcore/src/exception/exceptions_jit.cpp +++ b/vm/vmcore/src/exception/exceptions_jit.cpp @@ -487,8 +487,13 @@ void exn_throw_for_JIT(ManagedObject* exn_obj, Class_Handle exn_class, } if (ti->get_global_capability(DebugUtilsTI::TI_GC_ENABLE_EXCEPTION_EVENT)) { + Registers regs = {0}; + VM_thread *thread = p_TLS_vmthread; NativeCodePtr callback = (NativeCodePtr) asm_jvmti_exception_catch_callback; + + si_copy_to_registers(si, ®s); + vm_set_exception_registers(thread, regs); si_set_callback(si, &callback); } else if (p_TLS_vmthread->restore_guard_page) { NativeCodePtr callback = (NativeCodePtr) -- 1.5.0.3