< prev index next >

test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t002/ma10t002.cpp

Print this page
rev 52100 : 8212082: Remove the NSK_CPP_STUB macros for remaining vmTestbase/jvmti/[sS]*
Summary:
Reviewed-by:

*** 52,71 **** jthread thread, jmethodID method) { char *name = NULL; char *signature = NULL; MethodEntryEventsCount++; ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName, ! jvmti_env, method, &name, &signature, NULL))) { nsk_jvmti_setFailStatus(); return; } NSK_DISPLAY2("MethodEntry event: %s%s\n", name, signature); if (name != NULL) ! NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)name); if (signature != NULL) ! NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature); } /* ========================================================================== */ static int prepare(jvmtiEnv* jvmti, JNIEnv* jni) { --- 52,70 ---- jthread thread, jmethodID method) { char *name = NULL; char *signature = NULL; MethodEntryEventsCount++; ! if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) { nsk_jvmti_setFailStatus(); return; } NSK_DISPLAY2("MethodEntry event: %s%s\n", name, signature); if (name != NULL) ! jvmti_env->Deallocate((unsigned char*)name); if (signature != NULL) ! jvmti_env->Deallocate((unsigned char*)signature); } /* ========================================================================== */ static int prepare(jvmtiEnv* jvmti, JNIEnv* jni) {
*** 76,87 **** int i; NSK_DISPLAY0("Prepare: find tested thread\n"); /* get all live threads */ ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(GetAllThreads, jvmti, &threads_count, &threads))) return NSK_FALSE; if (!NSK_VERIFY(threads_count > 0 && threads != NULL)) return NSK_FALSE; --- 75,85 ---- int i; NSK_DISPLAY0("Prepare: find tested thread\n"); /* get all live threads */ ! if (!NSK_JVMTI_VERIFY(jvmti->GetAllThreads(&threads_count, &threads))) return NSK_FALSE; if (!NSK_VERIFY(threads_count > 0 && threads != NULL)) return NSK_FALSE;
*** 89,117 **** for (i = 0; i < threads_count; i++) { if (!NSK_VERIFY(threads[i] != NULL)) return NSK_FALSE; /* get thread information */ ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB3(GetThreadInfo, jvmti, threads[i], &info))) return NSK_FALSE; NSK_DISPLAY3(" thread #%d (%s): %p\n", i, info.name, threads[i]); /* find by name */ if (info.name != NULL && (strcmp(info.name, THREAD_NAME) == 0)) { thread = threads[i]; } } ! if (!NSK_JNI_VERIFY(jni, (thread = ! NSK_CPP_STUB2(NewGlobalRef, jni, thread)) != NULL)) return NSK_FALSE; /* deallocate threads list */ ! if (!NSK_JVMTI_VERIFY( ! NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads))) return NSK_FALSE; return NSK_TRUE; } --- 87,112 ---- for (i = 0; i < threads_count; i++) { if (!NSK_VERIFY(threads[i] != NULL)) return NSK_FALSE; /* get thread information */ ! if (!NSK_JVMTI_VERIFY(jvmti->GetThreadInfo(threads[i], &info))) return NSK_FALSE; NSK_DISPLAY3(" thread #%d (%s): %p\n", i, info.name, threads[i]); /* find by name */ if (info.name != NULL && (strcmp(info.name, THREAD_NAME) == 0)) { thread = threads[i]; } } ! if (!NSK_JNI_VERIFY(jni, (thread = jni->NewGlobalRef(thread)) != NULL)) return NSK_FALSE; /* deallocate threads list */ ! if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads))) return NSK_FALSE; return NSK_TRUE; }
*** 127,138 **** if (!prepare(jvmti, jni)) { nsk_jvmti_setFailStatus(); return; } ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode, ! jvmti, JVMTI_ENABLE, JVMTI_EVENT_METHOD_ENTRY, thread))) nsk_jvmti_setFailStatus(); /* resume debugee and wait for sync */ if (!nsk_jvmti_resumeSync()) return; --- 122,132 ---- if (!prepare(jvmti, jni)) { nsk_jvmti_setFailStatus(); return; } ! if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_METHOD_ENTRY, thread))) nsk_jvmti_setFailStatus(); /* resume debugee and wait for sync */ if (!nsk_jvmti_resumeSync()) return;
*** 142,152 **** NSK_DISPLAY1("MethodEntry events received: %d\n", MethodEntryEventsCount); if (!NSK_VERIFY(MethodEntryEventsCount != 0)) nsk_jvmti_setFailStatus(); ! NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, thread)); if (!nsk_jvmti_resumeSync()) return; } --- 136,146 ---- NSK_DISPLAY1("MethodEntry events received: %d\n", MethodEntryEventsCount); if (!NSK_VERIFY(MethodEntryEventsCount != 0)) nsk_jvmti_setFailStatus(); ! NSK_TRACE(jni->DeleteGlobalRef(thread)); if (!nsk_jvmti_resumeSync()) return; }
*** 183,193 **** if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL))) return JNI_ERR; memset(&caps, 0, sizeof(caps)); caps.can_generate_method_entry_events = 1; ! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) { return JNI_ERR; } memset(&callbacks, 0, sizeof(callbacks)); callbacks.MethodEntry = &MethodEntry; --- 177,187 ---- if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL))) return JNI_ERR; memset(&caps, 0, sizeof(caps)); caps.can_generate_method_entry_events = 1; ! if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) { return JNI_ERR; } memset(&callbacks, 0, sizeof(callbacks)); callbacks.MethodEntry = &MethodEntry;
< prev index next >