You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by gs...@apache.org on 2007/08/23 20:35:07 UTC

svn commit: r569108 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp

Author: gshimansky
Date: Thu Aug 23 11:35:06 2007
New Revision: 569108

URL: http://svn.apache.org/viewvc?rev=569108&view=rev
Log:
Committed fix for HARMONY-4533

With lazy resolution it is not necessary that an invokevirtual or invokeinterface
bytecodes are always complied to call the method. When the method is not yet resolved
it is possible that the call points to method's resolution stub. In this case
single stepping should begin when the method is ready which happens automatically
in the current design of single step. So nothing should be done except that the
assertion is no longer true.


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

Modified: harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp?rev=569108&r1=569107&r2=569108&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp Thu Aug 23 11:35:06 2007
@@ -116,15 +116,20 @@
     }
     while (ip < next_ip);
 
-    assert(call_ip);
-
-    TRACE2("jvmti.break.ss", "Predicting VIRTUAL type breakpoint on address: " << call_ip);
-
     // ip now points to the call instruction which actually invokes a
     // virtual method. We're going to set a sythetic breakpoint there
     // and allow execution up until that point to get the virtual
     // table address and offset inside of it to determine exactly
     // which method is going to invoked in runtime.
+    //
+    // In case call_ip is NULL, it means that we've already inside of
+    // the calling of the method, but the method is not yet ready to
+    // be executed, e.g. it is being resolved or compiled at the
+    // time. In this case, just setting single step state inside of
+    // the target thread will enabled stepping of this method
+    // automatically.
+    TRACE2("jvmti.break.ss", "Predicting VIRTUAL type breakpoint on address: " << call_ip);
+
     return call_ip;
 #else
     NOT_IMPLEMENTED;
@@ -292,14 +297,19 @@
             {
                 NativeCodePtr ip = get_ip_for_invoke_call_ip(thread, location,
                     location + 5);
-                error = _allocate(sizeof(jvmti_StepLocation),
-                    (unsigned char**)next_step );
-                assert(error == JVMTI_ERROR_NONE);
-                *count = 1;
-                (*next_step)->method = method;
-                (*next_step)->location = location;
-                (*next_step)->native_location = ip;
-                (*next_step)->no_event = true;
+                if (NULL != ip)
+                {
+                    error = _allocate(sizeof(jvmti_StepLocation),
+                        (unsigned char**)next_step );
+                    assert(error == JVMTI_ERROR_NONE);
+                    *count = 1;
+                    (*next_step)->method = method;
+                    (*next_step)->location = location;
+                    (*next_step)->native_location = ip;
+                    (*next_step)->no_event = true;
+                }
+                else
+                    *count = 0;
             }
             break;
 
@@ -345,14 +355,19 @@
             {
                 NativeCodePtr ip = get_ip_for_invoke_call_ip(thread, location,
                     location + 3);
-                error = _allocate(sizeof(jvmti_StepLocation),
-                    (unsigned char**)next_step );
-                assert(error == JVMTI_ERROR_NONE);
-                *count = 1;
-                (*next_step)->method = method;
-                (*next_step)->location = location;
-                (*next_step)->native_location = ip;
-                (*next_step)->no_event = true;
+                if (NULL != ip)
+                {
+                    error = _allocate(sizeof(jvmti_StepLocation),
+                        (unsigned char**)next_step );
+                    assert(error == JVMTI_ERROR_NONE);
+                    *count = 1;
+                    (*next_step)->method = method;
+                    (*next_step)->location = location;
+                    (*next_step)->native_location = ip;
+                    (*next_step)->no_event = true;
+                }
+                else
+                    *count = 0;
             }
             break;