test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t003/hs203t003.cpp
changeset 57683 1cf884e437ea
parent 57629 7aba63ce3b3a
child 58679 9c3209ff7550
equal deleted inserted replaced
57681:41f2f2829a09 57683:1cf884e437ea
    97         nsk_printf(" Agent :: (*JNI)->FindClass(jni, %s) returns `null`.\n",SEARCH_NAME);
    97         nsk_printf(" Agent :: (*JNI)->FindClass(jni, %s) returns `null`.\n",SEARCH_NAME);
    98         nsk_jvmti_agentFailed();
    98         nsk_jvmti_agentFailed();
    99     } else  {
    99     } else  {
   100         nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
   100         nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
   101                                 sizeof(fileName)/sizeof(char));
   101                                 sizeof(fileName)/sizeof(char));
   102         if (nsk_jvmti_redefineClass(jvmti_env, clas, fileName) != NSK_TRUE) {
   102         if (!nsk_jvmti_redefineClass(jvmti_env, clas, fileName)) {
   103             nsk_printf(" Agent :: Failed to redefine.\n");
   103             nsk_printf(" Agent :: Failed to redefine.\n");
   104             nsk_jvmti_agentFailed();
   104             nsk_jvmti_agentFailed();
   105         } else {
   105         } else {
   106             nsk_printf(" Agent :: Redefined.\n");
   106             nsk_printf(" Agent :: Redefined.\n");
   107             nsk_printf(" Agent :: Suspendeding thread.\n");
   107             nsk_printf(" Agent :: Suspendeding thread.\n");
   153         eventCallbacks.FieldAccess= callbackFieldAccess;
   153         eventCallbacks.FieldAccess= callbackFieldAccess;
   154         if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
   154         if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
   155             nsk_printf("#error Agent :: while setting event callbacks.\n");
   155             nsk_printf("#error Agent :: while setting event callbacks.\n");
   156             return JNI_ERR;
   156             return JNI_ERR;
   157         }
   157         }
   158         if ((nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) &&
   158         if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL) &&
   159                 (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_FIELD_ACCESS, NULL) == NSK_TRUE)) {
   159                 nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_FIELD_ACCESS, NULL)) {
   160             nsk_printf(" Agent :: Notifications are enabled.\n");
   160             nsk_printf(" Agent :: Notifications are enabled.\n");
   161         } else {
   161         } else {
   162             nsk_printf("#error Agent :: Eanableing Notifications.\n");
   162             nsk_printf("#error Agent :: Eanableing Notifications.\n");
   163             return JNI_ERR;
   163             return JNI_ERR;
   164         }
   164         }