< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t002/hs201t002.cpp

Print this page
rev 52050 : [mq]: refactor

*** 62,103 **** void setCurrentStep(JNIEnv* jni_env, int value) { jfieldID fld; if (!NSK_JNI_VERIFY(jni_env, (fld = ! NSK_CPP_STUB4(GetStaticFieldID, jni_env, testClass, "currentStep", "I")) != NULL)) { ! NSK_CPP_STUB2(FatalError, jni_env, ! "TEST FAILED: while getting currentStep fieldID\n"); } ! if (!NSK_JNI_VERIFY_VOID(jni_env, ! NSK_CPP_STUB4(SetStaticIntField, jni_env, testClass, fld, value))) { ! NSK_CPP_STUB2(FatalError, jni_env, ! "TEST FAILED: while setting value of currentStep fieldID\n"); } } /* ============================================================================= */ void enableEvent(jvmtiEnv *jvmti_env, jvmtiEvent event, jthread thread) { ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB4(SetEventNotificationMode, jvmti_env, JVMTI_ENABLE, ! event, thread))) { NSK_COMPLAIN1("TEST FAILED: enabling %s\n", TranslateEvent(event)); nsk_jvmti_setFailStatus(); } } /* ============================================================================= */ void disableEvent(jvmtiEnv *jvmti_env, jvmtiEvent event, jthread thread) { ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB4(SetEventNotificationMode, jvmti_env, JVMTI_DISABLE, ! event, thread))) { NSK_COMPLAIN1("TEST FAILED: disabling %s\n", TranslateEvent(event)); nsk_jvmti_setFailStatus(); } } --- 62,96 ---- void setCurrentStep(JNIEnv* jni_env, int value) { jfieldID fld; if (!NSK_JNI_VERIFY(jni_env, (fld = ! jni_env->GetStaticFieldID(testClass, "currentStep", "I")) != NULL)) { ! jni_env->FatalError("TEST FAILED: while getting currentStep fieldID\n"); } ! if (!NSK_JNI_VERIFY_VOID(jni_env, jni_env->SetStaticIntField(testClass, fld, value))) { ! jni_env->FatalError("TEST FAILED: while setting value of currentStep fieldID\n"); } } /* ============================================================================= */ void enableEvent(jvmtiEnv *jvmti_env, jvmtiEvent event, jthread thread) { ! if (!NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_ENABLE, event, thread))) { NSK_COMPLAIN1("TEST FAILED: enabling %s\n", TranslateEvent(event)); nsk_jvmti_setFailStatus(); } } /* ============================================================================= */ void disableEvent(jvmtiEnv *jvmti_env, jvmtiEvent event, jthread thread) { ! if (!NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_DISABLE, event, thread))) { NSK_COMPLAIN1("TEST FAILED: disabling %s\n", TranslateEvent(event)); nsk_jvmti_setFailStatus(); } }
*** 107,119 **** jvmtiClassDefinition classDef; char *className; ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB4(GetClassSignature, jvmti_env, klass, ! &className, NULL))) { nsk_jvmti_setFailStatus(); return; } if (!NSK_VERIFY(readNewBytecode(jvmti_env))) { --- 100,110 ---- jvmtiClassDefinition classDef; char *className; ! if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &className, NULL))) { nsk_jvmti_setFailStatus(); return; } if (!NSK_VERIFY(readNewBytecode(jvmti_env))) {
*** 125,143 **** classDef.klass = klass; classDef.class_byte_count = newClassSize; classDef.class_bytes = newClassBytes; NSK_DISPLAY1("\tredefining class %s\n", className); ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(RedefineClasses, jvmti_env, 1, &classDef))) { NSK_COMPLAIN1("TEST FAILED: while redefining class %s\n", className); nsk_jvmti_setFailStatus(); return; } ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, ! jvmti_env, (unsigned char*)className))) { nsk_jvmti_setFailStatus(); } } --- 116,132 ---- classDef.klass = klass; classDef.class_byte_count = newClassSize; classDef.class_bytes = newClassBytes; NSK_DISPLAY1("\tredefining class %s\n", className); ! if (!NSK_JVMTI_VERIFY(jvmti_env->RedefineClasses(1, &classDef))) { NSK_COMPLAIN1("TEST FAILED: while redefining class %s\n", className); nsk_jvmti_setFailStatus(); return; } ! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)className))) { nsk_jvmti_setFailStatus(); } }
*** 161,172 **** NSK_DISPLAY0("Waiting for debuggee's threads to finish\n"); if (!nsk_jvmti_waitForSync(timeout)) return; ! NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, testClass)); ! NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, testedThread)); NSK_DISPLAY0("Let debuggee to finish\n"); if (!nsk_jvmti_resumeSync()) return; } --- 150,161 ---- NSK_DISPLAY0("Waiting for debuggee's threads to finish\n"); if (!nsk_jvmti_waitForSync(timeout)) return; ! NSK_TRACE(jni->DeleteGlobalRef(testClass)); ! NSK_TRACE(jni->DeleteGlobalRef(testedThread)); NSK_DISPLAY0("Let debuggee to finish\n"); if (!nsk_jvmti_resumeSync()) return; }
*** 174,192 **** /* ============================================================================= */ void setBreakPoint(jvmtiEnv *jvmti_env, JNIEnv *jni_env, jclass klass) { jmethodID mid; ! if (!NSK_JNI_VERIFY(jni_env, (mid = NSK_CPP_STUB4(GetMethodID, ! jni_env, klass, METHOD_NAME, METHOD_SIG)) != NULL)) ! NSK_CPP_STUB2(FatalError, jni_env, ! "[agent] failed to get ID for the java method\n"); ! ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetBreakpoint, ! jvmti_env, mid, 1))) ! NSK_CPP_STUB2(FatalError, jni_env, ! "[agent] failed to set breakpoint\n"); } /* ============================================================================= */ /** --- 163,177 ---- /* ============================================================================= */ void setBreakPoint(jvmtiEnv *jvmti_env, JNIEnv *jni_env, jclass klass) { jmethodID mid; ! if (!NSK_JNI_VERIFY(jni_env, (mid = jni_env->GetMethodID(klass, METHOD_NAME, METHOD_SIG)) != NULL)) ! jni_env->FatalError("[agent] failed to get ID for the java method\n"); ! ! if (!NSK_JVMTI_VERIFY(jvmti_env->SetBreakpoint(mid, 1))) ! jni_env->FatalError("[agent] failed to set breakpoint\n"); } /* ============================================================================= */ /**
*** 198,210 **** jclass klass) { char *className; char *generic; ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB4(GetClassSignature, jvmti_env, klass, ! &className, &generic))) { nsk_jvmti_setFailStatus(); return; } if (strcmp(className, EXPECTED_CLASS_SIGN) --- 183,193 ---- jclass klass) { char *className; char *generic; ! if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &className, &generic))) { nsk_jvmti_setFailStatus(); return; } if (strcmp(className, EXPECTED_CLASS_SIGN)
*** 213,230 **** NSK_DISPLAY1("\n\n>>>> Class loaded: %s", className); NSK_DISPLAY0(", activating breakpoint\n"); setBreakPoint(jvmti_env, jni_env, klass); } ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, ! jvmti_env, (unsigned char*)className))) { nsk_jvmti_setFailStatus(); } if (generic != NULL) ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, ! jvmti_env, (unsigned char*)generic))) { nsk_jvmti_setFailStatus(); } } /* ============================================================================= */ --- 196,211 ---- NSK_DISPLAY1("\n\n>>>> Class loaded: %s", className); NSK_DISPLAY0(", activating breakpoint\n"); setBreakPoint(jvmti_env, jni_env, klass); } ! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)className))) { nsk_jvmti_setFailStatus(); } if (generic != NULL) ! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)generic))) { nsk_jvmti_setFailStatus(); } } /* ============================================================================= */
*** 251,276 **** callbackSingleStep(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread, jmethodID method, jlocation location) { char *methodName; ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName, ! jvmti_env, method, &methodName, NULL, NULL))) { NSK_COMPLAIN0("TEST FAILED: unable to get method name during Breakpoint callback\n\n"); } if (strcmp(methodName, METHOD_NAME) == 0) { char *declaringClassName; jclass declaringClass; ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(GetMethodDeclaringClass, ! jvmti_env, method, &declaringClass))) { NSK_COMPLAIN0("TEST FAILED: unable to get method name during Breakpoint callback\n\n"); } ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, ! jvmti_env, declaringClass, &declaringClassName, NULL))) { NSK_COMPLAIN0("TEST FAILED: unable to get method name during Breakpoint callback\n\n"); } if (strcmp(declaringClassName, EXPECTED_CLASS_SIGN) == 0) { int value; --- 232,254 ---- callbackSingleStep(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread, jmethodID method, jlocation location) { char *methodName; ! if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &methodName, NULL, NULL))) { NSK_COMPLAIN0("TEST FAILED: unable to get method name during Breakpoint callback\n\n"); } if (strcmp(methodName, METHOD_NAME) == 0) { char *declaringClassName; jclass declaringClass; ! if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodDeclaringClass(method, &declaringClass))) { NSK_COMPLAIN0("TEST FAILED: unable to get method name during Breakpoint callback\n\n"); } ! if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(declaringClass, &declaringClassName, NULL))) { NSK_COMPLAIN0("TEST FAILED: unable to get method name during Breakpoint callback\n\n"); } if (strcmp(declaringClassName, EXPECTED_CLASS_SIGN) == 0) { int value;
*** 290,301 **** case 2: NSK_DISPLAY1("\n\n>>>> Checking if redefined method is not obsolete\n", testStep); ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(IsMethodObsolete, jvmti, method, &is_obsolete))) { NSK_COMPLAIN0("TEST FAILED: unable to check method to be obsolete\n"); nsk_jvmti_setFailStatus(); return; } --- 268,278 ---- case 2: NSK_DISPLAY1("\n\n>>>> Checking if redefined method is not obsolete\n", testStep); ! if (!NSK_JVMTI_VERIFY(jvmti->IsMethodObsolete(method, &is_obsolete))) { NSK_COMPLAIN0("TEST FAILED: unable to check method to be obsolete\n"); nsk_jvmti_setFailStatus(); return; }
*** 324,342 **** } /* case */ } ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, ! jvmti_env, (unsigned char*) declaringClassName))) { NSK_COMPLAIN0("TEST FAILED: unable to deallocate memory pointed to method name\n\n"); } } ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, ! jvmti_env, (unsigned char*) methodName))) { NSK_COMPLAIN0("TEST FAILED: unable to deallocate memory pointed to method name\n\n"); } } --- 301,317 ---- } /* case */ } ! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*) declaringClassName))) { NSK_COMPLAIN0("TEST FAILED: unable to deallocate memory pointed to method name\n\n"); } } ! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*) methodName))) { NSK_COMPLAIN0("TEST FAILED: unable to deallocate memory pointed to method name\n\n"); } }
*** 360,371 **** NSK_DISPLAY2("\n\n>>>> Exception %s in thread - %s\n", className, getThreadName(jni_env, thread)); testStep++; ! if (!NSK_JNI_VERIFY(jni_env, (klass = ! NSK_CPP_STUB2(GetObjectClass, jni_env, exception)) != NULL)) { nsk_jvmti_setFailStatus(); return; } redefineClass(jvmti_env, klass); --- 335,345 ---- NSK_DISPLAY2("\n\n>>>> Exception %s in thread - %s\n", className, getThreadName(jni_env, thread)); testStep++; ! if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(exception)) != NULL)) { nsk_jvmti_setFailStatus(); return; } redefineClass(jvmti_env, klass);
*** 392,403 **** NSK_DISPLAY2("\n\n>>>> Caught exception %s in thread - %s\n", className, getThreadName(jni_env, thread)); testStep++; ! if (!NSK_JNI_VERIFY(jni_env, (klass = ! NSK_CPP_STUB2(GetObjectClass, jni_env, exception)) != NULL)) { nsk_jvmti_setFailStatus(); return; } redefineClass(jvmti_env, klass); --- 366,376 ---- NSK_DISPLAY2("\n\n>>>> Caught exception %s in thread - %s\n", className, getThreadName(jni_env, thread)); testStep++; ! if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(exception)) != NULL)) { nsk_jvmti_setFailStatus(); return; } redefineClass(jvmti_env, klass);
*** 433,444 **** fseek(bytecode, 0, SEEK_END); newClassSize = ftell(bytecode); rewind(bytecode); ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(Allocate, jvmti, ! newClassSize, &newClassBytes))) { NSK_COMPLAIN0("buffer couldn't be allocated\n"); return NSK_FALSE; } read_bytes = (jint) fread(newClassBytes, 1, newClassSize, bytecode); fclose(bytecode); --- 406,416 ---- fseek(bytecode, 0, SEEK_END); newClassSize = ftell(bytecode); rewind(bytecode); ! if (!NSK_JVMTI_VERIFY(jvmti->Allocate(newClassSize, &newClassBytes))) { NSK_COMPLAIN0("buffer couldn't be allocated\n"); return NSK_FALSE; } read_bytes = (jint) fread(newClassBytes, 1, newClassSize, bytecode); fclose(bytecode);
*** 458,488 **** jstring jthreadName; const char *threadName; strcpy(chbuffer, ""); ! if (!NSK_JNI_VERIFY(jni_env, (klass = ! NSK_CPP_STUB2(GetObjectClass, jni_env, thread)) != NULL)) { nsk_jvmti_setFailStatus(); return chbuffer; } if (!NSK_JNI_VERIFY(jni_env, (methodID = ! NSK_CPP_STUB4(GetMethodID, jni_env, klass, ! "getName", "()Ljava/lang/String;")) != NULL)) { nsk_jvmti_setFailStatus(); return chbuffer; } ! jthreadName = (jstring) NSK_CPP_STUB3(CallObjectMethod, jni_env, thread, ! methodID); ! threadName = NSK_CPP_STUB3(GetStringUTFChars, jni_env, jthreadName, 0); strcpy(chbuffer, threadName); ! NSK_CPP_STUB3(ReleaseStringUTFChars, jni_env, jthreadName, threadName); return chbuffer; } /* ============================================================================= */ --- 430,457 ---- jstring jthreadName; const char *threadName; strcpy(chbuffer, ""); ! if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(thread)) != NULL)) { nsk_jvmti_setFailStatus(); return chbuffer; } if (!NSK_JNI_VERIFY(jni_env, (methodID = ! jni_env->GetMethodID(klass, "getName", "()Ljava/lang/String;")) != NULL)) { nsk_jvmti_setFailStatus(); return chbuffer; } ! jthreadName = (jstring) jni_env->CallObjectMethod(thread, methodID); ! threadName = jni_env->GetStringUTFChars(jthreadName, 0); strcpy(chbuffer, threadName); ! jni_env->ReleaseStringUTFChars(jthreadName, threadName); return chbuffer; } /* ============================================================================= */
*** 493,525 **** char *generic; jclass klass; strcpy(chbuffer, ""); ! if (!NSK_JNI_VERIFY(jni_env, (klass = ! NSK_CPP_STUB2(GetObjectClass, jni_env, object)) != NULL)) { nsk_jvmti_setFailStatus(); return chbuffer; } ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB4(GetClassSignature, jvmti_env, klass, ! &className, &generic))) { nsk_jvmti_setFailStatus(); return chbuffer; } strcpy(chbuffer, className); ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, ! jvmti_env, (unsigned char*)className))) { nsk_jvmti_setFailStatus(); } if (generic != NULL) ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, ! jvmti_env, (unsigned char*)generic))) { nsk_jvmti_setFailStatus(); } return chbuffer; } --- 462,489 ---- char *generic; jclass klass; strcpy(chbuffer, ""); ! if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(object)) != NULL)) { nsk_jvmti_setFailStatus(); return chbuffer; } ! if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &className, &generic))) { nsk_jvmti_setFailStatus(); return chbuffer; } strcpy(chbuffer, className); ! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)className))) { nsk_jvmti_setFailStatus(); } if (generic != NULL) ! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)generic))) { nsk_jvmti_setFailStatus(); } return chbuffer; }
*** 533,576 **** jint entryCount = 0; int i; jint value = -1; /* getting local variable table*/ ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetLocalVariableTable, ! jvmti_env, method, &entryCount, &table))) { NSK_COMPLAIN0("TEST FAILED: unable to get local variable table\n\n"); } if (table != NULL) { jvmtiError error; for (i = 0; i < entryCount; i++) { if (strcmp(table[i].name, LOCAL_VARIABLE_NAME) == 0) { ! error = NSK_CPP_STUB5(GetLocalInt, jvmti_env, thread, 0, ! table[i].slot, &value); if (!NSK_VERIFY(error == JVMTI_ERROR_NONE || error == JVMTI_ERROR_INVALID_SLOT)) NSK_COMPLAIN0("TEST FAILED: unable to get local variable table\n\n"); } } for (i = 0; i < entryCount; i++) { ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, ! jvmti_env, (unsigned char*)table[i].name))) { NSK_COMPLAIN0("TEST FAILED: unable to deallocate memory pointed to method name\n\n"); } ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, ! jvmti_env, (unsigned char*)table[i].signature))) { NSK_COMPLAIN0("TEST FAILED: unable to deallocate memory pointed to method signature\n\n"); } } ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(Deallocate, ! jvmti_env, (unsigned char*)table))) { NSK_COMPLAIN0("TEST FAILED: unable to deallocate memory pointed to local variable table\n\n"); } } --- 497,535 ---- jint entryCount = 0; int i; jint value = -1; /* getting local variable table*/ ! if (!NSK_JVMTI_VERIFY(jvmti_env->GetLocalVariableTable(method, &entryCount, &table))) { NSK_COMPLAIN0("TEST FAILED: unable to get local variable table\n\n"); } if (table != NULL) { jvmtiError error; for (i = 0; i < entryCount; i++) { if (strcmp(table[i].name, LOCAL_VARIABLE_NAME) == 0) { ! error = jvmti_env->GetLocalInt(thread, 0, table[i].slot, &value); if (!NSK_VERIFY(error == JVMTI_ERROR_NONE || error == JVMTI_ERROR_INVALID_SLOT)) NSK_COMPLAIN0("TEST FAILED: unable to get local variable table\n\n"); } } for (i = 0; i < entryCount; i++) { ! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)table[i].name))) { NSK_COMPLAIN0("TEST FAILED: unable to deallocate memory pointed to method name\n\n"); } ! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)table[i].signature))) { NSK_COMPLAIN0("TEST FAILED: unable to deallocate memory pointed to method signature\n\n"); } } ! if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char*)table))) { NSK_COMPLAIN0("TEST FAILED: unable to deallocate memory pointed to local variable table\n\n"); } }
*** 581,596 **** JNIEXPORT void JNICALL Java_nsk_jvmti_scenarios_hotswap_HS201_hs201t002_setThread(JNIEnv *env, jclass cls, jthread thread) { ! if (!NSK_JNI_VERIFY(env, (testClass = (jclass) ! NSK_CPP_STUB2(NewGlobalRef, env, cls)) != NULL)) nsk_jvmti_setFailStatus(); ! if (!NSK_JNI_VERIFY(env, (testedThread = ! NSK_CPP_STUB2(NewGlobalRef, env, thread)) != NULL)) nsk_jvmti_setFailStatus(); } /* ============================================================================= */ --- 540,553 ---- JNIEXPORT void JNICALL Java_nsk_jvmti_scenarios_hotswap_HS201_hs201t002_setThread(JNIEnv *env, jclass cls, jthread thread) { ! if (!NSK_JNI_VERIFY(env, (testClass = (jclass) env->NewGlobalRef(cls)) != NULL)) nsk_jvmti_setFailStatus(); ! if (!NSK_JNI_VERIFY(env, (testedThread = env->NewGlobalRef(thread)) != NULL)) nsk_jvmti_setFailStatus(); } /* ============================================================================= */
*** 600,611 **** jclass cls, jthread thread) { NSK_DISPLAY0("\tresuming thread...\n"); disableEvent(jvmti, JVMTI_EVENT_SINGLE_STEP, thread); ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(ResumeThread, jvmti, thread))) { NSK_COMPLAIN0("TEST FAILED: unable to resume the thread\n"); nsk_jvmti_setFailStatus(); return NSK_FALSE; } --- 557,567 ---- jclass cls, jthread thread) { NSK_DISPLAY0("\tresuming thread...\n"); disableEvent(jvmti, JVMTI_EVENT_SINGLE_STEP, thread); ! if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread))) { NSK_COMPLAIN0("TEST FAILED: unable to resume the thread\n"); nsk_jvmti_setFailStatus(); return NSK_FALSE; }
*** 619,630 **** jclass cls, jthread thread) { NSK_DISPLAY0("\tsuspending thread...\n"); disableEvent(jvmti, JVMTI_EVENT_SINGLE_STEP, thread); ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(SuspendThread, jvmti, thread))) { NSK_COMPLAIN0("TEST FAILED: unable to suspend the thread\n"); nsk_jvmti_setFailStatus(); return NSK_FALSE; } --- 575,585 ---- jclass cls, jthread thread) { NSK_DISPLAY0("\tsuspending thread...\n"); disableEvent(jvmti, JVMTI_EVENT_SINGLE_STEP, thread); ! if (!NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread))) { NSK_COMPLAIN0("TEST FAILED: unable to suspend the thread\n"); nsk_jvmti_setFailStatus(); return NSK_FALSE; }
*** 636,655 **** JNIEXPORT jboolean JNICALL Java_nsk_jvmti_scenarios_hotswap_HS201_hs201t002_popFrame(JNIEnv *env, jclass cls, jthread thread) { NSK_DISPLAY0("\tpopping frame...\n"); ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(PopFrame, jvmti, thread))) { NSK_COMPLAIN0("TEST FAILED: unable to pop the currently executed frame\n"); nsk_jvmti_setFailStatus(); return NSK_FALSE; } NSK_DISPLAY0("\tresuming thread...\n"); ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(ResumeThread, jvmti, thread))) { NSK_COMPLAIN0("TEST FAILED: unable to resume the thread\n"); nsk_jvmti_setFailStatus(); return NSK_FALSE; } --- 591,608 ---- JNIEXPORT jboolean JNICALL Java_nsk_jvmti_scenarios_hotswap_HS201_hs201t002_popFrame(JNIEnv *env, jclass cls, jthread thread) { NSK_DISPLAY0("\tpopping frame...\n"); ! if (!NSK_JVMTI_VERIFY(jvmti->PopFrame(thread))) { NSK_COMPLAIN0("TEST FAILED: unable to pop the currently executed frame\n"); nsk_jvmti_setFailStatus(); return NSK_FALSE; } NSK_DISPLAY0("\tresuming thread...\n"); ! if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread))) { NSK_COMPLAIN0("TEST FAILED: unable to resume the thread\n"); nsk_jvmti_setFailStatus(); return NSK_FALSE; }
*** 694,705 **** caps.can_access_local_variables = 1; caps.can_redefine_classes = 1; caps.can_pop_frame = 1; caps.can_suspend = 1; ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) return JNI_ERR; } { jvmtiEventCallbacks eventCallbacks; --- 647,657 ---- caps.can_access_local_variables = 1; caps.can_redefine_classes = 1; caps.can_pop_frame = 1; caps.can_suspend = 1; ! if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) return JNI_ERR; } { jvmtiEventCallbacks eventCallbacks;
*** 707,719 **** eventCallbacks.ClassLoad = callbackClassLoad; eventCallbacks.Exception = callbackException; eventCallbacks.ExceptionCatch = callbackExceptionCatch; eventCallbacks.Breakpoint = callbackBreakpoint; eventCallbacks.SingleStep = callbackSingleStep; ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(SetEventCallbacks, jvmti, ! &eventCallbacks, sizeof(eventCallbacks)))) return JNI_ERR; } NSK_DISPLAY0("Enable events\n"); --- 659,669 ---- eventCallbacks.ClassLoad = callbackClassLoad; eventCallbacks.Exception = callbackException; eventCallbacks.ExceptionCatch = callbackExceptionCatch; eventCallbacks.Breakpoint = callbackBreakpoint; eventCallbacks.SingleStep = callbackSingleStep; ! if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) return JNI_ERR; } NSK_DISPLAY0("Enable events\n");
< prev index next >