comparison test/hotspot/jtreg/vmTestbase/nsk/jvmti/SingleStep/singlestep002/singlestep002.cpp @ 57435:eefd0a71c160

8234697: Generate sun.security.util.math.intpoly classes during build Reviewed-by: erikj, mullan
author weijun
date Sat, 14 Dec 2019 13:50:34 +0800
parents cdfabab3413f
children
comparison
equal deleted inserted replaced
2:9bbe07eaaa25 3:8271e05680ce
48 void JNICALL 48 void JNICALL
49 SingleStep(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread, 49 SingleStep(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread thread,
50 jmethodID method, jlocation location) { 50 jmethodID method, jlocation location) {
51 jvmtiPhase phase; 51 jvmtiPhase phase;
52 52
53 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetPhase, 53 if (!NSK_JVMTI_VERIFY(jvmti_env->GetPhase(&phase))) {
54 jvmti_env, &phase))) {
55 result = STATUS_FAILED; 54 result = STATUS_FAILED;
56 NSK_COMPLAIN0("TEST FAILED: unable to obtain phase of the VM execution during SingleStep callback\n\n"); 55 NSK_COMPLAIN0("TEST FAILED: unable to obtain phase of the VM execution during SingleStep callback\n\n");
57 } 56 }
58 else { 57 else {
59 if (phase != JVMTI_PHASE_LIVE) { 58 if (phase != JVMTI_PHASE_LIVE) {
103 return JNI_ERR; 102 return JNI_ERR;
104 103
105 /* add capability to generate compiled method events */ 104 /* add capability to generate compiled method events */
106 memset(&caps, 0, sizeof(jvmtiCapabilities)); 105 memset(&caps, 0, sizeof(jvmtiCapabilities));
107 caps.can_generate_single_step_events = 1; 106 caps.can_generate_single_step_events = 1;
108 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(AddCapabilities, 107 if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)))
109 jvmti, &caps)))
110 return JNI_ERR; 108 return JNI_ERR;
111 109
112 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB2(GetCapabilities, 110 if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps)))
113 jvmti, &caps)))
114 return JNI_ERR; 111 return JNI_ERR;
115 112
116 if (!caps.can_generate_single_step_events) 113 if (!caps.can_generate_single_step_events)
117 NSK_DISPLAY0("Warning: generation of single step events is not implemented\n"); 114 NSK_DISPLAY0("Warning: generation of single step events is not implemented\n");
118 115
119 /* set event callback */ 116 /* set event callback */
120 NSK_DISPLAY0("setting event callbacks ...\n"); 117 NSK_DISPLAY0("setting event callbacks ...\n");
121 (void) memset(&callbacks, 0, sizeof(callbacks)); 118 (void) memset(&callbacks, 0, sizeof(callbacks));
122 callbacks.SingleStep = &SingleStep; 119 callbacks.SingleStep = &SingleStep;
123 callbacks.VMDeath = &VMDeath; 120 callbacks.VMDeath = &VMDeath;
124 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB3(SetEventCallbacks, 121 if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&callbacks, sizeof(callbacks))))
125 jvmti, &callbacks, sizeof(callbacks))))
126 return JNI_ERR; 122 return JNI_ERR;
127 123
128 NSK_DISPLAY0("setting event callbacks done\nenabling JVMTI events ...\n"); 124 NSK_DISPLAY0("setting event callbacks done\nenabling JVMTI events ...\n");
129 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode, 125 if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, NULL)))
130 jvmti, JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, NULL)))
131 return JNI_ERR; 126 return JNI_ERR;
132 if (!NSK_JVMTI_VERIFY(NSK_CPP_STUB4(SetEventNotificationMode, 127 if (!NSK_JVMTI_VERIFY(jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL)))
133 jvmti, JVMTI_ENABLE, JVMTI_EVENT_VM_DEATH, NULL)))
134 return JNI_ERR; 128 return JNI_ERR;
135 NSK_DISPLAY0("enabling the events done\n\n"); 129 NSK_DISPLAY0("enabling the events done\n\n");
136 130
137 return JNI_OK; 131 return JNI_OK;
138 } 132 }