test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t001/hs203t001.cpp
changeset 57683 1cf884e437ea
parent 57629 7aba63ce3b3a
child 58679 9c3209ff7550
equal deleted inserted replaced
57681:41f2f2829a09 57683:1cf884e437ea
    95     char fileName[512];
    95     char fileName[512];
    96     threadClass = jni->FindClass(SEARCH_NAME);
    96     threadClass = jni->FindClass(SEARCH_NAME);
    97     nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
    97     nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
    98                     sizeof(fileName)/sizeof(char));
    98                     sizeof(fileName)/sizeof(char));
    99     nsk_printf(" %d..",redefineNumber);
    99     nsk_printf(" %d..",redefineNumber);
   100     if (nsk_jvmti_redefineClass(jvmti, threadClass, fileName) == NSK_TRUE) {
   100     if (nsk_jvmti_redefineClass(jvmti, threadClass, fileName)) {
   101         nsk_printf("\nMyClass :: Successfully redefined..\n");
   101         nsk_printf("\nMyClass :: Successfully redefined..\n");
   102     } else {
   102     } else {
   103         nsk_printf("\nMyClass :: Failed to redefine ..\n");
   103         nsk_printf("\nMyClass :: Failed to redefine ..\n");
   104     }
   104     }
   105     nsk_printf(" End of REDEFINE CLASS LOADER \n");
   105     nsk_printf(" End of REDEFINE CLASS LOADER \n");
   116         JNIEnv* jni,
   116         JNIEnv* jni,
   117         jthread thread,
   117         jthread thread,
   118         jmethodID method,
   118         jmethodID method,
   119         jlocation location) {
   119         jlocation location) {
   120     nsk_printf("Agent::... BreakPoint Reached..\n");
   120     nsk_printf("Agent::... BreakPoint Reached..\n");
   121     if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_SINGLE_STEP,thread) == NSK_TRUE) {
   121     if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_SINGLE_STEP,thread)) {
   122         nsk_printf(" ....   Enabled..\n");
   122         nsk_printf(" ....   Enabled..\n");
   123     }
   123     }
   124     return;
   124     return;
   125 }
   125 }
   126 
   126 
   164         rc=jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks));
   164         rc=jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks));
   165         if (rc != JVMTI_ERROR_NONE) {
   165         if (rc != JVMTI_ERROR_NONE) {
   166             nsk_printf(" Agent:: Error occured while setting event call back \n");
   166             nsk_printf(" Agent:: Error occured while setting event call back \n");
   167             return JNI_ERR;
   167             return JNI_ERR;
   168         }
   168         }
   169         if ((nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_LOAD, NULL) == NSK_TRUE) &&
   169         if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_LOAD, NULL) &&
   170                 (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_BREAKPOINT,NULL) == NSK_TRUE)) {
   170                 nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_BREAKPOINT,NULL)) {
   171             nsk_printf("Agent :: NOTIFICATIONS ARE ENABLED \n");
   171             nsk_printf("Agent :: NOTIFICATIONS ARE ENABLED \n");
   172         } else {
   172         } else {
   173             nsk_printf(" Error in Eanableing Notifications..");
   173             nsk_printf(" Error in Eanableing Notifications..");
   174         }
   174         }
   175     }
   175     }