< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA08/ma08t001/ma08t001a.cpp
Print this page
rev 52100 : 8212082: Remove the NSK_CPP_STUB macros for remaining vmTestbase/jvmti/[sS]*
Summary:
Reviewed-by:
*** 54,71 ****
jmethodID method, jlocation location, jobject exception,
jmethodID catch_method, jlocation catch_location) {
jclass klass = NULL;
char *signature = NULL;
! if (!NSK_JNI_VERIFY(jni_env, (klass =
! NSK_CPP_STUB2(GetObjectClass, jni_env, exception)) != NULL)) {
nsk_jvmti_setFailStatus();
return;
}
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(GetClassSignature, jvmti_env,
! klass, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
if (!NSK_VERIFY(signature != NULL)) {
--- 54,69 ----
jmethodID method, jlocation location, jobject exception,
jmethodID catch_method, jlocation catch_location) {
jclass klass = NULL;
char *signature = NULL;
! if (!NSK_JNI_VERIFY(jni_env, (klass = jni_env->GetObjectClass(exception)) != NULL)) {
nsk_jvmti_setFailStatus();
return;
}
! if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
if (!NSK_VERIFY(signature != NULL)) {
*** 73,101 ****
return;
}
NSK_DISPLAY1("Exception event: %s\n", signature);
! if (NSK_CPP_STUB3(IsSameObject, jni_env, threadForInterrupt, thread)) {
if (strcmp(signature, INTERRUPTED_EXCEPTION_CLASS_SIG) == 0) {
InterruptedExceptionFlag++;
} else {
NSK_COMPLAIN1("Unexpected exception in DebuggeeThreadForInterrupt: %s\n",
signature);
nsk_jvmti_setFailStatus();
}
! } else if (NSK_CPP_STUB3(IsSameObject, jni_env, threadForStop, thread)) {
if (strcmp(signature, THREAD_DEATH_CLASS_SIG) == 0) {
ThreadDeathFlag++;
} else {
NSK_COMPLAIN1("Unexpected exception in DebuggeeThreadForStop: %s\n",
signature);
nsk_jvmti_setFailStatus();
}
}
! NSK_CPP_STUB2(Deallocate, jvmti_env, (unsigned char*)signature);
}
/* ========================================================================== */
static int prepare(jvmtiEnv* jvmti, JNIEnv* jni) {
--- 71,99 ----
return;
}
NSK_DISPLAY1("Exception event: %s\n", signature);
! if (jni_env->IsSameObject(threadForInterrupt, thread)) {
if (strcmp(signature, INTERRUPTED_EXCEPTION_CLASS_SIG) == 0) {
InterruptedExceptionFlag++;
} else {
NSK_COMPLAIN1("Unexpected exception in DebuggeeThreadForInterrupt: %s\n",
signature);
nsk_jvmti_setFailStatus();
}
! } else if (jni_env->IsSameObject(threadForStop, thread)) {
if (strcmp(signature, THREAD_DEATH_CLASS_SIG) == 0) {
ThreadDeathFlag++;
} else {
NSK_COMPLAIN1("Unexpected exception in DebuggeeThreadForStop: %s\n",
signature);
nsk_jvmti_setFailStatus();
}
}
! jvmti_env->Deallocate((unsigned char*)signature);
}
/* ========================================================================== */
static int prepare(jvmtiEnv* jvmti, JNIEnv* jni) {
*** 107,118 ****
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;
--- 105,115 ----
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;
*** 120,131 ****
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 */
--- 117,127 ----
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 */
*** 137,148 ****
}
}
}
/* deallocate threads list */
! if (!NSK_JVMTI_VERIFY(
! NSK_CPP_STUB2(Deallocate, jvmti, (unsigned char*)threads)))
return NSK_FALSE;
if (threadForStop == NULL) {
NSK_COMPLAIN0("DebuggeeThreadForStop not found");
return NSK_FALSE;
--- 133,143 ----
}
}
}
/* deallocate threads list */
! if (!NSK_JVMTI_VERIFY(jvmti->Deallocate((unsigned char*)threads)))
return NSK_FALSE;
if (threadForStop == NULL) {
NSK_COMPLAIN0("DebuggeeThreadForStop not found");
return NSK_FALSE;
*** 151,171 ****
if (threadForInterrupt == NULL) {
NSK_COMPLAIN0("DebuggeeThreadForInterrupt not found");
return NSK_FALSE;
}
! if (!NSK_JNI_VERIFY(jni, (threadForStop =
! NSK_CPP_STUB2(NewGlobalRef, jni, threadForStop)) != NULL))
return NSK_FALSE;
! if (!NSK_JNI_VERIFY(jni, (threadForInterrupt =
! NSK_CPP_STUB2(NewGlobalRef, jni, threadForInterrupt)) != NULL))
return NSK_FALSE;
/* enable event */
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
! jvmti, JVMTI_ENABLE, JVMTI_EVENT_EXCEPTION, NULL)))
return NSK_FALSE;
return NSK_TRUE;
}
--- 146,163 ----
if (threadForInterrupt == NULL) {
NSK_COMPLAIN0("DebuggeeThreadForInterrupt not found");
return NSK_FALSE;
}
! if (!NSK_JNI_VERIFY(jni, (threadForStop = jni->NewGlobalRef(threadForStop)) != NULL))
return NSK_FALSE;
! if (!NSK_JNI_VERIFY(jni, (threadForInterrupt = jni->NewGlobalRef(threadForInterrupt)) != NULL))
return NSK_FALSE;
/* enable event */
! if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_EXCEPTION, NULL)))
return NSK_FALSE;
return NSK_TRUE;
}
*** 197,212 ****
InterruptedExceptionFlag);
if (!NSK_VERIFY(InterruptedExceptionFlag))
nsk_jvmti_setFailStatus();
/* disable event */
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
! jvmti, JVMTI_DISABLE, JVMTI_EVENT_EXCEPTION, NULL)))
nsk_jvmti_setFailStatus();
! NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadForStop));
! NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, threadForInterrupt));
if (!nsk_jvmti_resumeSync())
return;
}
--- 189,203 ----
InterruptedExceptionFlag);
if (!NSK_VERIFY(InterruptedExceptionFlag))
nsk_jvmti_setFailStatus();
/* disable event */
! if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_EXCEPTION, NULL)))
nsk_jvmti_setFailStatus();
! NSK_TRACE(jni->DeleteGlobalRef(threadForStop));
! NSK_TRACE(jni->DeleteGlobalRef(threadForInterrupt));
if (!nsk_jvmti_resumeSync())
return;
}
*** 243,253 ****
if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
return JNI_ERR;
memset(&caps, 0, sizeof(caps));
caps.can_generate_exception_events = 1;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
return JNI_ERR;
}
memset(&callbacks, 0, sizeof(callbacks));
callbacks.Exception = &Exception;
--- 234,244 ----
if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
return JNI_ERR;
memset(&caps, 0, sizeof(caps));
caps.can_generate_exception_events = 1;
! if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
memset(&callbacks, 0, sizeof(callbacks));
callbacks.Exception = &Exception;
< prev index next >