harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ge...@apache.org
Subject svn commit: r470961 - /incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
Date Fri, 03 Nov 2006 19:26:04 GMT
Author: geirm
Date: Fri Nov  3 11:26:04 2006
New Revision: 470961

URL: http://svn.apache.org/viewvc?view=rev&rev=470961
Log:
HARMONY-1953

[drlvm] [jvmti] THREAD_END event is sent in PHASE_DEAD

Ubuntu 6 - smoke, c-unit, ~kernel


Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp?view=diff&rev=470961&r1=470960&r2=470961
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp Fri Nov  3
11:26:04 2006
@@ -1813,48 +1813,49 @@
     if (!ti->isEnabled())
         return;
 
-    if (is_start)
+    if (JVMTI_PHASE_LIVE == ti->getPhase() ||
+        JVMTI_PHASE_START == ti->getPhase())
     {
-        process_jvmti_event(JVMTI_EVENT_THREAD_START, 0, 0);
+        process_jvmti_event(
+            (is_start ? JVMTI_EVENT_THREAD_START : JVMTI_EVENT_THREAD_END),
+            (is_start ? 0 : 1), 0);
+    }
+
+    if (!ti->is_single_step_enabled())
+        return;
 
-        if (ti->is_single_step_enabled())
-        {
-            // Init single step state for the thread
-            VM_thread *vm_thread = p_TLS_vmthread;
-            LMAutoUnlock lock(ti->vm_brpt->get_lock());
-
-            jvmtiError UNREF errorCode = _allocate(sizeof(JVMTISingleStepState),
-                (unsigned char **)&vm_thread->ss_state);
-            assert(JVMTI_ERROR_NONE == errorCode);
-
-            vm_thread->ss_state->predicted_breakpoints = NULL;
-
-            // There is no need to set a breakpoint in a thread which
-            // is started inside of jvmti_send_thread_start_end_event() function.
-            // This function is called when no java code in the new thread is
-            // executed yet, so this function just sets single step state for this
-            // thread. When this thread will be ran, calling the first java method
-            // will set a breakpoint on the first bytecode if this mehod.
-        }
+    if (is_start)
+    {
+        // Init single step state for the thread
+        VM_thread *vm_thread = p_TLS_vmthread;
+        LMAutoUnlock lock(ti->vm_brpt->get_lock());
+
+        jvmtiError UNREF errorCode = _allocate(sizeof(JVMTISingleStepState),
+            (unsigned char **)&vm_thread->ss_state);
+        assert(JVMTI_ERROR_NONE == errorCode);
+
+        vm_thread->ss_state->predicted_breakpoints = NULL;
+
+        // There is no need to set a breakpoint in a thread which
+        // is started inside of jvmti_send_thread_start_end_event() function.
+        // This function is called when no java code in the new thread is
+        // executed yet, so this function just sets single step state for this
+        // thread. When this thread will be ran, calling the first java method
+        // will set a breakpoint on the first bytecode if this mehod.
     }
     else
     {
-        process_jvmti_event(JVMTI_EVENT_THREAD_END, 1, 0);
-
-        if (ti->is_single_step_enabled())
-        {
-            // Shut down single step state for the thread
-            VM_thread *vm_thread = p_TLS_vmthread;
-            LMAutoUnlock lock(ti->vm_brpt->get_lock());
-
-            jvmti_remove_single_step_breakpoints(ti, vm_thread);
-            if( vm_thread->ss_state ) {
-                if( vm_thread->ss_state->predicted_breakpoints ) {
-                    ti->vm_brpt->release_intf(vm_thread->ss_state->predicted_breakpoints);
-                }
-                _deallocate((unsigned char *)vm_thread->ss_state);
-                vm_thread->ss_state = NULL;
+        // Shut down single step state for the thread
+        VM_thread *vm_thread = p_TLS_vmthread;
+        LMAutoUnlock lock(ti->vm_brpt->get_lock());
+
+        jvmti_remove_single_step_breakpoints(ti, vm_thread);
+        if( vm_thread->ss_state ) {
+            if( vm_thread->ss_state->predicted_breakpoints ) {
+                ti->vm_brpt->release_intf(vm_thread->ss_state->predicted_breakpoints);
             }
+            _deallocate((unsigned char *)vm_thread->ss_state);
+            vm_thread->ss_state = NULL;
         }
     }
 }



Mime
View raw message