< prev index next >

test/hotspot/jtreg/vmTestbase/vm/mlvm/indy/func/jvmti/stepBreakPopReturn/stepBreakPopReturn.cpp

Print this page
rev 52185 : [mq]: refactor

*** 87,97 **** if ( strcmp(mn->methodName, gszDebuggeeMethodName) == 0 ) { gIsMethodEntryWorking = JNI_TRUE; if ( ! gIsBreakpointSet ) ! NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode, jvmti_env, JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, NULL)); } } free(mn); } --- 87,97 ---- if ( strcmp(mn->methodName, gszDebuggeeMethodName) == 0 ) { gIsMethodEntryWorking = JNI_TRUE; if ( ! gIsBreakpointSet ) ! NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, NULL)); } } free(mn); }
*** 114,138 **** } else { NSK_DISPLAY1("Single step event: %s\n", locStr); free(locStr); } ! NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode, gJvmtiEnv, JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, NULL)); if ( ! gIsDebuggerCompatible ) { ! if ( ! NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetBreakpoint, jvmti_env, method, location)) ) return; ! NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode, gJvmtiEnv, JVMTI_ENABLE, JVMTI_EVENT_BREAKPOINT, NULL)); gIsBreakpointSet = JNI_TRUE; NSK_DISPLAY0("Pop a frame\n"); ! NSK_JVMTI_VERIFY(NSK_CPP_STUB2(PopFrame, gJvmtiEnv, thread)); } else { if ( gIsFirstCall ) { NSK_DISPLAY0("Pop a frame\n"); ! NSK_JVMTI_VERIFY(NSK_CPP_STUB2(PopFrame, gJvmtiEnv, thread)); gIsFirstCall = JNI_FALSE; } else { gIsFirstCall = JNI_TRUE; } } --- 114,138 ---- } else { NSK_DISPLAY1("Single step event: %s\n", locStr); free(locStr); } ! NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, NULL)); if ( ! gIsDebuggerCompatible ) { ! if ( ! NSK_JVMTI_VERIFY(jvmti_env->SetBreakpoint(method, location)) ) return; ! NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_BREAKPOINT, NULL)); gIsBreakpointSet = JNI_TRUE; NSK_DISPLAY0("Pop a frame\n"); ! NSK_JVMTI_VERIFY(gJvmtiEnv->PopFrame(thread)); } else { if ( gIsFirstCall ) { NSK_DISPLAY0("Pop a frame\n"); ! NSK_JVMTI_VERIFY(gJvmtiEnv->PopFrame(thread)); gIsFirstCall = JNI_FALSE; } else { gIsFirstCall = JNI_TRUE; } }
*** 156,171 **** } else { NSK_DISPLAY1("Breakpoint event at: %s\n", locStr); free(locStr); } ! NSK_JVMTI_VERIFY(NSK_CPP_STUB3(ClearBreakpoint, jvmti_env, method, location)); ! NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode, gJvmtiEnv, JVMTI_DISABLE, JVMTI_EVENT_BREAKPOINT, NULL)); gIsBreakpointSet = JNI_FALSE; NSK_DISPLAY0("Forcing early return.\n"); ! NSK_JVMTI_VERIFY(NSK_CPP_STUB3(ForceEarlyReturnInt, jvmti_env, thread, 0)); } jint Agent_Initialize(JavaVM * vm, char * options, void * reserved) { jvmtiEventCallbacks callbacks; jvmtiCapabilities caps; --- 156,171 ---- } else { NSK_DISPLAY1("Breakpoint event at: %s\n", locStr); free(locStr); } ! NSK_JVMTI_VERIFY(jvmti_env->ClearBreakpoint(method, location)); ! NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_BREAKPOINT, NULL)); gIsBreakpointSet = JNI_FALSE; NSK_DISPLAY0("Forcing early return.\n"); ! NSK_JVMTI_VERIFY(jvmti_env->ForceEarlyReturnInt(thread, 0)); } jint Agent_Initialize(JavaVM * vm, char * options, void * reserved) { jvmtiEventCallbacks callbacks; jvmtiCapabilities caps;
*** 185,206 **** caps.can_generate_single_step_events = 1; caps.can_generate_breakpoint_events = ! gIsDebuggerCompatible; caps.can_pop_frame = 1; caps.can_force_early_return = 1; ! if ( ! NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, gJvmtiEnv, &caps)) ) return JNI_ERR; memset(&callbacks, 0, sizeof(callbacks)); callbacks.MethodEntry = &MethodEntry; callbacks.SingleStep = &SingleStep; callbacks.Breakpoint = &Breakpoint; ! if ( ! NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetEventCallbacks, gJvmtiEnv, &callbacks, sizeof(callbacks))) ) return JNI_ERR; ! if ( ! NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode, gJvmtiEnv, JVMTI_ENABLE, JVMTI_EVENT_METHOD_ENTRY, NULL) ) ) return JNI_ERR; return JNI_OK; } } --- 185,206 ---- caps.can_generate_single_step_events = 1; caps.can_generate_breakpoint_events = ! gIsDebuggerCompatible; caps.can_pop_frame = 1; caps.can_force_early_return = 1; ! if ( ! NSK_JVMTI_VERIFY(gJvmtiEnv->AddCapabilities(&caps)) ) return JNI_ERR; memset(&callbacks, 0, sizeof(callbacks)); callbacks.MethodEntry = &MethodEntry; callbacks.SingleStep = &SingleStep; callbacks.Breakpoint = &Breakpoint; ! if ( ! NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventCallbacks(&callbacks, sizeof(callbacks))) ) return JNI_ERR; ! if ( ! NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_METHOD_ENTRY, NULL) ) ) return JNI_ERR; return JNI_OK; } }
< prev index next >