< prev index next >
test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t003/ma10t003.cpp
Print this page
rev 52100 : 8212082: Remove the NSK_CPP_STUB macros for remaining vmTestbase/jvmti/[sS]*
Summary:
Reviewed-by:
*** 53,72 ****
jboolean was_poped_by_exception, jvalue return_value) {
char *name = NULL;
char *signature = NULL;
MethodExitEventsCount++;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB5(GetMethodName,
! jvmti_env, method, &name, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY2("MethodExit 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) {
--- 53,71 ----
jboolean was_poped_by_exception, jvalue return_value) {
char *name = NULL;
char *signature = NULL;
MethodExitEventsCount++;
! if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &name, &signature, NULL))) {
nsk_jvmti_setFailStatus();
return;
}
NSK_DISPLAY2("MethodExit 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) {
*** 77,88 ****
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;
--- 76,86 ----
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;
*** 90,118 ****
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;
}
--- 88,113 ----
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;
}
*** 128,139 ****
if (!prepare(jvmti, jni)) {
nsk_jvmti_setFailStatus();
return;
}
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode,
! jvmti, JVMTI_ENABLE, JVMTI_EVENT_METHOD_EXIT, thread)))
nsk_jvmti_setFailStatus();
/* resume debugee and wait for sync */
if (!nsk_jvmti_resumeSync())
return;
--- 123,133 ----
if (!prepare(jvmti, jni)) {
nsk_jvmti_setFailStatus();
return;
}
! if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_METHOD_EXIT, thread)))
nsk_jvmti_setFailStatus();
/* resume debugee and wait for sync */
if (!nsk_jvmti_resumeSync())
return;
*** 143,153 ****
NSK_DISPLAY1("MethodExit events received: %d\n",
MethodExitEventsCount);
if (!NSK_VERIFY(MethodExitEventsCount != 0))
nsk_jvmti_setFailStatus();
! NSK_TRACE(NSK_CPP_STUB2(DeleteGlobalRef, jni, thread));
if (!nsk_jvmti_resumeSync())
return;
}
--- 137,147 ----
NSK_DISPLAY1("MethodExit events received: %d\n",
MethodExitEventsCount);
if (!NSK_VERIFY(MethodExitEventsCount != 0))
nsk_jvmti_setFailStatus();
! NSK_TRACE(jni->DeleteGlobalRef(thread));
if (!nsk_jvmti_resumeSync())
return;
}
*** 184,194 ****
if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
return JNI_ERR;
memset(&caps, 0, sizeof(caps));
caps.can_generate_method_exit_events = 1;
! if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, jvmti, &caps))) {
return JNI_ERR;
}
memset(&callbacks, 0, sizeof(callbacks));
callbacks.MethodExit = &MethodExit;
--- 178,188 ----
if (!NSK_VERIFY(nsk_jvmti_setAgentProc(agentProc, NULL)))
return JNI_ERR;
memset(&caps, 0, sizeof(caps));
caps.can_generate_method_exit_events = 1;
! if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
return JNI_ERR;
}
memset(&callbacks, 0, sizeof(callbacks));
callbacks.MethodExit = &MethodExit;
< prev index next >