You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ge...@apache.org on 2006/10/06 19:09:12 UTC
svn commit: r453679 - in
/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti:
jvmti_event.cpp jvmti_stack.cpp jvmti_step.cpp
Author: geirm
Date: Fri Oct 6 10:09:12 2006
New Revision: 453679
URL: http://svn.apache.org/viewvc?view=rev&rev=453679
Log:
HARMONY-1709
The issue improves tracing for SingleStep and FramePop events and helps debugging breakpoints
Ununtu 6 - smoke, c-unit, ~kernel
Modified:
incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_event.cpp
incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp
incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.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=453679&r1=453678&r2=453679
==============================================================================
--- 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 Oct 6 10:09:12 2006
@@ -330,6 +330,9 @@
// Check that no environment has SingleStep enabled
LMAutoUnlock lock(&ti->TIenvs_lock);
bool disable = true;
+ TRACE2("jvmti.break.ss",
+ "SingleStep event is disabled locally for env: "
+ << env);
for (TIEnv *ti_env = ti->getEnvironments(); ti_env;
ti_env = ti_env->next)
@@ -665,6 +668,7 @@
jboolean was_popped_by_exception,
jvalue ret_val)
{
+ // processing MethodExit event
DebugUtilsTI *ti = VM_Global_State::loader_env->TI;
tmn_suspend_enable();
jvmtiEvent event_type = JVMTI_EVENT_METHOD_EXIT;
@@ -694,8 +698,13 @@
jthread thread = getCurrentThread();
JNIEnv *jni_env = (JNIEnv *)jni_native_intf;
jvmtiEnv *jvmti_env = (jvmtiEnv*) ti_env;
- if (NULL != ti_env->event_table.MethodExit)
+ if (NULL != ti_env->event_table.MethodExit) {
+ TRACE2("jvmti.stack", "Calling MethodExit callback for method: "
+ << class_get_name(method_get_class((Method*)method))
+ << "." << method_get_name((Method*)method)
+ << method_get_descriptor((Method*)method));
ti_env->event_table.MethodExit(jvmti_env, jni_env, thread, method, was_popped_by_exception, ret_val);
+ }
ti_env = next_env;
}
@@ -712,15 +721,30 @@
return;
}
+ // processing PopFrame event
VM_thread *curr_thread = p_TLS_vmthread;
jint UNREF skip;
jint depth = get_thread_stack_depth(curr_thread, &skip);
+#ifndef NDEBUG
+ if( curr_thread->frame_pop_listener ) {
+ TRACE2("jvmti.stack", "Prepare to PopFrame callback for thread: "
+ << curr_thread << ", method: " << class_get_name(method_get_class((Method*)method))
+ << "." << method_get_name((Method*)method)
+ << method_get_descriptor((Method*)method)
+ << ", depth: " << depth
+ << (was_popped_by_exception == JNI_TRUE ? " by exception" : ""));
+ }
+#endif // NDEBUG
+
jvmti_frame_pop_listener *last = NULL;
for( jvmti_frame_pop_listener *fpl = curr_thread->frame_pop_listener;
fpl;
last = fpl, (fpl = fpl ? fpl->next : curr_thread->frame_pop_listener) )
{
+ TRACE2("jvmti.stack", "-> Look through listener: "
+ << fpl << ", env: " << fpl->env << ", depth: " << fpl->depth);
+
if (fpl->depth == depth)
{
jvmti_frame_pop_listener *report = fpl;
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp?view=diff&rev=453679&r1=453678&r2=453679
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_stack.cpp Fri Oct 6 10:09:12 2006
@@ -790,7 +790,8 @@
jthread thread,
jint depth)
{
- TRACE2("jvmti.stack", "NotifyFramePop called");
+ TRACE2("jvmti.stack", "NotifyFramePop called: thread: "
+ << thread << ", depth: " << depth);
SuspendEnabledChecker sec;
jint state;
jthread curr_thread = getCurrentThread();
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp?view=diff&rev=453679&r1=453678&r2=453679
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/vmcore/src/jvmti/jvmti_step.cpp Fri Oct 6 10:09:12 2006
@@ -706,13 +706,11 @@
// Function is always executed under global TI breakpoints lock
JVMTISingleStepState *ss_state = vm_thread->ss_state;
- TRACE2("jvmti.break.ss", "Remove single step breakpoints");
+ TRACE2("jvmti.break.ss", "Remove single step breakpoints, intf: "
+ << (ss_state ? ss_state->predicted_breakpoints : NULL) );
- if (ss_state && ss_state->predicted_breakpoints) {
- TRACE2("jvmti.break.ss", "Remove single step, intf: "
- << ss_state->predicted_breakpoints);
+ if (ss_state && ss_state->predicted_breakpoints)
ss_state->predicted_breakpoints->remove_all_reference();
- }
}
jvmtiError jvmti_get_next_bytecodes_from_native(VM_thread *thread,
@@ -838,7 +836,11 @@
// invoke. Need to shift to the next bytecode
if (NULL == call_ip)
{
- TRACE2("jvmti.break.ss", "SingleStep IP shifted in prediction to: " << call_ip);
+ TRACE2("jvmti.break.ss", "SingleStep IP shifted in prediction to: "
+ << class_get_name(method_get_class(func)) << "."
+ << method_get_name(func)
+ << method_get_descriptor(func)
+ << " :" << next_location << " :" << ip2);
bc = next_location;
ip = ip2;
}