73 NSK_DISPLAY1("Find debugee class: %s\n", debugeeClassSignature);
74 debugeeClass = nsk_jvmti_classBySignature(debugeeClassSignature);
75 if (debugeeClass == NULL) {
76 nsk_jvmti_setFailStatus();
77 break;
78 }
79
80 NSK_DISPLAY0("Calling IterateOverInstancesOfClass with filter JVMTI_HEAP_OBJECT_EITHER\n");
81 {
82 if (!NSK_JVMTI_VERIFY(
83 jvmti->IterateOverInstancesOfClass(debugeeClass,
84 JVMTI_HEAP_OBJECT_EITHER,
85 heapObjectCallback,
86 (void *) storage_data))) {
87 nsk_jvmti_setFailStatus();
88 }
89 }
90
91 if (storage_data != storage_ptr) {
92 NSK_COMPLAIN2("Local storage address was corrupted: %p ,\n\texpected value: %p\n",
93 storage_ptr, storage_data);
94 nsk_jvmti_setFailStatus();
95 }
96
97 if (strcmp(storage_data, (char *)storage_ptr) != 0) {
98 NSK_COMPLAIN2("Local storage was corrupted: %s ,\n\texpected value: %s\n",
99 (char *)storage_ptr, storage_data );
100 nsk_jvmti_setFailStatus();
101 }
102 } while (0);
103
104 NSK_DISPLAY0("Let debugee to finish\n");
105 if (!NSK_VERIFY(nsk_jvmti_resumeSync()))
106 return;
107 }
108
109 /* ============================================================================= */
110
111 /** Agent library initialization. */
112 #ifdef STATIC_BUILD
113 JNIEXPORT jint JNICALL Agent_OnLoad_iterinstcls006(JavaVM *jvm, char *options, void *reserved) {
114 return Agent_Initialize(jvm, options, reserved);
115 }
116 JNIEXPORT jint JNICALL Agent_OnAttach_iterinstcls006(JavaVM *jvm, char *options, void *reserved) {
117 return Agent_Initialize(jvm, options, reserved);
118 }
119 JNIEXPORT jint JNI_OnLoad_iterinstcls006(JavaVM *jvm, char *options, void *reserved) {
|
73 NSK_DISPLAY1("Find debugee class: %s\n", debugeeClassSignature);
74 debugeeClass = nsk_jvmti_classBySignature(debugeeClassSignature);
75 if (debugeeClass == NULL) {
76 nsk_jvmti_setFailStatus();
77 break;
78 }
79
80 NSK_DISPLAY0("Calling IterateOverInstancesOfClass with filter JVMTI_HEAP_OBJECT_EITHER\n");
81 {
82 if (!NSK_JVMTI_VERIFY(
83 jvmti->IterateOverInstancesOfClass(debugeeClass,
84 JVMTI_HEAP_OBJECT_EITHER,
85 heapObjectCallback,
86 (void *) storage_data))) {
87 nsk_jvmti_setFailStatus();
88 }
89 }
90
91 if (storage_data != storage_ptr) {
92 NSK_COMPLAIN2("Local storage address was corrupted: %p ,\n\texpected value: %p\n",
93 storage_ptr, storage_data);
94 nsk_jvmti_setFailStatus();
95 }
96
97 if (strcmp(storage_data, (char *)storage_ptr) != 0) {
98 NSK_COMPLAIN2("Local storage was corrupted: %s ,\n\texpected value: %s\n",
99 (char *)storage_ptr, storage_data);
100 nsk_jvmti_setFailStatus();
101 }
102 } while (0);
103
104 NSK_DISPLAY0("Let debugee to finish\n");
105 if (!NSK_VERIFY(nsk_jvmti_resumeSync()))
106 return;
107 }
108
109 /* ============================================================================= */
110
111 /** Agent library initialization. */
112 #ifdef STATIC_BUILD
113 JNIEXPORT jint JNICALL Agent_OnLoad_iterinstcls006(JavaVM *jvm, char *options, void *reserved) {
114 return Agent_Initialize(jvm, options, reserved);
115 }
116 JNIEXPORT jint JNICALL Agent_OnAttach_iterinstcls006(JavaVM *jvm, char *options, void *reserved) {
117 return Agent_Initialize(jvm, options, reserved);
118 }
119 JNIEXPORT jint JNI_OnLoad_iterinstcls006(JavaVM *jvm, char *options, void *reserved) {
|