8212770: Remove spaces before/after () for vmTestbase/jvmti/[s-u]
Remove spaces before/after () Reviewed-by: amenkov, cjplummer
This commit is contained in:
parent
ae21c81dd7
commit
be312edc2a
@ -102,10 +102,10 @@ static int getCounter(volatile int* counterPtr) {
|
||||
/***********************************************************************/
|
||||
|
||||
jvmtiIterationControl JNICALL
|
||||
heapObjectCallback( jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
heapObjectCallback(jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
|
||||
int count = 0;
|
||||
|
||||
@ -126,11 +126,11 @@ heapObjectCallback( jlong class_tag,
|
||||
|
||||
/* jvmtiHeapRootCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
heapRootCallback( jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
heapRootCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
|
||||
int count = 0;
|
||||
|
||||
@ -151,15 +151,15 @@ heapRootCallback( jvmtiHeapRootKind root_kind,
|
||||
|
||||
/* jvmtiStackReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
stackReferenceCallback( jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
stackReferenceCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
|
||||
int count = 0;
|
||||
|
||||
@ -181,13 +181,13 @@ stackReferenceCallback( jvmtiHeapRootKind root_kind,
|
||||
|
||||
/* jvmtiObjectReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
|
||||
int count = 0;
|
||||
|
||||
@ -210,16 +210,16 @@ objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
/***********************************************************************/
|
||||
|
||||
void JNICALL
|
||||
FieldModification( jvmtiEnv *jvmti_env,
|
||||
JNIEnv *env,
|
||||
jthread thr,
|
||||
jmethodID method,
|
||||
jlocation location,
|
||||
jclass field_klass,
|
||||
jobject obj,
|
||||
jfieldID field,
|
||||
char sig,
|
||||
jvalue new_value ) {
|
||||
FieldModification(jvmtiEnv *jvmti_env,
|
||||
JNIEnv *env,
|
||||
jthread thr,
|
||||
jmethodID method,
|
||||
jlocation location,
|
||||
jclass field_klass,
|
||||
jobject obj,
|
||||
jfieldID field,
|
||||
char sig,
|
||||
jvalue new_value) {
|
||||
|
||||
increaseCounter(&modificationCount);
|
||||
}
|
||||
@ -227,10 +227,10 @@ FieldModification( jvmtiEnv *jvmti_env,
|
||||
/***********************************************************************/
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t002_setTag( JNIEnv* jni,
|
||||
jclass klass,
|
||||
jobject target, /* object to be tagged */
|
||||
jlong tag ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t002_setTag(JNIEnv* jni,
|
||||
jclass klass,
|
||||
jobject target, /* object to be tagged */
|
||||
jlong tag) {
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->SetTag(target, tag))) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
@ -238,8 +238,8 @@ Java_nsk_jvmti_scenarios_allocation_AP04_ap04t002_setTag( JNIEnv* jni,
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t002_runIterateOverHeap( JNIEnv* jni,
|
||||
jclass klass ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t002_runIterateOverHeap(JNIEnv* jni,
|
||||
jclass klass) {
|
||||
int count = 0;
|
||||
|
||||
setCounter(&errorCount, 0);
|
||||
@ -267,8 +267,8 @@ Java_nsk_jvmti_scenarios_allocation_AP04_ap04t002_runIterateOverHeap( JNIEnv* jn
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t002_runIterateOverReachableObjects( JNIEnv* jni,
|
||||
jclass klass ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t002_runIterateOverReachableObjects(JNIEnv* jni,
|
||||
jclass klass) {
|
||||
int count = 0;
|
||||
|
||||
setCounter(&errorCount, 0);
|
||||
@ -297,8 +297,8 @@ Java_nsk_jvmti_scenarios_allocation_AP04_ap04t002_runIterateOverReachableObjects
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t002_runIterateOverInstancesOfClass( JNIEnv* jni,
|
||||
jclass klass ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t002_runIterateOverInstancesOfClass(JNIEnv* jni,
|
||||
jclass klass) {
|
||||
int count = 0;
|
||||
|
||||
setCounter(&errorCount, 0);
|
||||
@ -327,13 +327,13 @@ Java_nsk_jvmti_scenarios_allocation_AP04_ap04t002_runIterateOverInstancesOfClass
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t002_runIterateOverObjectsReachableFromObject( JNIEnv* jni,
|
||||
jclass klass ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t002_runIterateOverObjectsReachableFromObject(JNIEnv* jni,
|
||||
jclass klass) {
|
||||
jobject root = NULL;
|
||||
int count = 0;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (root =
|
||||
jni->GetStaticObjectField(debugeeClass, rootFieldID)) != NULL )) {
|
||||
jni->GetStaticObjectField(debugeeClass, rootFieldID)) != NULL)) {
|
||||
NSK_COMPLAIN0("GetStaticObjectField returned NULL for 'root' field value\n\n");
|
||||
nsk_jvmti_setFailStatus();
|
||||
return;
|
||||
@ -382,14 +382,14 @@ agentProc(jvmtiEnv* jvmti, JNIEnv* jni, void* arg) {
|
||||
|
||||
NSK_DISPLAY1("Find ID of 'root' field: %s\n", ROOT_SIGNATURE);
|
||||
if (!NSK_JNI_VERIFY(jni, (rootFieldID =
|
||||
jni->GetStaticFieldID(debugeeClass, "root", ROOT_SIGNATURE)) != NULL )) {
|
||||
jni->GetStaticFieldID(debugeeClass, "root", ROOT_SIGNATURE)) != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return;
|
||||
}
|
||||
|
||||
NSK_DISPLAY0("Find ID of 'modified' field\n");
|
||||
if (!NSK_JNI_VERIFY(jni, (modifiedFieldID =
|
||||
jni->GetStaticFieldID(debugeeClass, "modified", "I")) != NULL )) {
|
||||
jni->GetStaticFieldID(debugeeClass, "modified", "I")) != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return;
|
||||
}
|
||||
|
@ -120,10 +120,10 @@ void notifyThread() {
|
||||
}
|
||||
|
||||
jvmtiIterationControl JNICALL
|
||||
heapObjectCallback( jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
heapObjectCallback(jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
|
||||
if (getCounter(&iterationCount) == 0) {
|
||||
notifyThread();
|
||||
@ -139,11 +139,11 @@ heapObjectCallback( jlong class_tag,
|
||||
|
||||
/* jvmtiHeapRootCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
heapRootCallback( jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
heapRootCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
|
||||
if (getCounter(&iterationCount) == 0) {
|
||||
notifyThread();
|
||||
@ -159,15 +159,15 @@ heapRootCallback( jvmtiHeapRootKind root_kind,
|
||||
|
||||
/* jvmtiStackReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
stackReferenceCallback( jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
stackReferenceCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
|
||||
if (getCounter(&iterationCount) == 0) {
|
||||
notifyThread();
|
||||
@ -184,13 +184,13 @@ stackReferenceCallback( jvmtiHeapRootKind root_kind,
|
||||
|
||||
/* jvmtiObjectReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
|
||||
if (getCounter(&iterationCount) == 0) {
|
||||
notifyThread();
|
||||
@ -339,17 +339,17 @@ static jthread newThreadObj(JNIEnv* jni) {
|
||||
jmethodID cid;
|
||||
jthread result = NULL;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (thrClass = jni->FindClass("java/lang/Thread")) != NULL )) {
|
||||
if (!NSK_JNI_VERIFY(jni, (thrClass = jni->FindClass("java/lang/Thread")) != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (cid = jni->GetMethodID(thrClass, "<init>", "()V")) != NULL )) {
|
||||
if (!NSK_JNI_VERIFY(jni, (cid = jni->GetMethodID(thrClass, "<init>", "()V")) != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return result;
|
||||
}
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (result = jni->NewObject(thrClass, cid)) != NULL )) {
|
||||
if (!NSK_JNI_VERIFY(jni, (result = jni->NewObject(thrClass, cid)) != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return result;
|
||||
}
|
||||
@ -402,10 +402,10 @@ static void afterIteration (JNIEnv* jni) {
|
||||
/***********************************************************************/
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_setTag( JNIEnv* jni,
|
||||
jclass klass,
|
||||
jobject target, /* object to be tagged */
|
||||
jlong tag ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_setTag(JNIEnv* jni,
|
||||
jclass klass,
|
||||
jobject target, /* object to be tagged */
|
||||
jlong tag) {
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->SetTag(target, tag))) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
@ -413,8 +413,8 @@ Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_setTag( JNIEnv* jni,
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_runIterateOverHeap( JNIEnv* jni,
|
||||
jclass klass ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_runIterateOverHeap(JNIEnv* jni,
|
||||
jclass klass) {
|
||||
int modified = 0;
|
||||
int found = 0;
|
||||
|
||||
@ -443,8 +443,8 @@ Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_runIterateOverHeap( JNIEnv* jn
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_runIterateOverReachableObjects( JNIEnv* jni,
|
||||
jclass klass ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_runIterateOverReachableObjects(JNIEnv* jni,
|
||||
jclass klass) {
|
||||
int modified = 0;
|
||||
int found = 0;
|
||||
|
||||
@ -474,8 +474,8 @@ Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_runIterateOverReachableObjects
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_runIterateOverInstancesOfClass( JNIEnv* jni,
|
||||
jclass klass ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_runIterateOverInstancesOfClass(JNIEnv* jni,
|
||||
jclass klass) {
|
||||
int modified = 0;
|
||||
int found = 0;
|
||||
|
||||
@ -505,14 +505,14 @@ Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_runIterateOverInstancesOfClass
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_runIterateOverObjectsReachableFromObject( JNIEnv* jni,
|
||||
jclass klass ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP04_ap04t003_runIterateOverObjectsReachableFromObject(JNIEnv* jni,
|
||||
jclass klass) {
|
||||
jobject root = NULL;
|
||||
int modified = 0;
|
||||
int found = 0;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (root =
|
||||
jni->GetStaticObjectField(debugeeClass, rootFieldID)) != NULL )) {
|
||||
jni->GetStaticObjectField(debugeeClass, rootFieldID)) != NULL)) {
|
||||
NSK_COMPLAIN0("GetStaticObjectField returned NULL for 'root' field value\n\n");
|
||||
nsk_jvmti_setFailStatus();
|
||||
return;
|
||||
@ -561,7 +561,7 @@ agentProc(jvmtiEnv* jvmti, JNIEnv* jni, void* arg) {
|
||||
|
||||
NSK_DISPLAY1("Find ID of 'root' field: %s\n", ROOT_SIGNATURE);
|
||||
if (!NSK_JNI_VERIFY(jni, (rootFieldID =
|
||||
jni->GetStaticFieldID(debugeeClass, "root", ROOT_SIGNATURE)) != NULL )) {
|
||||
jni->GetStaticFieldID(debugeeClass, "root", ROOT_SIGNATURE)) != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return;
|
||||
}
|
||||
|
@ -51,38 +51,38 @@ static int staticFieldsCount = 0, instanceFieldsCount = 0;
|
||||
|
||||
/* jvmtiHeapRootCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
heapRootCallback( jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
heapRootCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
return JVMTI_ITERATION_CONTINUE;
|
||||
}
|
||||
|
||||
/* jvmtiStackReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
stackReferenceCallback( jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
stackReferenceCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
return JVMTI_ITERATION_CONTINUE;
|
||||
}
|
||||
|
||||
|
||||
/* jvmtiObjectReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
|
||||
if (*tag_ptr == REFERREE_TAG && (referrer_tag == CLS_TAG || referrer_tag == REFERRER_TAG)) {
|
||||
NSK_DISPLAY4("objectReferenceCallback: reference kind=%s, referrer_index=%d, referrer_tag=%d, referree_tag=%d\n",
|
||||
@ -100,10 +100,10 @@ objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
/************************/
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP05_ap05t001_setTag( JNIEnv* jni,
|
||||
jobject obj,
|
||||
jobject target,
|
||||
jlong tag ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP05_ap05t001_setTag(JNIEnv* jni,
|
||||
jobject obj,
|
||||
jobject target,
|
||||
jlong tag) {
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->SetTag(target, tag))) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
@ -111,7 +111,7 @@ Java_nsk_jvmti_scenarios_allocation_AP05_ap05t001_setTag( JNIEnv* jni,
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP05_ap05t001_setReferrer( JNIEnv* jni, jclass klass, jobject ref) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP05_ap05t001_setReferrer(JNIEnv* jni, jclass klass, jobject ref) {
|
||||
if (!NSK_JNI_VERIFY(jni, (referrer = jni->NewGlobalRef(ref)) != NULL))
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ static int caseNumber = 0, forthRef = 0, backRef = 0;
|
||||
|
||||
/* jvmtiHeapRootCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
heapRootCallback( jvmtiHeapRootKind root_kind,
|
||||
heapRootCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
@ -58,28 +58,28 @@ heapRootCallback( jvmtiHeapRootKind root_kind,
|
||||
|
||||
/* jvmtiStackReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
stackReferenceCallback( jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
stackReferenceCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
return JVMTI_ITERATION_CONTINUE;
|
||||
}
|
||||
|
||||
|
||||
/* jvmtiObjectReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
|
||||
if (*tag_ptr != 0 && referrer_tag != 0) {
|
||||
NSK_DISPLAY4("objectReferenceCallback: reference kind=%s, referrer_index=%d, referrer_tag=%d, referree_tag=%d\n",
|
||||
@ -98,10 +98,10 @@ objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
/************************/
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP05_ap05t002_setTag( JNIEnv* jni,
|
||||
jobject obj,
|
||||
jobject target,
|
||||
jlong tag ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP05_ap05t002_setTag(JNIEnv* jni,
|
||||
jobject obj,
|
||||
jobject target,
|
||||
jlong tag) {
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->SetTag(target, tag))) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
@ -109,7 +109,7 @@ Java_nsk_jvmti_scenarios_allocation_AP05_ap05t002_setTag( JNIEnv* jni,
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP05_ap05t002_setReferrer( JNIEnv* jni, jclass klass, jobject ref, jint caseNum) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP05_ap05t002_setReferrer(JNIEnv* jni, jclass klass, jobject ref, jint caseNum) {
|
||||
caseNumber = caseNum;
|
||||
if (!NSK_JNI_VERIFY(jni, (referrer = jni->NewGlobalRef(ref)) != NULL))
|
||||
nsk_jvmti_setFailStatus();
|
||||
|
@ -50,7 +50,7 @@ static const char* THREAD_CLS_SIGNATURE = "Lnsk/jvmti/scenarios/allocation/AP06/
|
||||
|
||||
/* jvmtiHeapRootCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
heapRootCallback( jvmtiHeapRootKind root_kind,
|
||||
heapRootCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
@ -75,15 +75,15 @@ heapRootCallback( jvmtiHeapRootKind root_kind,
|
||||
|
||||
/* jvmtiStackReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
stackReferenceCallback( jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
stackReferenceCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
|
||||
if (*tag_ptr == threadTag) {
|
||||
NSK_DISPLAY4("stackReferenceCallback: root kind=%s, "
|
||||
@ -107,13 +107,13 @@ stackReferenceCallback( jvmtiHeapRootKind root_kind,
|
||||
|
||||
/* jvmtiObjectReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
|
||||
return JVMTI_ITERATION_ABORT;
|
||||
}
|
||||
@ -122,7 +122,7 @@ objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
/************************/
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP06_ap06t001Thread_setTag( JNIEnv* jni, jobject obj) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP06_ap06t001Thread_setTag(JNIEnv* jni, jobject obj) {
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->SetTag(obj, threadTag))) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
@ -180,19 +180,19 @@ agentProc(jvmtiEnv* jvmti, JNIEnv* jni, void* arg) {
|
||||
if (rootJNILocalCount != 1) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
NSK_COMPLAIN1("JVMTI_HEAP_ROOT_JNI_LOCAL root kind was returned wrong %d times "
|
||||
"while iteration with IterateOverReachableObjects.\n\n", rootJNILocalCount );
|
||||
"while iteration with IterateOverReachableObjects.\n\n", rootJNILocalCount);
|
||||
}
|
||||
|
||||
if (rootJNIGlobalCount != 1) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
NSK_COMPLAIN1("JVMTI_HEAP_ROOT_JNI_GLOBAL root kind was returned wrong %d times "
|
||||
"while iteration with IterateOverReachableObjects.\n\n", rootJNIGlobalCount );
|
||||
"while iteration with IterateOverReachableObjects.\n\n", rootJNIGlobalCount);
|
||||
}
|
||||
|
||||
if (rootThreadCount != 1) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
NSK_COMPLAIN1("JVMTI_HEAP_ROOT_THREAD root kind was returned wrong %d times "
|
||||
"while iteration with IterateOverReachableObjects.\n\n", rootThreadCount );
|
||||
"while iteration with IterateOverReachableObjects.\n\n", rootThreadCount);
|
||||
}
|
||||
|
||||
} while (0);
|
||||
|
@ -47,11 +47,11 @@ static const jlong IGNORE_TAG = (jlong)10l;
|
||||
|
||||
/* jvmtiHeapRootCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
heapRootCallback( jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
heapRootCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
|
||||
if (*tag_ptr > 0) {
|
||||
NSK_DISPLAY2("heapRootCallback: root kind=%s, tag=%d\n", TranslateRootKind(root_kind), (long)*tag_ptr);
|
||||
@ -61,15 +61,15 @@ heapRootCallback( jvmtiHeapRootKind root_kind,
|
||||
|
||||
/* jvmtiStackReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
stackReferenceCallback( jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
stackReferenceCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
|
||||
if (*tag_ptr > 0) {
|
||||
NSK_DISPLAY2("stackReferenceCallback: root kind=%s, tag=%d\n", TranslateRootKind(root_kind), (long)*tag_ptr);
|
||||
@ -80,13 +80,13 @@ stackReferenceCallback( jvmtiHeapRootKind root_kind,
|
||||
|
||||
/* jvmtiObjectReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
|
||||
if (*tag_ptr > 0) {
|
||||
NSK_DISPLAY2("objectReferenceCallback: reference kind=%s, tag=%d\n", TranslateObjectRefKind(reference_kind), (long)*tag_ptr);
|
||||
@ -106,10 +106,10 @@ objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
/************************/
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP07_ap07t001_setTag( JNIEnv* jni,
|
||||
jobject obj,
|
||||
jobject target,
|
||||
jlong tag ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP07_ap07t001_setTag(JNIEnv* jni,
|
||||
jobject obj,
|
||||
jobject target,
|
||||
jlong tag) {
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->SetTag(target, tag))) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
@ -117,7 +117,7 @@ Java_nsk_jvmti_scenarios_allocation_AP07_ap07t001_setTag( JNIEnv* jni,
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP07_ap07t001_setRoot( JNIEnv* jni, jobject obj) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP07_ap07t001_setRoot(JNIEnv* jni, jobject obj) {
|
||||
if (!NSK_JNI_VERIFY(jni, (root = jni->NewGlobalRef(obj)) != NULL))
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
@ -47,11 +47,11 @@ static const jlong IGNORE_TAG = (jlong)10l;
|
||||
|
||||
/* jvmtiHeapRootCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
heapRootCallback( jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
heapRootCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
|
||||
if (*tag_ptr > 0) {
|
||||
NSK_DISPLAY2("heapRootCallback: root kind=%s, tag=%d\n", TranslateRootKind(root_kind), (long)*tag_ptr);
|
||||
@ -61,15 +61,15 @@ heapRootCallback( jvmtiHeapRootKind root_kind,
|
||||
|
||||
/* jvmtiStackReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
stackReferenceCallback( jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
stackReferenceCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
|
||||
if (*tag_ptr > 0) {
|
||||
NSK_DISPLAY2("stackReferenceCallback: root kind=%s, tag=%d\n", TranslateRootKind(root_kind), (long)*tag_ptr);
|
||||
@ -84,13 +84,13 @@ stackReferenceCallback( jvmtiHeapRootKind root_kind,
|
||||
|
||||
/* jvmtiObjectReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
|
||||
if (*tag_ptr > 0) {
|
||||
NSK_DISPLAY2("objectReferenceCallback: reference kind=%s, tag=%d\n", TranslateObjectRefKind(reference_kind), (long)*tag_ptr);
|
||||
@ -106,10 +106,10 @@ objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
/************************/
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP07_ap07t002_setTag( JNIEnv* jni,
|
||||
jobject obj,
|
||||
jobject target,
|
||||
jlong tag ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP07_ap07t002_setTag(JNIEnv* jni,
|
||||
jobject obj,
|
||||
jobject target,
|
||||
jlong tag) {
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->SetTag(target, tag))) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
|
@ -61,38 +61,38 @@ static int interfaceFound = 0;
|
||||
|
||||
/* jvmtiHeapRootCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
heapRootCallback( jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
heapRootCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
void* user_data) {
|
||||
return JVMTI_ITERATION_CONTINUE;
|
||||
}
|
||||
|
||||
/* jvmtiStackReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
stackReferenceCallback( jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
stackReferenceCallback(jvmtiHeapRootKind root_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong thread_tag,
|
||||
jint depth,
|
||||
jmethodID method,
|
||||
jint slot,
|
||||
void* user_data) {
|
||||
return JVMTI_ITERATION_CONTINUE;
|
||||
}
|
||||
|
||||
|
||||
/* jvmtiObjectReferenceCallback */
|
||||
jvmtiIterationControl JNICALL
|
||||
objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
objectReferenceCallback(jvmtiObjectReferenceKind reference_kind,
|
||||
jlong class_tag,
|
||||
jlong size,
|
||||
jlong* tag_ptr,
|
||||
jlong referrer_tag,
|
||||
jint referrer_index,
|
||||
void* user_data) {
|
||||
|
||||
if (*tag_ptr != 0 && referrer_tag != 0) {
|
||||
NSK_DISPLAY4("objectReferenceCallback: reference kind=%s, referrer_index=%d, referrer_tag=%d, referree_tag=%d\n",
|
||||
@ -127,10 +127,10 @@ objectReferenceCallback( jvmtiObjectReferenceKind reference_kind,
|
||||
/************************/
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP09_ap09t001_setTag( JNIEnv* jni,
|
||||
jobject obj,
|
||||
jobject target,
|
||||
jlong tag ) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP09_ap09t001_setTag(JNIEnv* jni,
|
||||
jobject obj,
|
||||
jobject target,
|
||||
jlong tag) {
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->SetTag(target, tag))) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
@ -138,7 +138,7 @@ Java_nsk_jvmti_scenarios_allocation_AP09_ap09t001_setTag( JNIEnv* jni,
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP09_ap09t001_setReferrer( JNIEnv* jni, jclass klass, jobject ref) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP09_ap09t001_setReferrer(JNIEnv* jni, jclass klass, jobject ref) {
|
||||
if (!NSK_JNI_VERIFY(jni, (referrer = jni->NewGlobalRef(ref)) != NULL))
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ VMDeath(jvmtiEnv *jvmti_env, JNIEnv *env) {
|
||||
/************************/
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_nsk_jvmti_scenarios_allocation_AP12_ap12t001_setTag( JNIEnv* jni, jobject obj, jlong tag) {
|
||||
Java_nsk_jvmti_scenarios_allocation_AP12_ap12t001_setTag(JNIEnv* jni, jobject obj, jlong tag) {
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->SetTag(obj, tag))) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
|
@ -110,7 +110,7 @@ cbClassFileLoadHook(jvmtiEnv *jvmti_env, JNIEnv* jni_env,
|
||||
const unsigned char* class_data, jint* new_class_data_len,
|
||||
unsigned char** new_class_data) {
|
||||
|
||||
if ( name == NULL || strcmp(name, TESTED_CLASS_NAME) ) {
|
||||
if (name == NULL || strcmp(name, TESTED_CLASS_NAME)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -112,7 +112,7 @@ cbClassFileLoadHook(jvmtiEnv *jvmti_env, JNIEnv* jni_env,
|
||||
const unsigned char* class_data, jint* new_class_data_len,
|
||||
unsigned char** new_class_data) {
|
||||
|
||||
if ( name == NULL || strcmp(name, TESTED_CLASS_NAME) ) {
|
||||
if (name == NULL || strcmp(name, TESTED_CLASS_NAME)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -127,7 +127,7 @@ Java_nsk_jvmti_scenarios_events_EM01_em01t002_startThread(JNIEnv *jni_env,
|
||||
return NSK_FALSE;
|
||||
}
|
||||
|
||||
if (!NSK_JNI_VERIFY_VOID(jni_env,jni_env->CallVoidMethod(thread, methodID)) ) {
|
||||
if (!NSK_JNI_VERIFY_VOID(jni_env,jni_env->CallVoidMethod(thread, methodID))) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return NSK_FALSE;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ handler(jvmtiEvent event, jvmtiEnv* jvmti, JNIEnv* jni_env,
|
||||
|
||||
className = jni_env->GetStringUTFChars(jclassName, 0);
|
||||
|
||||
if ( className != NULL && (strcmp(className, EXPECTED_CLASS_NAME)==0) ) {
|
||||
if (className != NULL && (strcmp(className, EXPECTED_CLASS_NAME)==0)) {
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->RawMonitorEnter(syncLock)))
|
||||
nsk_jvmti_setFailStatus();
|
||||
|
@ -124,7 +124,7 @@ jboolean enableClassUnloadEvent (jboolean enable) {
|
||||
|
||||
if (!NSK_JVMTI_VERIFY(
|
||||
jvmti->SetExtensionEventCallback(extList[i].extension_event_index,
|
||||
enable ? (jvmtiExtensionEvent)ClassUnload : NULL ))) {
|
||||
enable ? (jvmtiExtensionEvent)ClassUnload : NULL))) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
@ -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_TRUE) {
|
||||
nsk_printf("\nMyClass :: Successfully redefined..\n");
|
||||
} else {
|
||||
nsk_printf("\nMyClass :: Failed to redefine ..\n");
|
||||
@ -112,12 +112,12 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
|
||||
rc = vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if (rc != JNI_OK ) {
|
||||
if (rc != JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -154,7 +154,7 @@ Java_nsk_jvmti_scenarios_hotswap_HS103_hs103t002_hs103t002_startAgentThread(JNIE
|
||||
if (err == JVMTI_ERROR_INVALID_PRIORITY) {
|
||||
nsk_printf(" JVMTI_ERROR_INVALID_PRIORITY ..\n");
|
||||
return JNI_ERR;
|
||||
} else if ( err == JVMTI_ERROR_INVALID_THREAD) {
|
||||
} else if (err == JVMTI_ERROR_INVALID_THREAD) {
|
||||
nsk_printf(" JVMTI_ERROR_INVALID_THREAD ..\n");
|
||||
return JNI_ERR;
|
||||
} else if (err == JVMTI_ERROR_NULL_POINTER) {
|
||||
|
@ -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_TRUE) {
|
||||
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_TRUE) {
|
||||
nsk_printf(" Agent :: NOTIFICATIONS ARE DISABLED \n");
|
||||
} else {
|
||||
nsk_printf(" Agent :: Failed to disabled \n");
|
||||
@ -75,13 +75,13 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jvmtiEnv * jvmti;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -96,8 +96,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_PREPARE, NULL) == NSK_TRUE ) {
|
||||
if (nsk_jvmti_enableNotification(jvmti,
|
||||
JVMTI_EVENT_CLASS_PREPARE, NULL) == NSK_TRUE) {
|
||||
nsk_printf("Agent :: NOTIFICATIONS ARE ENABLED \n");
|
||||
} else {
|
||||
nsk_printf(" Error in Eanableing Notifications..");
|
||||
|
@ -49,18 +49,18 @@ JNIEXPORT jint JNI_OnLoad_hs104t002(JavaVM *jvm, char *options, void *reserved)
|
||||
}
|
||||
#endif
|
||||
jint Agent_Initialize(JavaVM *vm, char *options, void *reserved){
|
||||
if ( ! NSK_VERIFY ( JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1) ) ) {
|
||||
if (!NSK_VERIFY (JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1))) {
|
||||
nsk_printf("#error Agent :: Could not load JVMTI interface.\n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
caps.can_redefine_classes = 1;
|
||||
if (! NSK_JVMTI_VERIFY ( jvmti->AddCapabilities(&caps) )) {
|
||||
if (!NSK_JVMTI_VERIFY (jvmti->AddCapabilities(&caps))) {
|
||||
nsk_printf("#error Agent :: occured while adding capabilities.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -74,14 +74,14 @@ Java_nsk_jvmti_scenarios_hotswap_HS104_hs104t002_hs104t002_redefineClasses(
|
||||
jclass cla;
|
||||
char fileName[512];
|
||||
|
||||
if ( ! NSK_JNI_VERIFY(jni, ( cla = jni->FindClass(SEARCH_NAME) ) != NULL ) ) {
|
||||
if (!NSK_JNI_VERIFY(jni, (cla = jni->FindClass(SEARCH_NAME)) != NULL)) {
|
||||
nsk_printf(" Agent :: Failed to get class.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
return;
|
||||
}
|
||||
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_TRUE) {
|
||||
nsk_printf(" Agent :: Redefine successfull.\n");
|
||||
} else {
|
||||
nsk_printf("# error Agent :: Redefine failed.\n");
|
||||
|
@ -63,7 +63,7 @@ JNIEXPORT void JNICALL callbackClassPrepare(jvmtiEnv *jvmti,
|
||||
jlocation end;
|
||||
jvmtiError err ;
|
||||
err=jvmti->GetMethodLocation(method, &start, &end);
|
||||
if ( err != JVMTI_ERROR_NONE ) {
|
||||
if (err != JVMTI_ERROR_NONE) {
|
||||
nsk_printf(" ## Error occured %s \n",TranslateError(err));
|
||||
}else {
|
||||
nsk_printf("\n Start = %d and end = %d ", start , end);
|
||||
@ -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_TRUE) {
|
||||
nsk_printf(" Enabled.. notification event ..\n");
|
||||
}
|
||||
}
|
||||
@ -116,8 +116,8 @@ 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_TRUE) {
|
||||
nsk_printf(" Enabled.. notification event ..");
|
||||
}
|
||||
err= jvmti->SetEventNotificationMode(JVMTI_DISABLE,
|
||||
@ -145,14 +145,14 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jint code;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
code = vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( code != JNI_OK ) {
|
||||
if (code != JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -173,7 +173,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_TRUE) {
|
||||
nsk_printf("Agent :: NOTIFICATIONS ARE ENABLED \n");
|
||||
} else {
|
||||
nsk_printf(" Error in Eanableing Notifications..");
|
||||
@ -192,7 +192,7 @@ Java_nsk_jvmti_scenarios_hotswap_HS202_hs202t001_hs202t001_popThreadFrame(JNIEnv
|
||||
nsk_printf("Agent:: POPING THE FRAME....\n");
|
||||
retvalue = JNI_FALSE;
|
||||
jvmti->GetThreadState(thread, &state);
|
||||
if ( state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
if (state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
err = jvmti->PopFrame(thread);
|
||||
if (err == JVMTI_ERROR_NONE) {
|
||||
nsk_printf("Agent:: NO Errors poped very well ..\n");
|
||||
|
@ -57,7 +57,7 @@ void JNICALL callbackMethodExit(jvmtiEnv *jvmti_env,
|
||||
jmethodID method,
|
||||
jboolean was_popped_by_exception,
|
||||
jvalue return_value) {
|
||||
if ( was_popped_by_exception ) {
|
||||
if (was_popped_by_exception) {
|
||||
char * name;
|
||||
char * signature;
|
||||
char * generic ;
|
||||
@ -70,7 +70,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_TRUE) {
|
||||
nsk_printf(" Agent:: redefine class success ..\n");
|
||||
nsk_printf("Agent::SUSPENDING>> \n");
|
||||
err=jvmti_env->SuspendThread(thread);
|
||||
@ -102,14 +102,14 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
redefineNumber=0;
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -143,7 +143,7 @@ Java_nsk_jvmti_scenarios_hotswap_HS202_hs202t002_hs202t002_popThreadFrame(JNIEnv
|
||||
jint state;
|
||||
nsk_printf("Agent:: POPPING THE FRAME..\n");
|
||||
jvmti->GetThreadState(thread, &state);
|
||||
if ( state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
if (state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
err = jvmti->PopFrame(thread);
|
||||
if (err == JVMTI_ERROR_NONE) {
|
||||
nsk_printf("Agent:: PopFrame succeeded..\n");
|
||||
|
@ -71,7 +71,7 @@ JNIEXPORT void JNICALL
|
||||
if (err == JVMTI_ERROR_NONE) {
|
||||
nsk_printf("Agent:: NO ERRORS FOUND \n");
|
||||
err= jvmti->SetBreakpoint(method, start);
|
||||
if ( err == JVMTI_ERROR_NONE) {
|
||||
if (err == JVMTI_ERROR_NONE) {
|
||||
nsk_printf(" Class Name %s \n", className);
|
||||
nsk_printf("Agent:: Breakpoint set \n");
|
||||
} else {
|
||||
@ -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_TRUE) {
|
||||
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_TRUE) {
|
||||
nsk_printf(" .... Enabled..\n");
|
||||
}
|
||||
return;
|
||||
@ -139,13 +139,13 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jint rc ;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) &&
|
||||
(nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_BREAKPOINT,NULL) == NSK_TRUE)) {
|
||||
nsk_printf("Agent :: NOTIFICATIONS ARE ENABLED \n");
|
||||
} else {
|
||||
nsk_printf(" Error in Eanableing Notifications..");
|
||||
@ -189,7 +189,7 @@ Java_nsk_jvmti_scenarios_hotswap_HS203_hs203t001_hs203t001_popThreadFrame(JNIEnv
|
||||
nsk_printf(" Here ");
|
||||
jvmti->GetThreadState(thread, &state);
|
||||
nsk_printf(" Here ");
|
||||
if ( state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
if (state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
err = jvmti->PopFrame(thread);
|
||||
if (err == JVMTI_ERROR_NONE) {
|
||||
nsk_printf("Agent:: NO Errors poped very well ..\n");
|
||||
|
@ -73,7 +73,7 @@ callbackClassLoad(jvmtiEnv *jvmti,
|
||||
if (err == JVMTI_ERROR_NONE) {
|
||||
nsk_printf("Agent:: NO ERRORS FOUND \n");
|
||||
err= jvmti->SetBreakpoint(method, start);
|
||||
if ( err == JVMTI_ERROR_NONE) {
|
||||
if (err == JVMTI_ERROR_NONE) {
|
||||
nsk_printf("Agent:: Breakpoint set \n");
|
||||
} else {
|
||||
nsk_printf("Agent:: ***ERROR OCCURED ... in SET BREAK POINT ERROR \n");
|
||||
@ -98,14 +98,14 @@ 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_TRUE) {
|
||||
nsk_printf("Agent:: Redefined..\n");
|
||||
} else {
|
||||
nsk_printf(" Failed to redefine..\n");
|
||||
return;
|
||||
}
|
||||
err=jvmti->SuspendThread(thread);
|
||||
if ( err == JVMTI_ERROR_NONE ) {
|
||||
if (err == JVMTI_ERROR_NONE) {
|
||||
nsk_printf("Agent:: Succeded in suspending..\n");
|
||||
} else {
|
||||
nsk_printf(" ## Error occured %s \n",TranslateError(err));
|
||||
@ -118,7 +118,7 @@ void JNICALL callbackBreakpoint(jvmtiEnv *jvmti,
|
||||
jmethodID method,
|
||||
jlocation location) {
|
||||
nsk_printf("Agent::... BreakPoint Reached..\n");
|
||||
if ( nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_SINGLE_STEP,thread) == JNI_OK ) {
|
||||
if (nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_SINGLE_STEP,thread) == JNI_OK) {
|
||||
nsk_printf(" .... Enabled..\n");
|
||||
}
|
||||
return;
|
||||
@ -140,13 +140,13 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jint rc ;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -168,10 +168,10 @@ 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,
|
||||
if ((nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_CLASS_LOAD,
|
||||
NULL) == NSK_TRUE) &&
|
||||
(nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_BREAKPOINT,
|
||||
NULL) == NSK_TRUE ) ) {
|
||||
NULL) == NSK_TRUE)) {
|
||||
nsk_printf("Agent :: NOTIFICATIONS ARE ENABLED \n");
|
||||
} else {
|
||||
nsk_printf(" Error in Eanableing Notifications..");
|
||||
@ -191,7 +191,7 @@ Java_nsk_jvmti_scenarios_hotswap_HS203_hs203t002_hs203t002_popThreadFrame(JNIEnv
|
||||
nsk_printf("Agent:: POPING THE FRAME....\n");
|
||||
retvalue = JNI_FALSE;
|
||||
jvmti->GetThreadState(thread, &state);
|
||||
if ( state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
if (state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
err = jvmti->PopFrame(thread);
|
||||
if (err == JVMTI_ERROR_NONE) {
|
||||
nsk_printf("Agent:: NO Errors poped very well ..\n");
|
||||
|
@ -60,18 +60,18 @@ JNIEXPORT void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
redefineNumber=0;
|
||||
className=NULL;
|
||||
generic=NULL;
|
||||
if ( ! NSK_JVMTI_VERIFY ( jvmti_env->GetClassSignature(klass, &className, &generic) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &className, &generic))) {
|
||||
nsk_printf("#error Agent :: while getting classname Signature.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
if (strcmp(className,CLASS_NAME) == 0) {
|
||||
jfieldID field;
|
||||
/* get the field id and set watch on that .*/
|
||||
if (! NSK_JNI_VERIFY(jni, (field = jni->GetFieldID(klass, FIELDNAME, TYPE)) != NULL) ) {
|
||||
nsk_printf(" Agent :: (*JNI)->GetFieldID(jni, ... ) returns `null`.\n");
|
||||
if (!NSK_JNI_VERIFY(jni, (field = jni->GetFieldID(klass, FIELDNAME, TYPE)) != NULL)) {
|
||||
nsk_printf(" Agent :: (*JNI)->GetFieldID(jni, ...) returns `null`.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else if ( ! NSK_JVMTI_VERIFY(jvmti_env->SetFieldAccessWatch(klass, field) ) ) {
|
||||
nsk_printf("#error Agent :: occured while jvmti->SetFieldAccessWatch(... ) .\n");
|
||||
} else if (!NSK_JVMTI_VERIFY(jvmti_env->SetFieldAccessWatch(klass, field))) {
|
||||
nsk_printf("#error Agent :: occured while jvmti->SetFieldAccessWatch(...) .\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
}
|
||||
}
|
||||
@ -93,20 +93,20 @@ JNIEXPORT void JNICALL callbackFieldAccess(jvmtiEnv *jvmti_env,
|
||||
return;
|
||||
}
|
||||
redefineNumber=0;
|
||||
if (! NSK_JNI_VERIFY(jni, (clas = jni->FindClass(SEARCH_NAME)) != NULL) ) {
|
||||
if (!NSK_JNI_VERIFY(jni, (clas = jni->FindClass(SEARCH_NAME)) != NULL)) {
|
||||
nsk_printf(" Agent :: (*JNI)->FindClass(jni, %s) returns `null`.\n",SEARCH_NAME);
|
||||
nsk_jvmti_agentFailed();
|
||||
} 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_TRUE) {
|
||||
nsk_printf(" Agent :: Failed to redefine.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
nsk_printf(" Agent :: Redefined.\n");
|
||||
nsk_printf(" Agent :: Suspendeding thread.\n");
|
||||
/* pop the current working frame. */
|
||||
if ( ! NSK_JVMTI_VERIFY(jvmti_env->SuspendThread(thread) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->SuspendThread(thread))) {
|
||||
nsk_printf("#error Agent :: occured suspending Thread.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
@ -128,13 +128,13 @@ JNIEXPORT jint JNI_OnLoad_hs203t003(JavaVM *jvm, char *options, void *reserved)
|
||||
}
|
||||
#endif
|
||||
jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
if ( ! NSK_VERIFY ( JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1) ) ) {
|
||||
if (!NSK_VERIFY(JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1))) {
|
||||
nsk_printf(" Agent :: Could not load JVMTI interface.\n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("#error Agent :: Failed to parse options.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -144,7 +144,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
caps.can_pop_frame=1;
|
||||
caps.can_generate_all_class_hook_events=1;
|
||||
caps.can_generate_field_access_events=1;
|
||||
if (! NSK_JVMTI_VERIFY ( jvmti->AddCapabilities(&caps) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
|
||||
nsk_printf("#error Agent :: while adding capabilities.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -155,10 +155,10 @@ 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_TRUE) &&
|
||||
(nsk_jvmti_enableNotification(jvmti,JVMTI_EVENT_FIELD_ACCESS, NULL)
|
||||
== NSK_TRUE)) {
|
||||
nsk_printf(" Agent :: Notifications are enabled.\n");
|
||||
} else {
|
||||
nsk_printf("#error Agent :: Eanableing Notifications.\n");
|
||||
@ -175,11 +175,11 @@ Java_nsk_jvmti_scenarios_hotswap_HS203_hs203t003_hs203t003_isSuspended(JNIEnv *
|
||||
jboolean retvalue;
|
||||
jint state;
|
||||
retvalue = JNI_FALSE;
|
||||
if ( ! NSK_JVMTI_VERIFY( jvmti->GetThreadState(thread, &state) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(thread, &state))) {
|
||||
nsk_printf(" Agent :: Error while getting thread state.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
if ( state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
if (state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
retvalue = JNI_TRUE;
|
||||
}
|
||||
}
|
||||
@ -193,18 +193,18 @@ Java_nsk_jvmti_scenarios_hotswap_HS203_hs203t003_hs203t003_popThreadFrame(JNIEnv
|
||||
jboolean retvalue;
|
||||
jint state;
|
||||
retvalue = JNI_FALSE;
|
||||
if ( ! NSK_JVMTI_VERIFY( jvmti->GetThreadState(thread, &state) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(thread, &state))) {
|
||||
nsk_printf(" Agent :: Error while getting thread state.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
if ( state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
if ( ! NSK_JVMTI_VERIFY ( jvmti->PopFrame(thread) ) ) {
|
||||
if (state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->PopFrame(thread))) {
|
||||
nsk_printf("#error Agent :: while poping thread's frame.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
nsk_printf(" Agent :: poped thread frame.\n");
|
||||
if ( ! NSK_JVMTI_VERIFY (
|
||||
jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_FIELD_ACCESS, NULL) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(
|
||||
jvmti->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_FIELD_ACCESS, NULL))) {
|
||||
nsk_printf("#error Agent :: failed to disable notification JVMTI_EVENT_FIELD ACCESS.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
@ -226,7 +226,7 @@ Java_nsk_jvmti_scenarios_hotswap_HS203_hs203t003_hs203t003_resumeThread(JNIEnv *
|
||||
jthread thread) {
|
||||
jboolean retvalue;
|
||||
retvalue = JNI_FALSE;
|
||||
if ( !NSK_JVMTI_VERIFY( jvmti->ResumeThread(thread) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread))) {
|
||||
nsk_printf("#error Agent :: while resuming thread.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
|
@ -45,14 +45,14 @@ JNIEXPORT void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
char * className;
|
||||
className=NULL;
|
||||
|
||||
if (!NSK_JVMTI_VERIFY (jvmti_env->GetClassSignature(klass, &className, NULL) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &className, NULL))) {
|
||||
NSK_COMPLAIN0("#error Agent :: while getting classname.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
if (strcmp(className, CLASS_NAME) == 0) {
|
||||
if (nsk_jvmti_enableNotification(jvmti_env, JVMTI_EVENT_COMPILED_METHOD_LOAD, NULL) == NSK_TRUE) {
|
||||
NSK_DISPLAY0(" Agent :: notification enabled for COMPILED_METHOD_LOAD.\n");
|
||||
if ( ! NSK_JVMTI_VERIFY ( jvmti_env->GenerateEvents(JVMTI_EVENT_COMPILED_METHOD_LOAD) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->GenerateEvents(JVMTI_EVENT_COMPILED_METHOD_LOAD))) {
|
||||
NSK_COMPLAIN0("#error Agent :: occured while enabling compiled method events.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
}
|
||||
@ -76,7 +76,7 @@ JNIEXPORT void JNICALL callbackCompiledMethodLoad(jvmtiEnv *jvmti_env,
|
||||
const void* compile_info) {
|
||||
jclass threadClass;
|
||||
if (redefineNumber == 0) {
|
||||
if ( ! NSK_JVMTI_VERIFY ( jvmti_env->GetMethodDeclaringClass(method, &threadClass) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodDeclaringClass(method, &threadClass))) {
|
||||
NSK_COMPLAIN0("#error Agent :: while geting the declaring class.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
@ -86,13 +86,13 @@ JNIEXPORT void JNICALL callbackCompiledMethodLoad(jvmtiEnv *jvmti_env,
|
||||
className = NULL;
|
||||
methodName = NULL;
|
||||
|
||||
if ( ! NSK_JVMTI_VERIFY (jvmti_env->GetClassSignature(threadClass, &className, NULL) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(threadClass, &className, NULL))) {
|
||||
NSK_COMPLAIN0("#error Agent :: while getting classname.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! NSK_JVMTI_VERIFY (jvmti_env->GetMethodName(method, &methodName, NULL, NULL) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodName(method, &methodName, NULL, NULL))) {
|
||||
NSK_COMPLAIN0("#error Agent :: while getting methodname.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
return;
|
||||
@ -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_TRUE) {
|
||||
NSK_DISPLAY0(" Agent :: Successfully redefined.\n");
|
||||
redefineNumber++;
|
||||
} else {
|
||||
@ -115,13 +115,13 @@ JNIEXPORT void JNICALL callbackCompiledMethodLoad(jvmtiEnv *jvmti_env,
|
||||
}
|
||||
}
|
||||
|
||||
if ( className != NULL ) {
|
||||
if (className != NULL) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char *)className))) {
|
||||
NSK_COMPLAIN1("#error Agent :: failed to Deallocate className = %s.", className);
|
||||
nsk_jvmti_agentFailed();
|
||||
}
|
||||
}
|
||||
if ( methodName != NULL ) {
|
||||
if (methodName != NULL) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char *)methodName))) {
|
||||
NSK_COMPLAIN1("#error Agent :: failed to Deallocate methodName = %s.", methodName);
|
||||
nsk_jvmti_agentFailed();
|
||||
@ -144,14 +144,14 @@ JNIEXPORT jint JNI_OnLoad_hs203t004(JavaVM *jvm, char *options, void *reserved)
|
||||
#endif
|
||||
jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
redefineNumber=0;
|
||||
if ( ! NSK_VERIFY ( JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1) ) ) {
|
||||
if (!NSK_VERIFY(JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1))) {
|
||||
NSK_DISPLAY0("#error Agent :: Could not load JVMTI interface.\n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
NSK_DISPLAY0("#error Agent :: Failed to parse options.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -160,7 +160,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
caps.can_pop_frame = 1;
|
||||
caps.can_generate_all_class_hook_events = 1;
|
||||
caps.can_generate_compiled_method_load_events = 1;
|
||||
if (! NSK_JVMTI_VERIFY ( jvmti->AddCapabilities(&caps) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
|
||||
NSK_DISPLAY0("#error Agent :: occured while adding capabilities.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
NSK_DISPLAY0(" Agent :: Notifications are enabled.\n");
|
||||
} else {
|
||||
NSK_COMPLAIN0("#error Agent :: Error in enableing Notifications.\n");
|
||||
@ -186,7 +186,7 @@ Java_nsk_jvmti_scenarios_hotswap_HS203_hs203t004_hs203t004_suspendThread(JNIEnv
|
||||
jobject clas,
|
||||
jthread thread) {
|
||||
NSK_DISPLAY0(" Agent :: Suspending Thread.\n");
|
||||
if ( NSK_JVMTI_VERIFY( jvmti->SuspendThread(thread) ) ) {
|
||||
if (NSK_JVMTI_VERIFY(jvmti->SuspendThread(thread))) {
|
||||
NSK_DISPLAY0(" Agent :: Succeded in suspending.\n");
|
||||
} else {
|
||||
NSK_COMPLAIN0("#error Agent :: occured while suspending thread.\n");
|
||||
@ -201,20 +201,20 @@ Java_nsk_jvmti_scenarios_hotswap_HS203_hs203t004_hs203t004_popThreadFrame(JNIEnv
|
||||
jboolean retvalue;
|
||||
jint state;
|
||||
|
||||
NSK_DISPLAY0(" Agent :: nsk.jvmti.scenarios.hotswap.HS203.hs203t004.popThreadFrame(... ).\n");
|
||||
NSK_DISPLAY0(" Agent :: nsk.jvmti.scenarios.hotswap.HS203.hs203t004.popThreadFrame(...).\n");
|
||||
retvalue = JNI_FALSE;
|
||||
if ( ! NSK_JVMTI_VERIFY (jvmti->GetThreadState(thread, &state) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(thread, &state))) {
|
||||
NSK_COMPLAIN0("#error Agent :: while getting thread's state.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
if ( state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
if ( ! NSK_JVMTI_VERIFY( jvmti->PopFrame(thread) ) ) {
|
||||
if (state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->PopFrame(thread))) {
|
||||
NSK_DISPLAY0("#error Agent :: occured while poping thread's frame.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
if ( NSK_JVMTI_VERIFY(
|
||||
if (NSK_JVMTI_VERIFY(
|
||||
jvmti->SetEventNotificationMode(JVMTI_DISABLE,
|
||||
JVMTI_EVENT_COMPILED_METHOD_LOAD, NULL) ) ) {
|
||||
JVMTI_EVENT_COMPILED_METHOD_LOAD, NULL))) {
|
||||
NSK_DISPLAY0(" Agent :: Disabled JVMTI_EVENT_COMPILED_METHOD_LOAD.\n");
|
||||
retvalue = JNI_TRUE;
|
||||
} else {
|
||||
@ -237,7 +237,7 @@ Java_nsk_jvmti_scenarios_hotswap_HS203_hs203t004_hs203t004_resumeThread(JNIEnv *
|
||||
jboolean retvalue;
|
||||
|
||||
retvalue = JNI_FALSE;
|
||||
if ( NSK_JVMTI_VERIFY (jvmti->ResumeThread(thread))) {
|
||||
if (NSK_JVMTI_VERIFY(jvmti->ResumeThread(thread))) {
|
||||
NSK_DISPLAY0(" Agent :: Thread resumed.\n");
|
||||
retvalue= JNI_TRUE;
|
||||
} else {
|
||||
|
@ -51,7 +51,7 @@ static jint newClassSize;
|
||||
char *getClassName(jvmtiEnv *jvmti, jclass klass) {
|
||||
char * className;
|
||||
char * generic;
|
||||
if( !NSK_JVMTI_VERIFY(jvmti->GetClassSignature(klass, &className, &generic))) {
|
||||
if(!NSK_JVMTI_VERIFY(jvmti->GetClassSignature(klass, &className, &generic))) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
return className;
|
||||
@ -64,18 +64,18 @@ callbackClassLoad(jvmtiEnv *jvmti_env,
|
||||
jclass klass) {
|
||||
char * name;
|
||||
name = getClassName(jvmti_env,klass);
|
||||
if( (strcmp(name,CLASS_NAME ) == 0) && (redefineNumber== 1) ) {
|
||||
if((strcmp(name,CLASS_NAME) == 0) && (redefineNumber== 1)) {
|
||||
char fileName[512];
|
||||
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_TRUE) {
|
||||
NSK_DISPLAY0("\nMyClass :: Successfully redefined..\n");
|
||||
redefineNumber++;
|
||||
} else {
|
||||
NSK_COMPLAIN0("\nMyClass :: Failed to redefine ..\n");
|
||||
}
|
||||
/* if ( (myTestClass = jni_env->NewGlobalRef(klass) ) == NULL) {
|
||||
/* if ((myTestClass = jni_env->NewGlobalRef(klass)) == NULL) {
|
||||
NSK_COMPLAIN0("Failed to create global ref...");
|
||||
}
|
||||
*/
|
||||
@ -89,18 +89,18 @@ callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
jclass klass) {
|
||||
char * name;
|
||||
name = getClassName(jvmti_env, klass);
|
||||
if ( (strcmp(name, CLASS_NAME) ==0 ) && (redefineNumber == 0) ) {
|
||||
if ((strcmp(name, CLASS_NAME) ==0) && (redefineNumber == 0)) {
|
||||
char fileName[512];
|
||||
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_TRUE) {
|
||||
NSK_DISPLAY0("\nMyClass :: Successfully redefined..\n");
|
||||
redefineNumber++;
|
||||
} else {
|
||||
NSK_COMPLAIN0("\nMyClass :: Failed to redefine ..\n");
|
||||
}
|
||||
if( (myTestClass = (jclass) jni_env->NewGlobalRef(klass)) == NULL) {
|
||||
if((myTestClass = (jclass) jni_env->NewGlobalRef(klass)) == NULL) {
|
||||
NSK_COMPLAIN0("Failed to create global ref...");
|
||||
}
|
||||
}
|
||||
@ -117,7 +117,7 @@ callbackClassFileLoadHock(jvmtiEnv *jvmti_env,
|
||||
const unsigned char* class_data,
|
||||
jint* new_class_data_len,
|
||||
unsigned char** new_class_data) {
|
||||
if (name != NULL && strcmp(name, NAME)==0 && (redefineNumber == 1 )) {
|
||||
if (name != NULL && strcmp(name, NAME)==0 && (redefineNumber == 1)) {
|
||||
NSK_DISPLAY1(">>>>>>callbackClassFileLoadHock ... Name=%s... >>\n",name);
|
||||
/*redefineClass(jvmti_env, myTestClass);*/
|
||||
}
|
||||
@ -174,7 +174,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jint rc ;
|
||||
NSK_DISPLAY0(" VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
NSK_COMPLAIN0(" Could not load JVMTI interface \n");
|
||||
} else {
|
||||
/* Open simple block for better memor usage. */
|
||||
@ -262,7 +262,7 @@ Java_nsk_jvmti_scenarios_hotswap_HS204_hs204t001_hs204t001_suspendThread(JNIEnv
|
||||
nsk_jvmti_setFailStatus();
|
||||
return NSK_FALSE;
|
||||
} else {
|
||||
NSK_DISPLAY0(" Sucessfully suspended Thread..\n" );
|
||||
NSK_DISPLAY0(" Sucessfully suspended Thread..\n");
|
||||
}
|
||||
} else {
|
||||
NSK_COMPLAIN0("Was not able to suspend a thread..\n");
|
||||
@ -280,7 +280,7 @@ Java_nsk_jvmti_scenarios_hotswap_HS204_hs204t001_hs204t001_popFrame(JNIEnv * env
|
||||
NSK_DISPLAY0("Inside pop_Frame method.....\n");
|
||||
if (jvmti->GetThreadState(thread, &state) == JVMTI_ERROR_NONE) {
|
||||
NSK_DISPLAY0(" Got the state of thread \n");
|
||||
if ( state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
if (state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
NSK_DISPLAY0(" Thread is already in suspended mode..\n");
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->PopFrame(thread))) {
|
||||
NSK_COMPLAIN0(" TEST FAILED: UNABLE TO POP FRAME \n");
|
||||
|
@ -54,7 +54,7 @@ callbackClassPrepare(jvmtiEnv *jvmti,
|
||||
redefineNumber=0;
|
||||
jvmti->GetClassSignature(klass, &className, &generic);
|
||||
/* printf("Agent::Class Name %s \n",className); */
|
||||
if( (strcmp(className, CLASS_NAME) == 0 ) ) {
|
||||
if((strcmp(className, CLASS_NAME) == 0)) {
|
||||
jclass cls;
|
||||
cls = jni->FindClass(SEARCH_NAME);
|
||||
if (cls == NULL) {
|
||||
@ -69,7 +69,7 @@ callbackClassPrepare(jvmtiEnv *jvmti,
|
||||
jlocation end;
|
||||
jvmtiError err ;
|
||||
err=jvmti->GetMethodLocation(method, &start, &end);
|
||||
if ( err != JVMTI_ERROR_NONE) {
|
||||
if (err != JVMTI_ERROR_NONE) {
|
||||
printf("Agent::Errors in finding start and end for the method \n");
|
||||
} else {
|
||||
printf("Agent Start = %" LL "d and end = %" LL "d \n", start , end);
|
||||
@ -77,11 +77,11 @@ callbackClassPrepare(jvmtiEnv *jvmti,
|
||||
err= jvmti->SetBreakpoint(method, start+1);
|
||||
if (err == JVMTI_ERROR_DUPLICATE) {
|
||||
printf("Agent::JVMTI_ERROR_DUPLICATE");
|
||||
} else if (err ==JVMTI_ERROR_INVALID_METHODID ) {
|
||||
} else if (err ==JVMTI_ERROR_INVALID_METHODID) {
|
||||
printf("Agent::JVMTI_ERROR_INVALID_METHODID ");
|
||||
} else if ( err == JVMTI_ERROR_INVALID_LOCATION) {
|
||||
} else if (err == JVMTI_ERROR_INVALID_LOCATION) {
|
||||
printf("Agent::JVMTI_ERROR_INVALID_LOCATION ");
|
||||
} else if ( err == JVMTI_ERROR_NONE) {
|
||||
} else if (err == JVMTI_ERROR_NONE) {
|
||||
printf("Agent::NO ERRORS ");
|
||||
} else {
|
||||
printf("Agent::VERY VERY INVALID STATE ");
|
||||
@ -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_TRUE) {
|
||||
nsk_printf("\nMyClass :: Successfully redefined..\n");
|
||||
} else {
|
||||
nsk_printf("\nMyClass :: Failed to redefine ..\n");
|
||||
@ -128,7 +128,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jint rc ;
|
||||
printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
|
@ -51,25 +51,22 @@ JNIEXPORT void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
className = NULL;
|
||||
generic = NULL;
|
||||
redefineNumber=0;
|
||||
if ( !NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &className, &generic)) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &className, &generic))) {
|
||||
NSK_DISPLAY0(" Agent :: Failed get class signature.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
if( (strcmp(className, CLASS_NAME) == 0 ) ) {
|
||||
if((strcmp(className, CLASS_NAME) == 0)) {
|
||||
jfieldID fieldId;
|
||||
if ( ! NSK_JNI_VERIFY(jni, (fieldId = jni->GetStaticFieldID(klass, FIELDNAME, TYPE) ) != NULL ) ) {
|
||||
if (!NSK_JNI_VERIFY(jni, (fieldId = jni->GetStaticFieldID(klass, FIELDNAME, TYPE)) != NULL)) {
|
||||
NSK_DISPLAY0(" Agent :: Failed to get FieldId.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
if ( ! NSK_JVMTI_VERIFY(jvmti_env->SetFieldAccessWatch(klass, fieldId) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->SetFieldAccessWatch(klass, fieldId))) {
|
||||
NSK_DISPLAY0(" Agent :: Failed to set watch point on a field.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
nsk_jvmti_enableNotification(jvmti_env, JVMTI_EVENT_FIELD_ACCESS, NULL);
|
||||
if (! NSK_JNI_VERIFY(jni,
|
||||
( watchFieldClass = (jclass)
|
||||
jni->NewGlobalRef(klass) )
|
||||
!= NULL ) ) {
|
||||
if (!NSK_JNI_VERIFY(jni, (watchFieldClass = (jclass) jni->NewGlobalRef(klass)) != NULL)) {
|
||||
NSK_DISPLAY0(" Agent :: Failed to get global reference for class.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
}
|
||||
@ -80,14 +77,14 @@ JNIEXPORT void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
}
|
||||
}
|
||||
|
||||
if ( className != NULL ) {
|
||||
if (className != NULL) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char *)className))) {
|
||||
NSK_DISPLAY1(" Agent :: #error failed to Deallocate className = %s.", className);
|
||||
nsk_jvmti_agentFailed();
|
||||
}
|
||||
}
|
||||
|
||||
if ( generic != NULL ) {
|
||||
if (generic != NULL) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char *)generic))) {
|
||||
NSK_DISPLAY1(" Agent :: #error failed to Deallocate class signature = %s.", generic);
|
||||
nsk_jvmti_agentFailed();
|
||||
@ -110,18 +107,18 @@ JNIEXPORT void JNICALL callbackFieldAccess(jvmtiEnv *jvmti_env,
|
||||
|
||||
className = NULL;
|
||||
generic = NULL;
|
||||
if (redefineNumber != 0 ) {
|
||||
if (redefineNumber != 0) {
|
||||
return;
|
||||
}
|
||||
if ( ! NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(field_klass, &className, &generic)) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(field_klass, &className, &generic))) {
|
||||
NSK_DISPLAY0(" Agent :: Failed get class signature.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
if( (strcmp(className, CLASS_NAME) == 0 ) ) {
|
||||
if((strcmp(className, CLASS_NAME) == 0)) {
|
||||
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_TRUE) {
|
||||
NSK_DISPLAY0(" Agent :: Successfully redefined.\n");
|
||||
redefineNumber++;
|
||||
} else {
|
||||
@ -129,27 +126,27 @@ JNIEXPORT void JNICALL callbackFieldAccess(jvmtiEnv *jvmti_env,
|
||||
nsk_jvmti_agentFailed();
|
||||
}
|
||||
NSK_DISPLAY0(" Agent :: Before attempting thread suspend.\n");
|
||||
if ( ! NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info))) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->GetThreadInfo(thread, &info))) {
|
||||
NSK_DISPLAY0(" Agent :: error getting thread info ");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
NSK_DISPLAY1(" Agent :: Thread Name = %s .\n", info.name);
|
||||
}
|
||||
if ( ! NSK_JVMTI_VERIFY(jvmti_env->SuspendThread(thread))) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->SuspendThread(thread))) {
|
||||
NSK_DISPLAY0(" Agent :: Failed to suspend thread.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( className != NULL ) {
|
||||
if (className != NULL) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char *)className))) {
|
||||
NSK_DISPLAY1(" Agent :: #error failed to Deallocate className = %s.", className);
|
||||
nsk_jvmti_agentFailed();
|
||||
}
|
||||
}
|
||||
|
||||
if ( generic != NULL ) {
|
||||
if (generic != NULL) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->Deallocate((unsigned char *)generic))) {
|
||||
NSK_DISPLAY1(" Agent :: #error failed to Deallocate class signature = %s.", generic);
|
||||
nsk_jvmti_agentFailed();
|
||||
@ -169,7 +166,7 @@ JNIEXPORT jint JNI_OnLoad_hs204t003(JavaVM *jvm, char *options, void *reserved)
|
||||
}
|
||||
#endif
|
||||
jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
if ( ! NSK_VERIFY ( JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1) ) ) {
|
||||
if (!NSK_VERIFY (JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1))) {
|
||||
NSK_DISPLAY0("Agent :: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
@ -184,14 +181,14 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
caps.can_generate_field_access_events = 1;
|
||||
caps.can_pop_frame = 1;
|
||||
caps.can_suspend = 1;
|
||||
if ( ! NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps)) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->AddCapabilities(&caps))) {
|
||||
NSK_DISPLAY0(" Agent :: Failed add required capabilities\n.");
|
||||
return JNI_ERR;
|
||||
}
|
||||
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
|
||||
eventCallbacks.ClassPrepare = callbackClassPrepare;
|
||||
eventCallbacks.FieldAccess = callbackFieldAccess;
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks) ) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
|
||||
NSK_DISPLAY0(" Agent :: Error occured while setting event call back \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -207,26 +204,26 @@ Java_nsk_jvmti_scenarios_hotswap_HS204_hs204t003_hs204t003_popFrame(JNIEnv * jni
|
||||
jboolean retvalue;
|
||||
jint state;
|
||||
retvalue = JNI_FALSE;
|
||||
if (! NSK_JVMTI_VERIFY(jvmti->GetThreadState(thread, &state))) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->GetThreadState(thread, &state))) {
|
||||
NSK_DISPLAY0(" Agent :: Error getting thread state.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
if ( state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
if (state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
NSK_DISPLAY0(" Agent :: Thread state = JVMTI_THREAD_STATE_SUSPENDED.\n");
|
||||
if ( ! NSK_JVMTI_VERIFY ( jvmti->PopFrame(thread) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY (jvmti->PopFrame(thread))) {
|
||||
NSK_DISPLAY0("#error Agent :: Jvmti failed to do popFrame.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
if ( ! NSK_JVMTI_VERIFY ( jvmti->ResumeThread(thread) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY (jvmti->ResumeThread(thread))) {
|
||||
NSK_DISPLAY0(" Agent :: Error occured in resuming a thread.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
jfieldID fieldId = jni->GetStaticFieldID(watchFieldClass, FIELDNAME, TYPE);
|
||||
if ( ! NSK_JNI_VERIFY(jni, fieldId != NULL ) ) {
|
||||
if (!NSK_JNI_VERIFY(jni, fieldId != NULL)) {
|
||||
NSK_DISPLAY0(" Agent :: Failed to get FieldId before droping watchers.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
if ( ! NSK_JVMTI_VERIFY ( jvmti->ClearFieldAccessWatch(watchFieldClass, fieldId) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY (jvmti->ClearFieldAccessWatch(watchFieldClass, fieldId))) {
|
||||
NSK_DISPLAY0(" Agent :: failed to drop field watces.\n");
|
||||
nsk_jvmti_agentFailed();
|
||||
} else {
|
||||
|
@ -67,7 +67,7 @@ callbackClassLoad(jvmtiEnv *jvmti_env,
|
||||
if (err == JVMTI_ERROR_NONE) {
|
||||
nsk_printf("Agent:: NO ERRORS FOUND \n");
|
||||
err= jvmti->SetBreakpoint(method, start+1);
|
||||
if ( err == JVMTI_ERROR_NONE) {
|
||||
if (err == JVMTI_ERROR_NONE) {
|
||||
nsk_printf("Agent:: Breakpoint set \n");
|
||||
} else {
|
||||
nsk_printf("Agent:: ***ERROR OCCURED ... in SET BREAK POINT ERROR \n");
|
||||
@ -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_TRUE) {
|
||||
nsk_printf("\nMyClass :: Successfully redefined..\n");
|
||||
} else {
|
||||
nsk_printf("\nMyClass :: Failed to redefine ..\n");
|
||||
@ -108,9 +108,9 @@ void JNICALL callbackBreakpoint(jvmtiEnv *jvmti_env,
|
||||
nsk_printf("Agent:: Succeded in suspending..\n");
|
||||
} else if (err == JVMTI_ERROR_THREAD_SUSPENDED) {
|
||||
nsk_printf("Agent:: JVMTI_ERROR_THREAD_SUSPENDED \n");
|
||||
} else if ( err == JVMTI_ERROR_INVALID_THREAD) {
|
||||
} else if (err == JVMTI_ERROR_INVALID_THREAD) {
|
||||
nsk_printf("Agent:: JVMTI_ERROR_INVALID_THREAD \n");
|
||||
} else if ( err == JVMTI_ERROR_THREAD_NOT_ALIVE) {
|
||||
} else if (err == JVMTI_ERROR_THREAD_NOT_ALIVE) {
|
||||
nsk_printf("Agent:: JVMTI_ERROR_THREAD_NOT_ALIVE \n");
|
||||
} else {
|
||||
nsk_printf(" Else error ");
|
||||
@ -133,7 +133,7 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jint rc ;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
@ -174,10 +174,10 @@ Java_nsk_jvmti_scenarios_hotswap_HS204_hs204t004_hs204t004_popFrame(JNIEnv * jni
|
||||
nsk_printf("Agent:: POPING THE FRAME....\n");
|
||||
retvalue = JNI_FALSE;
|
||||
jvmti->GetThreadState(thread, &state);
|
||||
if ( state & JVMTI_THREAD_STATE_IN_NATIVE) nsk_printf("JVMTI_THREAD_STATE_IN_NATIVE");
|
||||
if ( state & JVMTI_THREAD_STATE_INTERRUPTED) nsk_printf( "JVMTI_THREAD_STATE_INTERRUPTED");
|
||||
if ( state & JVMTI_THREAD_STATE_WAITING) nsk_printf(" JVMTI_THREAD_STATE_WAITING");
|
||||
if ( state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
if (state & JVMTI_THREAD_STATE_IN_NATIVE) nsk_printf("JVMTI_THREAD_STATE_IN_NATIVE");
|
||||
if (state & JVMTI_THREAD_STATE_INTERRUPTED) nsk_printf("JVMTI_THREAD_STATE_INTERRUPTED");
|
||||
if (state & JVMTI_THREAD_STATE_WAITING) nsk_printf(" JVMTI_THREAD_STATE_WAITING");
|
||||
if (state & JVMTI_THREAD_STATE_SUSPENDED) {
|
||||
nsk_printf("Agent:: Thread state .. JVMTI_THREAD_STATE_SUSPENDED \n");
|
||||
err = jvmti->PopFrame(thread);
|
||||
if (err == JVMTI_ERROR_NONE) {
|
||||
|
@ -49,19 +49,19 @@ JNIEXPORT jint JNI_OnLoad_hs301t001(JavaVM *jvm, char *options, void *reserved)
|
||||
#endif
|
||||
jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf("Agent:: Agent_OnLoad .\n");
|
||||
if ( ! NSK_VERIFY ( JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1) ) ) {
|
||||
if (!NSK_VERIFY (JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1))) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface.\n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
caps.can_redefine_classes = 1;
|
||||
if (! NSK_JVMTI_VERIFY ( jvmti->AddCapabilities(&caps) )) {
|
||||
if (!NSK_JVMTI_VERIFY (jvmti->AddCapabilities(&caps))) {
|
||||
nsk_printf(" Agent:: Error occured while adding capabilities.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -84,13 +84,13 @@ Java_nsk_jvmti_scenarios_hotswap_HS301_hs301t001_hs301t001_redefine(JNIEnv * jni
|
||||
|
||||
redefineNumber=0;
|
||||
cls = jni->FindClass(SEARCH_NAME);
|
||||
if (! NSK_JNI_VERIFY(jni, cls != NULL) ) {
|
||||
if (!NSK_JNI_VERIFY(jni, cls != NULL)) {
|
||||
nsk_printf("Agent:: (*JNI)->FindClass(jni, %s) returns `null`.\n",SEARCH_NAME);
|
||||
return NSK_FALSE;
|
||||
}
|
||||
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_TRUE) {
|
||||
nsk_printf("Agent:: Redefine successful.\n");
|
||||
ret = JNI_TRUE;
|
||||
} else {
|
||||
|
@ -52,18 +52,18 @@ JNIEXPORT jint JNI_OnLoad_hs301t002(JavaVM *jvm, char *options, void *reserved)
|
||||
#endif
|
||||
jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
nsk_printf(" Agent:: VM Started.\n");
|
||||
if ( ! NSK_VERIFY ( JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1) ) ) {
|
||||
if (!NSK_VERIFY (JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1))) {
|
||||
nsk_printf(" Agent ::Agent failed to get jvmti env.\n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf(" Agent:: ## error agent Failed to parse options.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
caps.can_redefine_classes = 1;
|
||||
if ( ! NSK_JVMTI_VERIFY ( jvmti->AddCapabilities(&caps) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY (jvmti->AddCapabilities(&caps))) {
|
||||
nsk_printf(" Agent:: Error occured while adding capabilities.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
nsk_printf("Agent:: MyClass :: Successfully redefined.\n");
|
||||
ret = JNI_TRUE;
|
||||
} else {
|
||||
|
@ -36,16 +36,16 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
jclass klass) {
|
||||
char * className;
|
||||
char * generic;
|
||||
if ( ! NSK_JVMTI_VERIFY ( jvmti_env->GetClassSignature(klass, &className, &generic) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY (jvmti_env->GetClassSignature(klass, &className, &generic))) {
|
||||
nsk_printf(" Agent:: Error while getting ClassFileName Signature ");
|
||||
} else {
|
||||
if (strcmp(className, CLASS_NAME ) == 0) {
|
||||
if (strcmp(className, CLASS_NAME) == 0) {
|
||||
int redefineNumber =0;
|
||||
char fileName[512];
|
||||
nsk_jvmti_getFileName(redefineNumber, FILE_NAME,
|
||||
fileName, sizeof(fileName)/sizeof(char));
|
||||
nsk_jvmti_disableNotification(jvmti_env,
|
||||
JVMTI_EVENT_CLASS_LOAD, NULL );
|
||||
JVMTI_EVENT_CLASS_LOAD, NULL);
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName) == NSK_TRUE) {
|
||||
nsk_printf("\n Redefine successful.\n");
|
||||
} else {
|
||||
@ -69,20 +69,20 @@ JNIEXPORT jint JNI_OnLoad_hs301t003(JavaVM *jvm, char *options, void *reserved)
|
||||
jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jvmtiEnv * jvmti;
|
||||
nsk_printf("Agent:: Agent_OnLoad.\n");
|
||||
if ( ! NSK_VERIFY ( JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1) ) ) {
|
||||
if (!NSK_VERIFY (JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1))) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface.\n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
caps.can_redefine_classes = 1;
|
||||
caps.can_generate_all_class_hook_events=1;
|
||||
if (! NSK_JVMTI_VERIFY ( jvmti->AddCapabilities(&caps) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY (jvmti->AddCapabilities(&caps))) {
|
||||
nsk_printf(" Agent:: Error occured while adding capabilities.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
nsk_printf(" Agent:: Enabled notification.\n");
|
||||
} else {
|
||||
nsk_printf(" Agent:: Failed to enable notification.\n");
|
||||
|
@ -37,17 +37,17 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
char * className;
|
||||
char * generic;
|
||||
int redefineNumber=0;
|
||||
if (! NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &className, &generic)) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->GetClassSignature(klass, &className, &generic))) {
|
||||
nsk_printf(" Agent :: Error occured in getting class signature.\n");
|
||||
return;
|
||||
} else {
|
||||
if (strcmp(className, CLASS_NAME) == 0) {
|
||||
int redefineNumber =0;
|
||||
char fileName[512];
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL );
|
||||
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_TRUE) {
|
||||
nsk_printf("Agent:: Redefine successful.\n");
|
||||
} else {
|
||||
nsk_printf("Agent:: Redefine failed.\n");
|
||||
@ -70,30 +70,30 @@ JNIEXPORT jint JNI_OnLoad_hs301t004(JavaVM *jvm, char *options, void *reserved)
|
||||
jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jvmtiEnv * jvmti;
|
||||
nsk_printf("Agent:: VM Started.\n");
|
||||
if (! NSK_VERIFY ( JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1) ) ) {
|
||||
if (!NSK_VERIFY (JNI_OK == vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1))) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
caps.can_redefine_classes = 1;
|
||||
caps.can_generate_all_class_hook_events=1;
|
||||
if ( ! NSK_JVMTI_VERIFY (jvmti->AddCapabilities(&caps) )) {
|
||||
if (!NSK_JVMTI_VERIFY (jvmti->AddCapabilities(&caps))) {
|
||||
nsk_printf(" Agent:: Error occured while adding capabilities.\n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
memset(&eventCallbacks, 0, sizeof(eventCallbacks));
|
||||
eventCallbacks.ClassPrepare = &callbackClassPrepare;
|
||||
if ( ! NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)) ) ) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti->SetEventCallbacks(&eventCallbacks, sizeof(eventCallbacks)))) {
|
||||
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_TRUE) {
|
||||
nsk_printf(" Enabled notification.\n");
|
||||
} else {
|
||||
nsk_printf(" Failed to enable notifications.\n");
|
||||
|
@ -41,7 +41,7 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti,
|
||||
if (strcmp(className,CLASS_NAME) == 0) {
|
||||
int redefineNumber =0;
|
||||
char fileName[512];
|
||||
nsk_jvmti_disableNotification(jvmti, JVMTI_EVENT_CLASS_LOAD, NULL );
|
||||
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) {
|
||||
nsk_printf("\n Redefine successful ..\n");
|
||||
@ -67,13 +67,13 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jvmtiEnv * jvmti;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
@ -39,11 +39,11 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
char * generic;
|
||||
int redefineNumber=0;
|
||||
jvmti_env->GetClassSignature(klass, &className, &generic);
|
||||
if (strcmp(className,CLASS_NAME) == 0 ) {
|
||||
if (strcmp(className,CLASS_NAME) == 0) {
|
||||
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 ) {
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName) == NSK_TRUE) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -67,13 +67,13 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jvmtiEnv * jvmti;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
@ -42,9 +42,9 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
jvmti_env->GetClassSignature(klass, &className, &generic);
|
||||
if (strcmp(className,CLASS_NAME) == 0) {
|
||||
char fileName[512];
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL );
|
||||
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_TRUE) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("Redefine failed .. \n");
|
||||
@ -69,14 +69,14 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
|
||||
if ( nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -94,8 +94,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_PREPARE,
|
||||
NULL) == NSK_TRUE ) {
|
||||
if (nsk_jvmti_enableNotification(jvmti, JVMTI_EVENT_CLASS_PREPARE,
|
||||
NULL) == NSK_TRUE) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
@ -39,12 +39,12 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
char * generic;
|
||||
int redefineNumber=0;
|
||||
jvmti_env->GetClassSignature(klass, &className, &generic);
|
||||
if ( strcmp(className,CLASS_NAME) == 0 ) {
|
||||
if (strcmp(className,CLASS_NAME) == 0) {
|
||||
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 ) {
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass, fileName) == NSK_TRUE) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("Redefine failed .. \n");
|
||||
@ -70,14 +70,14 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
@ -42,8 +42,8 @@ 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 ) {
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL);
|
||||
if (nsk_jvmti_redefineClass(jvmti_env, klass,fileName) == NSK_TRUE) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -67,13 +67,13 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jvmtiEnv * jvmti;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
@ -42,10 +42,10 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
jvmti_env->GetClassSignature(klass, &className, &generic);
|
||||
if (strcmp(className,CLASS_NAME) == 0) {
|
||||
char fileName[512];
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL );
|
||||
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_TRUE) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -69,13 +69,13 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jvmtiEnv * jvmti;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
@ -41,10 +41,10 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
jvmti_env->GetClassSignature(klass, &className, &generic);
|
||||
if (strcmp(className,CLASS_NAME) == 0) {
|
||||
char fileName[512];
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL );
|
||||
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_TRUE) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -68,13 +68,13 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jvmtiEnv * jvmti;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
@ -38,10 +38,10 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
jvmti_env->GetClassSignature(klass, &className, &generic);
|
||||
if (strcmp(className,CLASS_NAME) == 0) {
|
||||
char fileName[512];
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL );
|
||||
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_TRUE) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -65,13 +65,13 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jvmtiEnv * jvmti;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
@ -41,10 +41,10 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
jvmti_env->GetClassSignature(klass, &className, &generic);
|
||||
if (strcmp(className,CLASS_NAME) == 0) {
|
||||
char fileName[512];
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL );
|
||||
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_TRUE) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -68,13 +68,13 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jvmtiEnv * jvmti;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
@ -42,10 +42,10 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
if (strcmp(className,CLASS_NAME) == 0) {
|
||||
|
||||
char fileName[512];
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL );
|
||||
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_TRUE) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -68,13 +68,13 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jvmtiEnv * jvmti;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
@ -41,10 +41,10 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
jvmti_env->GetClassSignature(klass, &className, &generic);
|
||||
if (strcmp(className,CLASS_NAME) == 0) {
|
||||
char fileName[512];
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL );
|
||||
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_TRUE) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -67,13 +67,13 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jvmtiEnv * jvmti;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
@ -41,10 +41,10 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
jvmti_env->GetClassSignature(klass, &className, &generic);
|
||||
if (strcmp(className,CLASS_NAME) == 0) {
|
||||
char fileName[512];
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL );
|
||||
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_TRUE) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -68,13 +68,13 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jvmtiEnv * jvmti;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
@ -43,10 +43,10 @@ void JNICALL callbackClassPrepare(jvmtiEnv *jvmti_env,
|
||||
jvmti_env->GetClassSignature(klass, &className, &generic);
|
||||
if (strcmp(className,CLASS_NAME) == 0) {
|
||||
char fileName[512];
|
||||
nsk_jvmti_disableNotification(jvmti_env, JVMTI_EVENT_CLASS_PREPARE, NULL );
|
||||
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_TRUE) {
|
||||
nsk_printf("Redefine successful ..\n");
|
||||
} else {
|
||||
nsk_printf("# error :: Redefine failed..\n");
|
||||
@ -70,13 +70,13 @@ jint Agent_Initialize(JavaVM *vm, char *options, void *reserved) {
|
||||
jint rc ;
|
||||
nsk_printf("Agent:: VM.. Started..\n");
|
||||
rc=vm->GetEnv((void **)&jvmti, JVMTI_VERSION_1_1);
|
||||
if ( rc!= JNI_OK ) {
|
||||
if (rc!= JNI_OK) {
|
||||
nsk_printf("Agent:: Could not load JVMTI interface \n");
|
||||
return JNI_ERR;
|
||||
} else {
|
||||
jvmtiCapabilities caps;
|
||||
jvmtiEventCallbacks eventCallbacks;
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE ) {
|
||||
if (nsk_jvmti_parseOptions(options) == NSK_FALSE) {
|
||||
nsk_printf("# error agent Failed to parse options \n");
|
||||
return JNI_ERR;
|
||||
}
|
||||
@ -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_TRUE) {
|
||||
nsk_printf(" Enabled. noftification..");
|
||||
} else {
|
||||
nsk_printf(" Failed to Enable ..");
|
||||
|
@ -327,7 +327,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 == NSK_TRUE) && (frameStack[j].location != qLocation)) {
|
||||
NSK_COMPLAIN6("Different location in stack frame #%d for %s thread #%d (%s):\n"
|
||||
"# GetStackTrace(): %ld\n"
|
||||
"# GetFrameLocation(): %ld\n",
|
||||
|
@ -681,7 +681,7 @@ jint JNICALL primitiveFieldCallback(
|
||||
ref_kind_str[reference_kind],
|
||||
(long) class_tag,
|
||||
(long) DEREF(tag_ptr),
|
||||
(int ) value_type);
|
||||
(int) value_type);
|
||||
fflush(0);
|
||||
return 0;
|
||||
} /* primitiveFieldCallback */
|
||||
@ -700,8 +700,8 @@ jint JNICALL arrayPrimitiveValueCallback(
|
||||
" tag=%-3ld, len=%d, type=%c\n",
|
||||
(long) class_tag,
|
||||
(long) DEREF(tag_ptr),
|
||||
(int ) element_count,
|
||||
(int ) element_type);
|
||||
(int) element_count,
|
||||
(int) element_type);
|
||||
fflush(0);
|
||||
return 0;
|
||||
} /* arrayPrimitiveValueCallback */
|
||||
@ -718,7 +718,7 @@ jint JNICALL stringPrimitiveValueCallback(
|
||||
printf("stringPrimitiveValueCallback: class_tag=%-3ld, tag=%-3ld, len=%d\n",
|
||||
(long) class_tag,
|
||||
(long) DEREF(tag_ptr),
|
||||
(int ) value_length);
|
||||
(int) value_length);
|
||||
fflush(0);
|
||||
return 0;
|
||||
} /* stringPrimitiveValueCallback */
|
||||
|
@ -457,7 +457,7 @@ jint JNICALL heapReferenceCallback(
|
||||
(long) tag,
|
||||
(long) size,
|
||||
(long) ref_tag,
|
||||
(int ) referrer_index);
|
||||
(int) referrer_index);
|
||||
fflush(0);
|
||||
|
||||
if (tag_ptr == NULL) {
|
||||
@ -557,7 +557,7 @@ jint JNICALL primitiveFieldCallback(
|
||||
ref_kind_str[reference_kind],
|
||||
(long) class_tag,
|
||||
(long) DEREF(tag_ptr),
|
||||
(int ) value_type);
|
||||
(int) value_type);
|
||||
fflush(0);
|
||||
return 0;
|
||||
}
|
||||
@ -574,8 +574,8 @@ jint JNICALL arrayPrimitiveValueCallback(
|
||||
printf(" arrayPrimitiveValueCallback: class_tag=%-3ld, tag=%-3ld, len=%d, type=%c\n",
|
||||
(long) class_tag,
|
||||
(long) DEREF(tag_ptr),
|
||||
(int ) element_count,
|
||||
(int ) element_type);
|
||||
(int) element_count,
|
||||
(int) element_type);
|
||||
fflush(0);
|
||||
return 0;
|
||||
}
|
||||
@ -591,7 +591,7 @@ jint JNICALL stringPrimitiveValueCallback(
|
||||
printf("stringPrimitiveValueCallback: class_tag=%-3ld, tag=%-3ld, len=%d\n",
|
||||
(long) class_tag,
|
||||
(long) DEREF(tag_ptr),
|
||||
(int ) value_length);
|
||||
(int) value_length);
|
||||
fflush(0);
|
||||
return 0;
|
||||
}
|
||||
|
@ -661,13 +661,13 @@ jint JNICALL heapReferenceCallback(
|
||||
(long) class_tag,
|
||||
(long) tag,
|
||||
(long) size,
|
||||
(int ) length,
|
||||
(int) length,
|
||||
ref_tag,
|
||||
(long) thr_tag,
|
||||
thr_id,
|
||||
method,
|
||||
(long) location,
|
||||
(int ) index);
|
||||
(int) index);
|
||||
fflush(0);
|
||||
|
||||
if (tag_ptr == NULL) {
|
||||
@ -842,7 +842,7 @@ jint JNICALL primitiveFieldCallback
|
||||
ref_kind_str[ref_kind],
|
||||
(long) class_tag,
|
||||
(long) DEREF(tag_ptr),
|
||||
(int ) value_type);
|
||||
(int) value_type);
|
||||
fflush(0);
|
||||
return 0;
|
||||
}
|
||||
@ -854,8 +854,8 @@ jint JNICALL arrayPrimitiveValueCallback
|
||||
printf(" arrayPrimitiveValueCallback: class_tag=%-3ld, tag=%-3ld, len=%d, type=%c\n",
|
||||
(long) class_tag,
|
||||
(long) DEREF(tag_ptr),
|
||||
(int ) element_count,
|
||||
(int ) element_type);
|
||||
(int) element_count,
|
||||
(int) element_type);
|
||||
fflush(0);
|
||||
return 0;
|
||||
}
|
||||
@ -867,7 +867,7 @@ jint JNICALL stringPrimitiveValueCallback
|
||||
printf("stringPrimitiveValueCallback: class_tag=%-3ld, tag=%-3ld, len=%d\n",
|
||||
(long) class_tag,
|
||||
(long) DEREF(tag_ptr),
|
||||
(int ) value_length);
|
||||
(int) value_length);
|
||||
fflush(0);
|
||||
return 0;
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ jint JNICALL primitiveFieldCallback(
|
||||
g_refKindStr[reference_kind],
|
||||
(long) class_tag,
|
||||
(long) DEREF(tag_ptr),
|
||||
(int ) value_type);
|
||||
(int) value_type);
|
||||
|
||||
fflush(0);
|
||||
|
||||
@ -109,8 +109,8 @@ jint JNICALL arrayPrimitiveValueCallback(
|
||||
printf(" arrayPrimitiveValueCallback: class_tag=%-3ld, tag=%-3ld, len=%d, type=%c\n",
|
||||
(long) class_tag,
|
||||
(long) DEREF(tag_ptr),
|
||||
(int ) element_count,
|
||||
(int ) element_type);
|
||||
(int) element_count,
|
||||
(int) element_type);
|
||||
fflush(0);
|
||||
|
||||
markTagVisited(DEREF(tag_ptr));
|
||||
@ -131,7 +131,7 @@ jint JNICALL stringPrimitiveValueCallback(
|
||||
printf("stringPrimitiveValueCallback: class_tag=%-3ld, tag=%-3ld, len=%d\n",
|
||||
(long) class_tag,
|
||||
(long) DEREF(tag_ptr),
|
||||
(int ) value_length);
|
||||
(int) value_length);
|
||||
fflush(0);
|
||||
|
||||
markTagVisited(DEREF(tag_ptr));
|
||||
@ -146,16 +146,16 @@ static void createGlobalRefs(JNIEnv * jni)
|
||||
{
|
||||
jclass klass;
|
||||
|
||||
if ( ! NSK_JNI_VERIFY(jni, (klass = jni->FindClass(JAVA_LANG_STRING_CLASS_NAME)) != NULL) ) {
|
||||
if (!NSK_JNI_VERIFY(jni, (klass = jni->FindClass(JAVA_LANG_STRING_CLASS_NAME)) != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
return;
|
||||
}
|
||||
|
||||
if ( ! NSK_JNI_VERIFY(jni, (g_jniGlobalRef = jni->NewGlobalRef(klass)) != NULL) ) {
|
||||
if (!NSK_JNI_VERIFY(jni, (g_jniGlobalRef = jni->NewGlobalRef(klass)) != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
if ( ! NSK_JNI_VERIFY(jni, (g_jniWeakGlobalRef = jni->NewWeakGlobalRef(klass)) != NULL) ) {
|
||||
if (!NSK_JNI_VERIFY(jni, (g_jniWeakGlobalRef = jni->NewWeakGlobalRef(klass)) != NULL)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
@ -185,7 +185,7 @@ static void JNICALL agentProc(jvmtiEnv* jvmti, JNIEnv* jni, void* arg)
|
||||
&g_heapCallbacks,
|
||||
(const void *) &g_fakeUserData);
|
||||
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_NONE) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_NONE)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
|
@ -51,7 +51,7 @@ agentProc(jvmtiEnv* jvmti, JNIEnv* jni, void* arg) {
|
||||
&g_wrongHeapCallbacks,
|
||||
(const void *) &g_fakeUserData);
|
||||
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY ) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY)) {
|
||||
NSK_COMPLAIN1("FollowReferences() returned %i", retCode);
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
@ -61,28 +61,28 @@ agentProc(jvmtiEnv* jvmti, JNIEnv* jni, void* arg) {
|
||||
&g_wrongHeapCallbacks,
|
||||
(const void *) &g_fakeUserData);
|
||||
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY ) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY)) {
|
||||
NSK_COMPLAIN1("IterateThroughHeap() returned %i", retCode);
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
retCode = jvmti->GetTag((jobject) &g_wrongHeapCallbacks, &tag);
|
||||
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY ) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY)) {
|
||||
NSK_COMPLAIN1("GetTag() returned %i", retCode);
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
retCode = jvmti->SetTag((jobject) &g_wrongHeapCallbacks, tag);
|
||||
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY ) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY)) {
|
||||
NSK_COMPLAIN1("SetTag() returned %i", retCode);
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
retCode = jvmti->GetObjectsWithTags(1, &tag, &cnt, &pObjs, &pObjTags);
|
||||
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY ) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_MUST_POSSESS_CAPABILITY)) {
|
||||
NSK_COMPLAIN1("GetObjectsWithTags() returned %i", retCode);
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ static void verifyReturnCodes(JNIEnv* jni, jvmtiEnv* jvmti)
|
||||
&g_wrongHeapCallbacks,
|
||||
(const void *) &g_fakeUserData);
|
||||
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_CLASS ) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_CLASS)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ static void verifyReturnCodes(JNIEnv* jni, jvmtiEnv* jvmti)
|
||||
(const void *) &g_fakeUserData);
|
||||
|
||||
// Accept both JVMTI_ERROR_INVALID_OBJECT and JVMTI_ERROR_NONE
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_OBJECT || retCode == JVMTI_ERROR_NONE ) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_OBJECT || retCode == JVMTI_ERROR_NONE)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ static void verifyReturnCodes(JNIEnv* jni, jvmtiEnv* jvmti)
|
||||
NULL,
|
||||
(const void *) &g_fakeUserData);
|
||||
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_NULL_POINTER ) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_NULL_POINTER)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
@ -101,7 +101,7 @@ static void verifyReturnCodes(JNIEnv* jni, jvmtiEnv* jvmti)
|
||||
retCode = jvmti->GetTag((jobject) &g_wrongHeapCallbacks, /* invalid inital object */
|
||||
&tag);
|
||||
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_OBJECT ) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_OBJECT)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
@ -109,7 +109,7 @@ static void verifyReturnCodes(JNIEnv* jni, jvmtiEnv* jvmti)
|
||||
|
||||
retCode = jvmti->GetTag(NULL, &tag);
|
||||
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_OBJECT ) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_OBJECT)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
@ -117,7 +117,7 @@ static void verifyReturnCodes(JNIEnv* jni, jvmtiEnv* jvmti)
|
||||
|
||||
retCode = jvmti->GetTag((jobject) &g_wrongHeapCallbacks, NULL);
|
||||
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_NULL_POINTER ) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_NULL_POINTER)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
@ -127,7 +127,7 @@ static void verifyReturnCodes(JNIEnv* jni, jvmtiEnv* jvmti)
|
||||
retCode = jvmti->SetTag((jobject) &g_wrongHeapCallbacks, /* invalid inital object */
|
||||
tag);
|
||||
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_OBJECT ) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_OBJECT)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ static void verifyReturnCodes(JNIEnv* jni, jvmtiEnv* jvmti)
|
||||
|
||||
retCode = jvmti->GetTag(NULL, &tag);
|
||||
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_OBJECT ) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_INVALID_OBJECT)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
@ -162,7 +162,7 @@ static void checkNoObjIterated(JNIEnv* jni, jvmtiEnv* jvmti, const char * szClas
|
||||
&g_wrongHeapCallbacks,
|
||||
(const void *) &g_fakeUserData);
|
||||
|
||||
if ( ! NSK_VERIFY(retCode == JVMTI_ERROR_NONE ) ) {
|
||||
if (!NSK_VERIFY(retCode == JVMTI_ERROR_NONE)) {
|
||||
nsk_jvmti_setFailStatus();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user