mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-15 21:48:57 +00:00
8229036: Remove the testing against NSK_TRUE from tests
Remove the testing against NSK_TRUE from tests Reviewed-by: sspitsyn, cjplummer
This commit is contained in:
parent
090734266c
commit
b036071125
@ -49,18 +49,18 @@ static julong prevTime;
|
||||
|
||||
/**
|
||||
* Get time and optionally compare it with previous one.
|
||||
* @returns NSK_FALSE if any error occured.
|
||||
* @returns false if any error occured.
|
||||
*/
|
||||
static int checkTime(jvmtiEnv* jvmti, julong* time,
|
||||
julong* prevTime, const char where[]) {
|
||||
static bool checkTime(jvmtiEnv* jvmti, julong* time,
|
||||
julong* prevTime, const char where[]) {
|
||||
|
||||
char buf[32], buf2[32], buf3[32];
|
||||
int success = NSK_TRUE;
|
||||
bool success = true;
|
||||
|
||||
NSK_DISPLAY0("GetTime() for current JVMTI env\n");
|
||||
if (!NSK_JVMTI_VERIFY(
|
||||
jvmti->GetTime((jlong *)time))) {
|
||||
return NSK_FALSE;
|
||||
return false;
|
||||
}
|
||||
NSK_DISPLAY1(" ... got time: %s\n", julong_to_string(*time, buf));
|
||||
|
||||
@ -81,7 +81,7 @@ static int checkTime(jvmtiEnv* jvmti, julong* time,
|
||||
julong_to_string(*time, buf),
|
||||
julong_to_string(*prevTime, buf2),
|
||||
julong_to_string(diff, buf3));
|
||||
success = NSK_FALSE;
|
||||
success = false;
|
||||
}
|
||||
*prevTime = *time;
|
||||
}
|
||||
@ -132,7 +132,7 @@ callbackVMInit(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) {
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
callbackVMDeath(jvmtiEnv* jvmti, JNIEnv* jni) {
|
||||
int success = NSK_TRUE;
|
||||
bool success = true;
|
||||
|
||||
NSK_DISPLAY0(">>> Testcase #4: Check time in VM_DEATH callback\n");
|
||||
{
|
||||
@ -142,12 +142,12 @@ callbackVMDeath(jvmtiEnv* jvmti, JNIEnv* jni) {
|
||||
|
||||
NSK_DISPLAY1("Disable events: %d events\n", EVENTS_COUNT);
|
||||
if (!nsk_jvmti_enableEvents(JVMTI_DISABLE, EVENTS_COUNT, events, NULL)) {
|
||||
success = NSK_FALSE;
|
||||
success = false;
|
||||
} else {
|
||||
NSK_DISPLAY0(" ... disabled\n");
|
||||
}
|
||||
|
||||
if (success != NSK_TRUE) {
|
||||
if (!success) {
|
||||
NSK_DISPLAY1("Exit with FAIL exit status: %d\n", STATUS_FAIL);
|
||||
NSK_BEFORE_TRACE(exit(STATUS_FAIL));
|
||||
}
|
||||
|
||||
@ -49,18 +49,18 @@ static jvmtiTimerInfo initInfo;
|
||||
|
||||
/**
|
||||
* Get timer info and optionally compares it with initial one.
|
||||
* @returns NSK_FALSE if any error occured.
|
||||
* @returns false if any error occured.
|
||||
*/
|
||||
static int checkTimerInfo(jvmtiEnv* jvmti, jvmtiTimerInfo* info,
|
||||
jvmtiTimerInfo* initInfo, const char where[]) {
|
||||
static bool checkTimerInfo(jvmtiEnv* jvmti, jvmtiTimerInfo* info,
|
||||
jvmtiTimerInfo* initInfo, const char where[]) {
|
||||
|
||||
char buf[32], buf2[32];
|
||||
int success = NSK_TRUE;
|
||||
bool success = true;
|
||||
|
||||
NSK_DISPLAY0("GetTimerInfo() for current JVMTI env\n");
|
||||
if (!NSK_JVMTI_VERIFY(
|
||||
jvmti->GetTimerInfo(info))) {
|
||||
return NSK_FALSE;
|
||||
return false;
|
||||
}
|
||||
NSK_DISPLAY0("Got timer info:\n");
|
||||
|
||||
@ -79,7 +79,7 @@ static int checkTimerInfo(jvmtiEnv* jvmti, jvmtiTimerInfo* info,
|
||||
where, "max_value",
|
||||
julong_to_string((julong)info->max_value, buf),
|
||||
julong_to_string((julong)initInfo->max_value, buf2));
|
||||
success = NSK_FALSE;
|
||||
success = false;
|
||||
}
|
||||
if (info->may_skip_forward != initInfo->may_skip_forward) {
|
||||
NSK_COMPLAIN4("In %s GetTimerInfo() returned different info:\n"
|
||||
@ -89,7 +89,7 @@ static int checkTimerInfo(jvmtiEnv* jvmti, jvmtiTimerInfo* info,
|
||||
where, "may_skip_forward",
|
||||
(int)info->may_skip_forward,
|
||||
(int)initInfo->may_skip_forward);
|
||||
success = NSK_FALSE;
|
||||
success = false;
|
||||
}
|
||||
if (info->may_skip_backward != initInfo->may_skip_backward) {
|
||||
NSK_COMPLAIN4("In %s GetTimerInfo() returned different info:\n"
|
||||
@ -99,7 +99,7 @@ static int checkTimerInfo(jvmtiEnv* jvmti, jvmtiTimerInfo* info,
|
||||
where, "may_skip_backward",
|
||||
(int)info->may_skip_backward,
|
||||
(int)initInfo->may_skip_backward);
|
||||
success = NSK_FALSE;
|
||||
success = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -149,7 +149,7 @@ callbackVMInit(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) {
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
callbackVMDeath(jvmtiEnv* jvmti, JNIEnv* jni) {
|
||||
int success = NSK_TRUE;
|
||||
bool success = true;
|
||||
|
||||
NSK_DISPLAY0(">>> Testcase #4: Check timer info in VM_DEATH callback\n");
|
||||
{
|
||||
@ -159,12 +159,12 @@ callbackVMDeath(jvmtiEnv* jvmti, JNIEnv* jni) {
|
||||
|
||||
NSK_DISPLAY1("Disable events: %d events\n", EVENTS_COUNT);
|
||||
if (!nsk_jvmti_enableEvents(JVMTI_DISABLE, EVENTS_COUNT, events, NULL)) {
|
||||
success = NSK_FALSE;
|
||||
success = false;
|
||||
} else {
|
||||
NSK_DISPLAY0(" ... disabled\n");
|
||||
}
|
||||
|
||||
if (success != NSK_TRUE) {
|
||||
if (!success) {
|
||||
NSK_DISPLAY1("Exit with FAIL exit status: %d\n", STATUS_FAIL);
|
||||
NSK_BEFORE_TRACE(exit(STATUS_FAIL));
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ static void printKnownCapabilities(const jvmtiCapabilities* caps) {
|
||||
|
||||
#define CHECK_CAP(initCaps, caps, name) \
|
||||
if (caps->name != 0) { \
|
||||
success = NSK_FALSE; \
|
||||
success = false; \
|
||||
NSK_COMPLAIN4("GetCapabilities() in %s returned capability after add and relinguish all potential capabilities:\n" \
|
||||
"# capability: %s\n" \
|
||||
"# got value: %d\n" \
|
||||
@ -134,10 +134,10 @@ static void printKnownCapabilities(const jvmtiCapabilities* caps) {
|
||||
|
||||
/**
|
||||
* Check value of known capabilities.
|
||||
* @returns NSK_FALSE if any error occured.
|
||||
* @returns false if any error occured.
|
||||
*/
|
||||
static int checkCapabilitiesValue(jvmtiCapabilities* caps, jvmtiCapabilities* initCaps, const char where[]) {
|
||||
int success = NSK_TRUE;
|
||||
static bool checkCapabilitiesValue(jvmtiCapabilities* caps, jvmtiCapabilities* initCaps, const char where[]) {
|
||||
bool success = true;
|
||||
|
||||
CHECK_CAP(initCaps, caps, can_tag_objects);
|
||||
CHECK_CAP(initCaps, caps, can_generate_field_modification_events);
|
||||
@ -184,17 +184,17 @@ static int checkCapabilitiesValue(jvmtiCapabilities* caps, jvmtiCapabilities* in
|
||||
|
||||
/**
|
||||
* Get and check current capabilities.
|
||||
* @returns NSK_FALSE if any error occured.
|
||||
* @returns false if any error occured.
|
||||
*/
|
||||
static int checkCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* initCaps, const char where[]) {
|
||||
int success = NSK_TRUE;
|
||||
static bool checkCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* initCaps, const char where[]) {
|
||||
bool success = true;
|
||||
jvmtiCapabilities caps;
|
||||
|
||||
memset(&caps, 0, sizeof(jvmtiCapabilities));
|
||||
|
||||
NSK_DISPLAY0("GetCapabilities() for current JVMTI env\n");
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps))) {
|
||||
return NSK_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
NSK_DISPLAY0("Got raw capabilities:\n");
|
||||
@ -212,40 +212,40 @@ static int checkCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* initCaps, const
|
||||
|
||||
/**
|
||||
* Add given capabilities list.
|
||||
* @returns NSK_FALSE if any error occured.
|
||||
* @returns false if any error occured.
|
||||
*/
|
||||
static int addCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* caps) {
|
||||
static bool addCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* caps) {
|
||||
NSK_DISPLAY0("AddCapabilities() for current JVMTI env\n");
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(caps))) {
|
||||
return NSK_FALSE;
|
||||
return false;
|
||||
}
|
||||
NSK_DISPLAY0(" ... set\n");
|
||||
|
||||
return NSK_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove given capabilities list.
|
||||
* @returns NSK_FALSE if any error occured.
|
||||
* @returns false if any error occured.
|
||||
*/
|
||||
static int removeCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* caps, const char where[]) {
|
||||
static bool removeCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* caps, const char where[]) {
|
||||
NSK_DISPLAY0("RelinquishCapabilities() for current JVMTI env\n");
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(caps))) {
|
||||
return NSK_FALSE;
|
||||
return false;
|
||||
}
|
||||
NSK_DISPLAY0(" ... relinguished\n");
|
||||
|
||||
return NSK_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get potential capabilities to the given list.
|
||||
* @returns NSK_FALSE if any error occured.
|
||||
* @returns false if any error occured.
|
||||
*/
|
||||
static int getPotentialCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* caps) {
|
||||
static bool getPotentialCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* caps) {
|
||||
NSK_DISPLAY0("GetPotentialCapabilities() for current JVMTI env\n");
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(caps))) {
|
||||
return NSK_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
NSK_DISPLAY0("Got raw capabilities:\n");
|
||||
@ -254,7 +254,7 @@ static int getPotentialCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* caps) {
|
||||
NSK_DISPLAY0("Known capabilities:\n");
|
||||
printKnownCapabilities(caps);
|
||||
|
||||
return NSK_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* ============================================================================= */
|
||||
@ -296,19 +296,19 @@ callbackVMInit(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) {
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
callbackVMDeath(jvmtiEnv* jvmti, JNIEnv* jni) {
|
||||
int success = NSK_TRUE;
|
||||
bool success = true;
|
||||
|
||||
NSK_DISPLAY0(">>> Testcase #4: Check capabilities in VM_DEATH callback\n");
|
||||
success = checkCapabilities(jvmti, &initCaps, "VM_DEATH callback");
|
||||
|
||||
NSK_DISPLAY1("Disable events: %d events\n", EVENTS_COUNT);
|
||||
if (!nsk_jvmti_enableEvents(JVMTI_DISABLE, EVENTS_COUNT, events, NULL)) {
|
||||
success = NSK_FALSE;
|
||||
success = false;
|
||||
} else {
|
||||
NSK_DISPLAY0(" ... disabled\n");
|
||||
}
|
||||
|
||||
if (success != NSK_TRUE) {
|
||||
if (!success) {
|
||||
NSK_DISPLAY1("Exit with FAIL exit status: %d\n", STATUS_FAIL);
|
||||
NSK_BEFORE_TRACE(exit(STATUS_FAIL));
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ static void printKnownCapabilities(const jvmtiCapabilities* caps) {
|
||||
|
||||
#define CHECK_CAP(initCaps, caps, name) \
|
||||
if (caps->name != 0) { \
|
||||
success = NSK_FALSE; \
|
||||
success = false; \
|
||||
NSK_COMPLAIN4("GetCapabilities() in %s returned capability after add and relinguish all potential capabilities:\n" \
|
||||
"# capability: %s\n" \
|
||||
"# got value: %d\n" \
|
||||
@ -134,10 +134,10 @@ static void printKnownCapabilities(const jvmtiCapabilities* caps) {
|
||||
|
||||
/**
|
||||
* Check value of known capabilities.
|
||||
* @returns NSK_FALSE if any error occured.
|
||||
* @returns false if any error occured.
|
||||
*/
|
||||
static int checkCapabilitiesValue(jvmtiCapabilities* caps, jvmtiCapabilities* initCaps, const char where[]) {
|
||||
int success = NSK_TRUE;
|
||||
static bool checkCapabilitiesValue(jvmtiCapabilities* caps, jvmtiCapabilities* initCaps, const char where[]) {
|
||||
bool success = true;
|
||||
|
||||
CHECK_CAP(initCaps, caps, can_tag_objects);
|
||||
CHECK_CAP(initCaps, caps, can_generate_field_modification_events);
|
||||
@ -184,17 +184,17 @@ static int checkCapabilitiesValue(jvmtiCapabilities* caps, jvmtiCapabilities* in
|
||||
|
||||
/**
|
||||
* Get and check current capabilities.
|
||||
* @returns NSK_FALSE if any error occured.
|
||||
* @returns false if any error occured.
|
||||
*/
|
||||
static int checkCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* initCaps, const char where[]) {
|
||||
int success = NSK_TRUE;
|
||||
static bool checkCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* initCaps, const char where[]) {
|
||||
bool success = true;
|
||||
jvmtiCapabilities caps;
|
||||
|
||||
memset(&caps, 0, sizeof(jvmtiCapabilities));
|
||||
|
||||
NSK_DISPLAY0("GetCapabilities() for current JVMTI env\n");
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->GetCapabilities(&caps))) {
|
||||
return NSK_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
NSK_DISPLAY0("Got raw capabilities:\n");
|
||||
@ -212,40 +212,40 @@ static int checkCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* initCaps, const
|
||||
|
||||
/**
|
||||
* Add given capabilities list.
|
||||
* @returns NSK_FALSE if any error occured.
|
||||
* @returns false if any error occured.
|
||||
*/
|
||||
static int addCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* caps) {
|
||||
static bool addCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* caps) {
|
||||
NSK_DISPLAY0("AddCapabilities() for current JVMTI env\n");
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(caps))) {
|
||||
return NSK_FALSE;
|
||||
return false;
|
||||
}
|
||||
NSK_DISPLAY0(" ... set\n");
|
||||
|
||||
return NSK_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove given capabilities list.
|
||||
* @returns NSK_FALSE if any error occured.
|
||||
* @returns false if any error occured.
|
||||
*/
|
||||
static int removeCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* caps, const char where[]) {
|
||||
static bool removeCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* caps, const char where[]) {
|
||||
NSK_DISPLAY0("RelinquishCapabilities() for current JVMTI env\n");
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->RelinquishCapabilities(caps))) {
|
||||
return NSK_FALSE;
|
||||
return false;
|
||||
}
|
||||
NSK_DISPLAY0(" ... relinguished\n");
|
||||
|
||||
return NSK_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get potential capabilities to the given list.
|
||||
* @returns NSK_FALSE if any error occured.
|
||||
* @returns false if any error occured.
|
||||
*/
|
||||
static int getPotentialCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* caps) {
|
||||
static bool getPotentialCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* caps) {
|
||||
NSK_DISPLAY0("GetPotentialCapabilities() for current JVMTI env\n");
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->GetPotentialCapabilities(caps))) {
|
||||
return NSK_FALSE;
|
||||
return false;
|
||||
}
|
||||
|
||||
NSK_DISPLAY0("Got raw capabilities:\n");
|
||||
@ -254,7 +254,7 @@ static int getPotentialCapabilities(jvmtiEnv* jvmti, jvmtiCapabilities* caps) {
|
||||
NSK_DISPLAY0("Known capabilities:\n");
|
||||
printKnownCapabilities(caps);
|
||||
|
||||
return NSK_TRUE;
|
||||
return true;
|
||||
}
|
||||
|
||||
/* ============================================================================= */
|
||||
@ -295,19 +295,19 @@ callbackVMInit(jvmtiEnv* jvmti, JNIEnv* jni, jthread thread) {
|
||||
*/
|
||||
JNIEXPORT void JNICALL
|
||||
callbackVMDeath(jvmtiEnv* jvmti, JNIEnv* jni) {
|
||||
int success = NSK_TRUE;
|
||||
bool success = true;
|
||||
|
||||
NSK_DISPLAY0(">>> Testcase #4: Check capabilities in VM_DEATH callback\n");
|
||||
success = checkCapabilities(jvmti, &initCaps, "VM_DEATH callback");
|
||||
|
||||
NSK_DISPLAY1("Disable events: %d events\n", EVENTS_COUNT);
|
||||
if (!nsk_jvmti_enableEvents(JVMTI_DISABLE, EVENTS_COUNT, events, NULL)) {
|
||||
success = NSK_FALSE;
|
||||
success = false;
|
||||
} else {
|
||||
NSK_DISPLAY0(" ... disabled\n");
|
||||
}
|
||||
|
||||
if (success != NSK_TRUE) {
|
||||
if (success != true) {
|
||||
NSK_DISPLAY1("Exit with FAIL exit status: %d\n", STATUS_FAIL);
|
||||
NSK_BEFORE_TRACE(exit(STATUS_FAIL));
|
||||
}
|
||||
|
||||
@ -73,7 +73,7 @@ JNIEXPORT void JNICALL doRedefineInNativeThread(jvmtiEnv * jvmti,
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName, sizeof(fileName)/sizeof(char));
|
||||
for (i = 0; i < 30; i++) {
|
||||
nsk_printf(" Inside the redefine method..\n");
|
||||
if (nsk_jvmti_redefineClass(jvmti, cla,fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti, cla,fileName)) {
|
||||
nsk_printf("\nMyClass :: Successfully redefined..\n");
|
||||
} else {
|
||||
nsk_printf("\nMyClass :: Failed to redefine ..\n");
|
||||
|
||||
@ -46,9 +46,9 @@ JNIEXPORT void JNICALL
|
||||
char fileName[512];
|
||||
nsk_jvmti_getFileName(0, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti, klass, fileName)) {
|
||||
nsk_printf("Agent:: Successfully redefined..");
|
||||
if (nsk_jvmti_disableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_disableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Agent :: NOTIFICATIONS ARE DISABLED \n");
|
||||
} else {
|
||||
nsk_printf(" Agent :: Failed to disabled \n");
|
||||
@ -96,8 +96,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti,
|
||||
JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf("Agent :: NOTIFICATIONS ARE ENABLED \n");
|
||||
} else {
|
||||
nsk_printf(" Error in Eanableing Notifications..");
|
||||
|
||||
@ -81,7 +81,7 @@ Java_nsk_jvmti_scenarios_hotswap_HS104_hs104t002_hs104t002_redefineClasses(
|
||||
}
|
||||
nsk_jvmti_getFileName(0, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti, cla, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti, cla, fileName)) {
|
||||
nsk_printf(" Agent :: Redefine successfull.\n");
|
||||
} else {
|
||||
nsk_printf("# error Agent :: Redefine failed.\n");
|
||||
|
||||
@ -73,7 +73,7 @@ JNIEXPORT void JNICALL callbackClassPrepare(jvmtiEnv *jvmti,
|
||||
nsk_printf(" ## Error occured %s \n",TranslateError(err));
|
||||
} else {
|
||||
nsk_printf(" NO ERRORS ");
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_BREAKPOINT, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_BREAKPOINT, NULL)) {
|
||||
nsk_printf(" Enabled.. notification event ..\n");
|
||||
}
|
||||
}
|
||||
@ -116,7 +116,7 @@ void JNICALL callbackBreakpoint(jvmtiEnv *jvmti_env,
|
||||
jlocation location) {
|
||||
jvmtiError err;
|
||||
err = JVMTI_ERROR_NONE;
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_SINGLE_STEP, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_SINGLE_STEP, NULL)) {
|
||||
nsk_printf(" Enabled.. notification event ..");
|
||||
}
|
||||
err= jvmti->SetEventNotificationMode(JVMTI_DISABLE,
|
||||
@ -172,7 +172,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" ## Error occured %s \n",TranslateError(rc));
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf("Agent :: NOTIFICATIONS ARE ENABLED \n");
|
||||
} else {
|
||||
nsk_printf(" Error in Eanableing Notifications..");
|
||||
|
||||
@ -64,7 +64,7 @@ void JNICALL callbackMethodExit(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
jvmti_env->GetMethodDeclaringClass(method, &cls);
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, cls,fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, cls,fileName)) {
|
||||
nsk_printf(" Agent:: redefine class success ..\n");
|
||||
nsk_printf("Agent::SUSPENDING>> \n");
|
||||
err=jvmti_env->SuspendThread(thread);
|
||||
@ -119,7 +119,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event callbacks \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (NSK_TRUE == nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_METHOD_EXIT, NULL)) {
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_METHOD_EXIT, NULL)) {
|
||||
nsk_printf(" Agent :: NOTIFICATIONS ARE ENABLED \n");
|
||||
} else {
|
||||
nsk_printf(" Agent :: Error Enabling Notifications..");
|
||||
@ -160,7 +160,7 @@ Java_nsk_jvmti_scenarios_hotswap_HS202_hs202t002_hs202t002_resumeThread(JNIEnv *
|
||||
|
||||
// disable notifications before resuming thread
|
||||
// to avoid recursion on PopFrame issued reinvoke
|
||||
if (NSK_TRUE == nsk_jvmti_disableNotification(jvmti,JVMTI_EVENT_METHOD_EXIT, NULL)) {
|
||||
if (nsk_jvmti_disableNotification(jvmti,JVMTI_EVENT_METHOD_EXIT, NULL)) {
|
||||
nsk_printf("Agent :: nsk_jvmti_disabled notifications..\n");
|
||||
} else {
|
||||
nsk_printf("Agent :: Failed to disable notifications..");
|
||||
|
||||
@ -97,7 +97,7 @@ void JNICALL callbackSingleStep(jvmtiEnv *jvmti, JNIEnv* jni,
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
nsk_printf(" %d..",redefineNumber);
|
||||
if (nsk_jvmti_redefineClass(jvmti, threadClass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti, threadClass, fileName)) {
|
||||
nsk_printf("\nMyClass :: Successfully redefined..\n");
|
||||
} else {
|
||||
nsk_printf("\nMyClass :: Failed to redefine ..\n");
|
||||
@ -118,7 +118,7 @@ callbackBreakpoint(jvmtiEnv *jvmti,
|
||||
jmethodID method,
|
||||
jlocation location) {
|
||||
nsk_printf("Agent::... BreakPoint Reached..\n");
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_SINGLE_STEP,thread) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_SINGLE_STEP,thread)) {
|
||||
nsk_printf(" .... Enabled..\n");
|
||||
}
|
||||
return;
|
||||
@ -166,8 +166,8 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if ((nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_LOAD, NULL) == NSK_TRUE) &&
|
||||
(nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_BREAKPOINT,NULL) == NSK_TRUE)) {
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_LOAD, NULL) &&
|
||||
nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_BREAKPOINT,NULL)) {
|
||||
nsk_printf("Agent :: NOTIFICATIONS ARE ENABLED \n");
|
||||
} else {
|
||||
nsk_printf(" Error in Eanableing Notifications..");
|
||||
|
||||
@ -98,7 +98,7 @@ void JNICALL callbackSingleStep(jvmtiEnv *jvmti,
|
||||
nsk_printf(" %d..",redefineNumber);
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName, sizeof(fileName)/sizeof(char));
|
||||
|
||||
if (nsk_jvmti_redefineClass(jvmti, threadClass,fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti, threadClass,fileName)) {
|
||||
nsk_printf("Agent:: Redefined..\n");
|
||||
} else {
|
||||
nsk_printf(" Failed to redefine..\n");
|
||||
@ -168,10 +168,8 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if ((nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_LOAD,
|
||||
NULL) == NSK_TRUE) &&
|
||||
(nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_BREAKPOINT,
|
||||
NULL) == NSK_TRUE)) {
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_LOAD, NULL) &&
|
||||
nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_BREAKPOINT, NULL)) {
|
||||
nsk_printf("Agent :: NOTIFICATIONS ARE ENABLED \n");
|
||||
} else {
|
||||
nsk_printf(" Error in Eanableing Notifications..");
|
||||
|
||||
@ -99,7 +99,7 @@ JNIEXPORT void JNICALL callbackFieldAccess(jvmtiEnv *jvmti_env,
|
||||
} else {
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, clas, fileName) != NSK_TRUE) {
|
||||
if (!nsk_jvmti_redefineClass(jvmti_env, clas, fileName)) {
|
||||
nsk_printf(" Agent :: Failed to redefine.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
@ -155,8 +155,8 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf("#error Agent :: while setting event callbacks.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if ((nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) &&
|
||||
(nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_FIELD_ACCESS, NULL) == NSK_TRUE)) {
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL) &&
|
||||
nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_FIELD_ACCESS, NULL)) {
|
||||
nsk_printf(" Agent :: Notifications are enabled.\n");
|
||||
} else {
|
||||
nsk_printf("#error Agent :: Eanableing Notifications.\n");
|
||||
|
||||
@ -50,7 +50,7 @@ JNIEXPORT void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
if (strcmp(className, CLASS_NAME) == 0) {
|
||||
if (nsk_jvmti_enableNotification(jvmti_env, JVMTI_EVENT_COMPILED_METHOD_LOAD, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti_env, JVMTI_EVENT_COMPILED_METHOD_LOAD, NULL)) {
|
||||
NSK_DISPLAY0(" Agent :: notification enabled for COMPILED_METHOD_LOAD.\n");
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->GenerateEvents(JVMTI_EVENT_COMPILED_METHOD_LOAD))) {
|
||||
NSK_COMPLAIN0("#error Agent :: occured while enabling compiled method events.\n");
|
||||
@ -106,7 +106,7 @@ JNIEXPORT void JNICALL callbackCompiledMethodLoad(jvmtiEnv *jvmti_env,
|
||||
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName, sizeof(fileName)/sizeof(char));
|
||||
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, threadClass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, threadClass, fileName)) {
|
||||
NSK_DISPLAY0(" Agent :: Successfully redefined.\n");
|
||||
redefineNumber++;
|
||||
} else {
|
||||
@ -171,7 +171,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
NSK_COMPLAIN0("#error Agent :: occured while setting event callback.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
NSK_DISPLAY0(" Agent :: Notifications are enabled.\n");
|
||||
} else {
|
||||
NSK_COMPLAIN0("#error Agent :: Error in enableing Notifications.\n");
|
||||
|
||||
@ -69,7 +69,7 @@ callbackClassLoad(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
NSK_DISPLAY1(">>>>>>CallbackClassLoad ... Name=%s... >>\n",name);
|
||||
if (nsk_jvmti_redefineClass(jvmti, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti, klass, fileName)) {
|
||||
NSK_DISPLAY0("\nMyClass :: Successfully redefined..\n");
|
||||
redefineNumber++;
|
||||
} else {
|
||||
@ -94,7 +94,7 @@ callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
NSK_DISPLAY1(">>>>>>callbackClassPrepare ... Name=%s... >>\n",name);
|
||||
if (nsk_jvmti_redefineClass(jvmti, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti, klass, fileName)) {
|
||||
NSK_DISPLAY0("\nMyClass :: Successfully redefined..\n");
|
||||
redefineNumber++;
|
||||
} else {
|
||||
|
||||
@ -104,7 +104,7 @@ void JNICALL callbackBreakpoint(jvmtiEnv *jvmti_env,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
cls = jni->FindClass(SEARCH_NAME);
|
||||
printf("Agent:: Break Pont Reached..");
|
||||
if (nsk_jvmti_redefineClass(jvmti, cls, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti, cls, fileName)) {
|
||||
nsk_printf("\nMyClass :: Successfully redefined..\n");
|
||||
} else {
|
||||
nsk_printf("\nMyClass :: Failed to redefine ..\n");
|
||||
|
||||
@ -118,7 +118,7 @@ JNIEXPORT void JNICALL callbackFieldAccess(jvmtiEnv *jvmti_env,
|
||||
jvmtiThreadInfo info;
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, field_klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, field_klass, fileName)) {
|
||||
NSK_DISPLAY0(" Agent :: Successfully redefined.\n");
|
||||
redefineNumber++;
|
||||
} else {
|
||||
|
||||
@ -97,7 +97,7 @@ void JNICALL callbackBreakpoint(jvmtiEnv *jvmti_env,
|
||||
/* Redefine the class loader and then pop the
|
||||
frame and resume the thread..*/
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName, sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, clas, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, clas, fileName)) {
|
||||
nsk_printf("\nMyClass :: Successfully redefined..\n");
|
||||
} else {
|
||||
nsk_printf("\nMyClass :: Failed to redefine ..\n");
|
||||
|
||||
@ -90,7 +90,7 @@ Java_nsk_jvmti_scenarios_hotswap_HS301_hs301t001_hs301t001_redefine(JNIEnv * jni
|
||||
}
|
||||
ret = JNI_FALSE;
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName, sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti, cls, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti, cls, fileName)) {
|
||||
nsk_printf("Agent:: Redefine successful.\n");
|
||||
ret = JNI_TRUE;
|
||||
} else {
|
||||
|
||||
@ -90,7 +90,7 @@ Java_nsk_jvmti_scenarios_hotswap_HS301_hs301t002_hs301t002_redefine(JNIEnv * jni
|
||||
}
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti, cls, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti, cls, fileName)) {
|
||||
nsk_printf("Agent:: MyClass :: Successfully redefined.\n");
|
||||
ret = JNI_TRUE;
|
||||
} else {
|
||||
|
||||
@ -46,7 +46,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
fileName, sizeof(fileName)/sizeof(char));
|
||||
nsk_jvmti_disableNotification(jvmti_env,
|
||||
JVMTI_EVENT_CLASS_LOAD, NULL);
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName)) {
|
||||
nsk_printf("\n Redefine successful.\n");
|
||||
} else {
|
||||
nsk_printf("\n Redefine failed.\n");
|
||||
@ -92,7 +92,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Agent:: Enabled notification.\n");
|
||||
} else {
|
||||
nsk_printf(" Agent:: Failed to enable notification.\n");
|
||||
|
||||
@ -47,7 +47,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName)) {
|
||||
nsk_printf("Agent:: Redefine successful.\n");
|
||||
} else {
|
||||
nsk_printf("Agent:: Redefine failed.\n");
|
||||
@ -93,7 +93,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Enabled notification.\n");
|
||||
} else {
|
||||
nsk_printf(" Failed to enable notifications.\n");
|
||||
|
||||
@ -43,7 +43,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti,
|
||||
char fileName[512];
|
||||
nsk_jvmti_disableNotification(jvmti, JVMTI_EVENT_CLASS_LOAD, NULL);
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName, sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti, klass, fileName)) {
|
||||
nsk_printf("\n Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("\n Redefine failed..\n");
|
||||
@ -88,7 +88,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
||||
@ -43,7 +43,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
char fileName[512];
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName, sizeof(fileName)/sizeof(char));
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName)) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -88,7 +88,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
||||
@ -44,7 +44,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
char fileName[512];
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName, sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName)) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("Redefine failed .. \n");
|
||||
@ -94,8 +94,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE,
|
||||
NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
||||
@ -44,7 +44,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName, sizeof(fileName)/sizeof(char));
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName)) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("Redefine failed .. \n");
|
||||
@ -93,7 +93,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
||||
@ -43,7 +43,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass,fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass,fileName)) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -88,7 +88,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
||||
@ -45,7 +45,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass,fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass,fileName)) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -90,7 +90,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
||||
@ -44,7 +44,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName)) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -89,7 +89,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
||||
@ -41,7 +41,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName)) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -86,7 +86,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
||||
@ -44,7 +44,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName)) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -89,7 +89,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
||||
@ -45,7 +45,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass,fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass,fileName)) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -89,7 +89,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
||||
@ -44,7 +44,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName)) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -88,7 +88,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
||||
@ -44,7 +44,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName)) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -89,7 +89,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
||||
@ -46,7 +46,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME, fileName,
|
||||
sizeof(fileName)/sizeof(char));
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName) == NSK_TRUE) {
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName)) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -91,7 +91,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE, NULL)) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
||||
@ -306,7 +306,7 @@ static int checkThreads(int suspended, const char* kind) {
|
||||
/* query frame location */
|
||||
if (!NSK_JVMTI_VERIFY(
|
||||
jvmti->GetFrameLocation(threadsDesc[i].thread, j, &qMethod, &qLocation))
|
||||
&& (suspended == NSK_TRUE)) {
|
||||
&& suspended) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
continue;
|
||||
}
|
||||
@ -315,7 +315,7 @@ static int checkThreads(int suspended, const char* kind) {
|
||||
(void*)qMethod, (long)qLocation);
|
||||
|
||||
/* check frame equality */
|
||||
if ((suspended == NSK_TRUE) && (frameStack[j].method != qMethod)) {
|
||||
if (suspended && (frameStack[j].method != qMethod)) {
|
||||
NSK_COMPLAIN6("Different method in stack frame #%d for %s thread #%d (%s):\n"
|
||||
"# GetStackTrace(): %p\n"
|
||||
"# GetFrameLocation(): %p\n",
|
||||
@ -323,7 +323,7 @@ static int checkThreads(int suspended, const char* kind) {
|
||||
(void*)frameStack[j].method, (void*)qMethod);
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
if ((suspended == NSK_TRUE) && (frameStack[j].location != qLocation)) {
|
||||
if (suspended && (frameStack[j].location != qLocation)) {
|
||||
NSK_COMPLAIN6("Different location in stack frame #%d for %s thread #%d (%s):\n"
|
||||
"# GetStackTrace(): %ld\n"
|
||||
"# GetFrameLocation(): %ld\n",
|
||||
|
||||
@ -329,7 +329,7 @@ static int checkThreads(int suspended, const char* kind0) {
|
||||
/* query frame location */
|
||||
if (!NSK_JVMTI_VERIFY(
|
||||
jvmti->GetFrameLocation(threadsDesc[i].thread, j, &qMethod, &qLocation))
|
||||
&& (suspended == NSK_TRUE)) {
|
||||
&& suspended) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
continue;
|
||||
}
|
||||
@ -338,7 +338,7 @@ static int checkThreads(int suspended, const char* kind0) {
|
||||
(void*)qMethod, (long)qLocation);
|
||||
|
||||
/* check frame equality */
|
||||
if ((suspended == NSK_TRUE) && (frameStack[j].method != qMethod)) {
|
||||
if (suspended && (frameStack[j].method != qMethod)) {
|
||||
NSK_COMPLAIN6("Different method in stack frame #%d for %s thread #%d (%s):\n"
|
||||
"# GetStackTrace(): 0x%p\n"
|
||||
"# GetFrameLocation(): 0x%p\n",
|
||||
@ -346,7 +346,7 @@ static int checkThreads(int suspended, const char* kind0) {
|
||||
(void*)frameStack[j].method, (void*)qMethod);
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
if ((suspended == NSK_TRUE) && (frameStack[j].location != qLocation)) {
|
||||
if (suspended && (frameStack[j].location != qLocation)) {
|
||||
NSK_COMPLAIN6("Different location in stack frame #%d for %s thread #%d (%s):\n"
|
||||
"# GetStackTrace(): %ld\n"
|
||||
"# GetFrameLocation(): %ld\n",
|
||||
|
||||
@ -96,7 +96,7 @@ Java_nsk_jvmti_unit_ForceEarlyReturn_earlyretbase_suspThread(JNIEnv *env,
|
||||
}
|
||||
|
||||
int result = suspendThreadAtMethod(jvmti, cls, earlyretThr, midActiveMethod);
|
||||
if( result == NSK_TRUE) {
|
||||
if (result) {
|
||||
return PASSED;
|
||||
} else {
|
||||
RETURN_FAILED;
|
||||
|
||||
@ -523,7 +523,7 @@ int nsk_jvmti_redefineClass(jvmtiEnv * jvmti,
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_nsk_share_jvmti_RedefineAgent_redefineAttempted(JNIEnv *jni, jobject obj) {
|
||||
|
||||
if (redefineAttempted == NSK_TRUE) {
|
||||
if (redefineAttempted) {
|
||||
return JNI_TRUE;
|
||||
}else {
|
||||
return JNI_FALSE;
|
||||
@ -534,7 +534,7 @@ Java_nsk_share_jvmti_RedefineAgent_redefineAttempted(JNIEnv *jni, jobject obj)
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_nsk_share_jvmti_RedefineAgent_isRedefined(JNIEnv * jni, jobject obj) {
|
||||
|
||||
if (redefineSucceed == NSK_TRUE) {
|
||||
if (redefineSucceed) {
|
||||
return JNI_TRUE;
|
||||
}else {
|
||||
return JNI_FALSE;
|
||||
@ -545,7 +545,7 @@ Java_nsk_share_jvmti_RedefineAgent_isRedefined(JNIEnv * jni, jobject obj) {
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_nsk_share_jvmti_RedefineAgent_agentStatus(JNIEnv * jni, jobject obj) {
|
||||
if (agentFailed == NSK_TRUE) {
|
||||
if (agentFailed) {
|
||||
return JNI_FALSE;
|
||||
} else {
|
||||
return JNI_TRUE;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user