test/hotspot/jtreg/vmTestbase/nsk/jvmti/unit/events/redefineCFLH/JvmtiTest/JvmtiTest.cpp
changeset 52642 9cfc8b0c45fd
parent 51775 dfed97156841
equal deleted inserted replaced
52641:09a3f379b927 52642:9cfc8b0c45fd
   108 
   108 
   109     if (options != NULL && strcmp(options, "printdump") == 0) {
   109     if (options != NULL && strcmp(options, "printdump") == 0) {
   110         printdump = JNI_TRUE;
   110         printdump = JNI_TRUE;
   111     }
   111     }
   112 
   112 
   113     if ((res = vm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1)) != JNI_OK) {
   113     res = vm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
       
   114     if (res != JNI_OK) {
   114         printf("%s: Failed to call GetEnv: error=%d\n", __FILE__, res);
   115         printf("%s: Failed to call GetEnv: error=%d\n", __FILE__, res);
   115         return JNI_ERR;
   116         return JNI_ERR;
   116     }
   117     }
   117 
   118 
   118     err = jvmti->GetPotentialCapabilities(&caps);
   119     err = jvmti->GetPotentialCapabilities(&caps);
   147         printf("(SetEventCallbacks) unexpected error: %s (%d)\n",
   148         printf("(SetEventCallbacks) unexpected error: %s (%d)\n",
   148                TranslateError(err), err);
   149                TranslateError(err), err);
   149         return JNI_ERR;
   150         return JNI_ERR;
   150     }
   151     }
   151 
   152 
   152     if ((err = (jvmti->SetEventNotificationMode(JVMTI_ENABLE,
   153     err = jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_VM_INIT, NULL);
   153              JVMTI_EVENT_VM_INIT, NULL))) != JVMTI_ERROR_NONE) {
   154     if (err != JVMTI_ERROR_NONE) {
   154         printf("Failed to enable event JVMTI_EVENT_VM_INIT: %s (%d)\n",
   155         printf("Failed to enable event JVMTI_EVENT_VM_INIT: %s (%d)\n",
   155                TranslateError(err), err);
   156                TranslateError(err), err);
   156         return JNI_ERR;
   157         return JNI_ERR;
   157     }
   158     }
   158 
   159 
   159     if ((err = (jvmti->SetEventNotificationMode(JVMTI_ENABLE,
   160     err = jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL);
   160              JVMTI_EVENT_CLASS_FILE_LOAD_HOOK, NULL))) != JVMTI_ERROR_NONE) {
   161     if (err != JVMTI_ERROR_NONE) {
   161         printf("Failed to enable event JVMTI_EVENT_CLASS_FILE_LOAD_HOOK: %s (%d)\n",
   162         printf("Failed to enable event JVMTI_EVENT_CLASS_FILE_LOAD_HOOK: %s (%d)\n",
   162                TranslateError(err), err);
   163                TranslateError(err), err);
   163         return JNI_ERR;
   164         return JNI_ERR;
   164     }
   165     }
   165 
   166