8212771: Remove remaining spaces before/after () for vmTestbase
Remove spaces around () Reviewed-by: phh, sspitsyn
This commit is contained in:
parent
c2bc749866
commit
db6696837e
@ -29,12 +29,12 @@
|
||||
extern "C" {
|
||||
|
||||
|
||||
#define JVMTI_ERROR_CHECK(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define THREADS_LIMIT 2000
|
||||
|
||||
|
@ -32,12 +32,12 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define JVMTI_ERROR_CHECK(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define THREADS_LIMIT 2000
|
||||
|
||||
|
@ -130,7 +130,7 @@ Java_nsk_jvmti_unit_clsldrclss00x_check(JNIEnv *env, jclass appCls, jclass objCl
|
||||
found = JNI_FALSE;
|
||||
for (i = 0; i < classCount; ++i) {
|
||||
jclass k = classes[i];
|
||||
if ( env->IsSameObject(k, appCls) ) {
|
||||
if (env->IsSameObject(k, appCls)) {
|
||||
if (printdump) {
|
||||
printf(">>> found app class in app class loader\n");
|
||||
}
|
||||
@ -154,7 +154,7 @@ Java_nsk_jvmti_unit_clsldrclss00x_check(JNIEnv *env, jclass appCls, jclass objCl
|
||||
found = JNI_FALSE;
|
||||
for (i = 0; i < classCount; ++i) {
|
||||
jclass k = classes[i];
|
||||
if ( env->IsSameObject(k, objCls) ) {
|
||||
if (env->IsSameObject(k, objCls)) {
|
||||
if (printdump) {
|
||||
printf(">>> found Object class in bootstrap class loader\n");
|
||||
}
|
||||
|
@ -29,12 +29,12 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define JVMTI_ERROR_CHECK(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
static jvmtiEnv *jvmti;
|
||||
static jint iGlobalStatus = 0;
|
||||
|
@ -29,12 +29,12 @@
|
||||
extern "C" {
|
||||
|
||||
|
||||
#define JVMTI_ERROR_CHECK(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf(" %d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf(" %d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf(" %d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf(" %d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if ( res != err) { printf(str); printf(" unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if (res != err) { printf(str); printf(" unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
|
||||
|
||||
|
@ -29,8 +29,8 @@
|
||||
extern "C" {
|
||||
|
||||
|
||||
#define JVMTI_ERROR_CHECK(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define THREADS_LIMIT 8
|
||||
|
||||
|
@ -29,12 +29,12 @@
|
||||
extern "C" {
|
||||
|
||||
|
||||
#define JVMTI_ERROR_CHECK(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
|
||||
|
||||
|
@ -29,12 +29,12 @@
|
||||
extern "C" {
|
||||
|
||||
|
||||
#define JVMTI_ERROR_CHECK(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define THREADS_LIMIT 2000
|
||||
|
||||
|
@ -28,12 +28,12 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define JVMTI_ERROR_CHECK(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define THREADS_LIMIT 2000
|
||||
|
||||
|
@ -51,12 +51,12 @@
|
||||
extern "C" {
|
||||
|
||||
|
||||
#define JVMTI_ERROR_CHECK(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf(" %d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if ( res != err) { printf(str); printf(" unexpected error %d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf(" %d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if (res != err) { printf(str); printf(" unexpected error %d\n",res); return res;}
|
||||
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf(" %d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf(" %d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if ( res != err) { printf(str); printf(" unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if (res != err) { printf(str); printf(" unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define THREADS_LIMIT 8
|
||||
|
||||
|
@ -38,12 +38,12 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define JVMTI_ERROR_CHECK(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); return res;}
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); return res;}
|
||||
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if ( res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_VOID(str,res) if (res != JVMTI_ERROR_NONE) { printf(str); printf("%d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if ( res != err) { printf(str); printf("unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
#define JVMTI_ERROR_CHECK_EXPECTED_ERROR_VOID(str,res,err) if (res != err) { printf(str); printf("unexpected error %d\n",res); iGlobalStatus = 2; }
|
||||
|
||||
jvmtiEnv *jvmti;
|
||||
jint iGlobalStatus = 0;
|
||||
|
@ -41,11 +41,11 @@
|
||||
|
||||
extern "C" {
|
||||
|
||||
#define JVMTI_ERROR_CHECK_DURING_ONLOAD(str,res) if ( res != JVMTI_ERROR_NONE) { printf("Fatal error: %s - %d\n", str, res); return JNI_ERR; }
|
||||
#define JVMTI_ERROR_CHECK_DURING_ONLOAD(str,res) if (res != JVMTI_ERROR_NONE) { printf("Fatal error: %s - %d\n", str, res); return JNI_ERR; }
|
||||
|
||||
#define JVMTI_ERROR_CHECK_RETURN(str,res) if ( res != JVMTI_ERROR_NONE) { printf("Error: %s - %d\n", str, res); return; }
|
||||
#define JVMTI_ERROR_CHECK_RETURN(str,res) if (res != JVMTI_ERROR_NONE) { printf("Error: %s - %d\n", str, res); return; }
|
||||
|
||||
#define JVMTI_ERROR_CHECK(str,res) if ( res != JVMTI_ERROR_NONE) { printf("Error: %s - %d\n", str, res); }
|
||||
#define JVMTI_ERROR_CHECK(str,res) if (res != JVMTI_ERROR_NONE) { printf("Error: %s - %d\n", str, res); }
|
||||
|
||||
#define THREADS_LIMIT 200
|
||||
|
||||
|
@ -161,18 +161,18 @@ jthread nsk_jvmti_aod_createThread(JNIEnv *jni) {
|
||||
jmethodID threadConstructor;
|
||||
jthread thread;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (klass = jni->FindClass("java/lang/Thread")) != NULL )) {
|
||||
if (!NSK_JNI_VERIFY(jni, (klass = jni->FindClass("java/lang/Thread")) != NULL)) {
|
||||
NSK_COMPLAIN0("Failed to get the java.lang.Thread class\n");
|
||||
return NULL;
|
||||
}
|
||||
if (!NSK_JNI_VERIFY(jni,
|
||||
(threadConstructor = jni->GetMethodID(klass, "<init>", "()V") ) != NULL )) {
|
||||
(threadConstructor = jni->GetMethodID(klass, "<init>", "()V")) != NULL)) {
|
||||
NSK_COMPLAIN0("Failed to get java.lang.Thread constructor\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!NSK_JNI_VERIFY (jni,
|
||||
(thread = jni->NewObject(klass, threadConstructor, NULL)) != NULL ) ) {
|
||||
(thread = jni->NewObject(klass, threadConstructor, NULL)) != NULL)) {
|
||||
NSK_COMPLAIN0("Failed to create Thread object\n");
|
||||
return NULL;
|
||||
}
|
||||
@ -194,18 +194,18 @@ jthread nsk_jvmti_aod_createThreadWithName(JNIEnv *jni, const char* threadName)
|
||||
if (!NSK_JNI_VERIFY(jni, (threadNameString = jni->NewStringUTF(threadName)) != NULL))
|
||||
return NULL;
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni, (klass = jni->FindClass("java/lang/Thread")) != NULL )) {
|
||||
if (!NSK_JNI_VERIFY(jni, (klass = jni->FindClass("java/lang/Thread")) != NULL)) {
|
||||
NSK_COMPLAIN0("Failed to get the java.lang.Thread class\n");
|
||||
return NULL;
|
||||
}
|
||||
if (!NSK_JNI_VERIFY(jni,
|
||||
(threadConstructor = jni->GetMethodID(klass, "<init>", "(Ljava/lang/String;)V") ) != NULL )) {
|
||||
(threadConstructor = jni->GetMethodID(klass, "<init>", "(Ljava/lang/String;)V")) != NULL)) {
|
||||
NSK_COMPLAIN0("Failed to get java.lang.Thread constructor\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!NSK_JNI_VERIFY(jni,
|
||||
(thread = jni->NewObject(klass, threadConstructor, threadNameString)) != NULL ) ) {
|
||||
(thread = jni->NewObject(klass, threadConstructor, threadNameString)) != NULL)) {
|
||||
NSK_COMPLAIN0("Failed to create Thread object\n");
|
||||
return NULL;
|
||||
}
|
||||
@ -250,7 +250,7 @@ int nsk_jvmti_aod_redefineClass(
|
||||
|
||||
bytecode = fopen(file, "rb");
|
||||
error= JVMTI_ERROR_NONE;
|
||||
if ( bytecode == NULL ) {
|
||||
if (bytecode == NULL) {
|
||||
NSK_COMPLAIN1("Error opening file '%s'\n", file);
|
||||
return NSK_FALSE;
|
||||
}
|
||||
@ -261,12 +261,12 @@ int nsk_jvmti_aod_redefineClass(
|
||||
NSK_DISPLAY1("File size= %ld\n", ftell(bytecode));
|
||||
rewind(bytecode);
|
||||
error = jvmti->Allocate(size, &classBytes);
|
||||
if ( error != JVMTI_ERROR_NONE) {
|
||||
if (error != JVMTI_ERROR_NONE) {
|
||||
NSK_DISPLAY1("Failed to create memory %s\n", TranslateError(error));
|
||||
return NSK_FALSE;
|
||||
}
|
||||
|
||||
if ( ((jint) fread( classBytes, 1, size, bytecode )) != size ) {
|
||||
if (((jint) fread(classBytes, 1, size, bytecode)) != size) {
|
||||
NSK_COMPLAIN0("Failed to read all the bytes, could be less or more\n");
|
||||
fclose(bytecode);
|
||||
return NSK_FALSE;
|
||||
@ -281,9 +281,9 @@ int nsk_jvmti_aod_redefineClass(
|
||||
classDef.class_bytes = classBytes;
|
||||
NSK_DISPLAY0("Redefining\n");
|
||||
error = jvmti->RedefineClasses(1, &classDef);
|
||||
if ( error != JVMTI_ERROR_NONE ) {
|
||||
if (error != JVMTI_ERROR_NONE) {
|
||||
NSK_DISPLAY1("# error occured while redefining %s ",
|
||||
TranslateError(error) );
|
||||
TranslateError(error));
|
||||
return NSK_FALSE;
|
||||
}
|
||||
}
|
||||
|
@ -69,13 +69,13 @@ int g_tagVisitCount[MAX_TAG];
|
||||
|
||||
void markTagSet(jlong tag_val)
|
||||
{
|
||||
if ( tag_val > 0 && tag_val < MAX_TAG )
|
||||
if (tag_val > 0 && tag_val < MAX_TAG)
|
||||
g_tagFlags[tag_val] |= FLAG_TAG_SET;
|
||||
}
|
||||
|
||||
void markTagVisited(jlong tag_val)
|
||||
{
|
||||
if ( tag_val > 0 && tag_val < MAX_TAG ) {
|
||||
if (tag_val > 0 && tag_val < MAX_TAG) {
|
||||
g_tagVisitCount[tag_val]++;
|
||||
}
|
||||
}
|
||||
@ -87,11 +87,11 @@ jboolean checkThatAllTagsVisited()
|
||||
|
||||
NSK_DISPLAY0("Checking that all set tags have been visited\n");
|
||||
|
||||
for ( i = 1; i < MAX_TAG; i++ ) {
|
||||
for (i = 1; i < MAX_TAG; i++) {
|
||||
char flags = g_tagFlags[i];
|
||||
|
||||
if ( (g_tagFlags[i] & FLAG_TAG_SET) ) {
|
||||
if ( g_tagVisitCount[i] == 0 ) {
|
||||
if ((g_tagFlags[i] & FLAG_TAG_SET)) {
|
||||
if (g_tagVisitCount[i] == 0) {
|
||||
NSK_COMPLAIN1("Tag %" LL "d has not been visited: %x\n", i);
|
||||
ok = JNI_FALSE;
|
||||
}
|
||||
@ -115,28 +115,28 @@ JNIEXPORT jboolean JNICALL Java_nsk_jvmti_unit_FollowReferences_FollowRefObjects
|
||||
jvmtiEnv * jvmti = nsk_jvmti_getAgentJVMTIEnv();
|
||||
jint hashCode;
|
||||
|
||||
if ( ! NSK_VERIFY(jvmti->SetTag(o, tag) == JVMTI_ERROR_NONE) ) {
|
||||
if (!NSK_VERIFY(jvmti->SetTag(o, tag) == JVMTI_ERROR_NONE)) {
|
||||
NSK_COMPLAIN2("Can't set tag %li for object %lx\n", tag, o);
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
if ( ! NSK_VERIFY(jvmti->GetObjectHashCode(o, &hashCode) == JVMTI_ERROR_NONE) ) {
|
||||
if (!NSK_VERIFY(jvmti->GetObjectHashCode(o, &hashCode) == JVMTI_ERROR_NONE)) {
|
||||
NSK_COMPLAIN1("Can't get hash object %lx\n", o);
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
NSK_DISPLAY2("setTag: %08x <- % 3li", hashCode, tag);
|
||||
|
||||
if ( tag > 0 && tag < MAX_TAG ) {
|
||||
if (tag > 0 && tag < MAX_TAG) {
|
||||
jboolean fCopy;
|
||||
const char * s;
|
||||
|
||||
if ( ! NSK_VERIFY((s = jni->GetStringUTFChars(sInfo, &fCopy)) != NULL) ) {
|
||||
if (!NSK_VERIFY((s = jni->GetStringUTFChars(sInfo, &fCopy)) != NULL)) {
|
||||
NSK_COMPLAIN1("Can't get string at %#p\n", sInfo);
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
if ( ! s ) {
|
||||
if (!s) {
|
||||
NSK_COMPLAIN1("Can't get string at %#p: NULL\n", sInfo);
|
||||
return JNI_FALSE;
|
||||
}
|
||||
@ -160,7 +160,7 @@ JNIEXPORT jlong JNICALL Java_nsk_jvmti_unit_FollowReferences_FollowRefObjects_ge
|
||||
|
||||
jlong tag;
|
||||
jvmtiError r;
|
||||
if ( ! NSK_VERIFY((r = jvmti->GetTag(o, &tag)) == JVMTI_ERROR_NONE) ) {
|
||||
if (!NSK_VERIFY((r = jvmti->GetTag(o, &tag)) == JVMTI_ERROR_NONE)) {
|
||||
NSK_COMPLAIN2("Can't GetTag for object %lx. Return code: %i\n", o, r);
|
||||
return -1;
|
||||
}
|
||||
@ -186,9 +186,9 @@ static RefToVerify * findRefToVerify(jlong tagFrom, jlong tagTo, jint refKind)
|
||||
int i;
|
||||
RefToVerify * pRefRec = g_refsToVerify;
|
||||
|
||||
for ( i = g_refsToVerifyCnt; i > 0; i--, pRefRec++ ) {
|
||||
for (i = g_refsToVerifyCnt; i > 0; i--, pRefRec++) {
|
||||
pRefRec = &g_refsToVerify[i];
|
||||
if ( pRefRec->_tagFrom == tagFrom && pRefRec->_tagTo == tagTo && pRefRec->_refKind == refKind ) {
|
||||
if (pRefRec->_tagFrom == tagFrom && pRefRec->_tagTo == tagTo && pRefRec->_refKind == refKind) {
|
||||
return pRefRec;
|
||||
}
|
||||
}
|
||||
@ -200,7 +200,7 @@ static jboolean addRefToVerify(jlong tagFrom, jlong tagTo, jint refKind, int exp
|
||||
{
|
||||
RefToVerify * pRefRec;
|
||||
|
||||
if ( g_refsToVerifyCnt >= MAX_REFS ) {
|
||||
if (g_refsToVerifyCnt >= MAX_REFS) {
|
||||
NSK_COMPLAIN0("TEST_BUG: Max. number of refs reached!");
|
||||
nsk_jvmti_setFailStatus();
|
||||
return JNI_FALSE;
|
||||
@ -224,20 +224,20 @@ JNIEXPORT jboolean JNICALL Java_nsk_jvmti_unit_FollowReferences_FollowRefObjects
|
||||
jlong tagFrom, tagTo;
|
||||
RefToVerify * pRefRec;
|
||||
|
||||
if ( ! NSK_VERIFY((r = jvmti->GetTag(from, &tagFrom)) == JVMTI_ERROR_NONE) ) {
|
||||
if (!NSK_VERIFY((r = jvmti->GetTag(from, &tagFrom)) == JVMTI_ERROR_NONE)) {
|
||||
NSK_COMPLAIN2("TEST_BUG: Can't GetTag for object %lx. Return code: %i\n", from, r);
|
||||
nsk_jvmti_setFailStatus();
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
|
||||
if ( ! NSK_VERIFY((r = jvmti->GetTag(to, &tagTo)) == JVMTI_ERROR_NONE) ) {
|
||||
if (!NSK_VERIFY((r = jvmti->GetTag(to, &tagTo)) == JVMTI_ERROR_NONE)) {
|
||||
NSK_COMPLAIN2("TEST_BUG: Can't GetTag for object %lx. Return code: %i\n", to, r);
|
||||
nsk_jvmti_setFailStatus();
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
if ( (pRefRec = findRefToVerify(tagFrom, tagTo, refKind)) != NULL ) {
|
||||
if ((pRefRec = findRefToVerify(tagFrom, tagTo, refKind)) != NULL) {
|
||||
pRefRec->_expectedCount += count;
|
||||
return JNI_TRUE;
|
||||
}
|
||||
@ -249,7 +249,7 @@ jboolean markRefToVerify(jlong tagFrom, jlong tagTo, int refKind)
|
||||
{
|
||||
RefToVerify * pRefRec;
|
||||
|
||||
if ( (pRefRec = findRefToVerify(tagFrom, tagTo, refKind)) != NULL ) {
|
||||
if ((pRefRec = findRefToVerify(tagFrom, tagTo, refKind)) != NULL) {
|
||||
pRefRec->_actualCount++;
|
||||
return JNI_TRUE;
|
||||
}
|
||||
@ -299,8 +299,8 @@ void printHeapRefCallbackInfo(
|
||||
NSK_DISPLAY2(" tag: %" LL "d, referrer_tag: %" LL "d\n",
|
||||
tag_val, DEREF(referrer_tag_ptr));
|
||||
|
||||
szInfo = ( tag_val > 0 && tag_val < MAX_TAG ) ? g_szTagInfo[tag_val] : "<none>";
|
||||
szRefInfo = ( referrer_tag_ptr && *referrer_tag_ptr > 0 && *referrer_tag_ptr < MAX_TAG ) ? g_szTagInfo[*referrer_tag_ptr] : "<none>";
|
||||
szInfo = (tag_val > 0 && tag_val < MAX_TAG) ? g_szTagInfo[tag_val] : "<none>";
|
||||
szRefInfo = (referrer_tag_ptr && *referrer_tag_ptr > 0 && *referrer_tag_ptr < MAX_TAG) ? g_szTagInfo[*referrer_tag_ptr] : "<none>";
|
||||
|
||||
NSK_DISPLAY3(" summary: %s: %s <- %s\n",
|
||||
g_refKindStr[reference_kind], szInfo, szRefInfo);
|
||||
|
@ -232,12 +232,12 @@ int nsk_jvmti_parseOptions(const char options[]) {
|
||||
context.options.string[len] = '\0';
|
||||
context.options.string[len+1] = '\0';
|
||||
|
||||
for (opt = context.options.string; ; ) {
|
||||
for (opt = context.options.string; ;) {
|
||||
const char* opt_end;
|
||||
const char* val_sep;
|
||||
int opt_len=0;
|
||||
int val_len=0;
|
||||
int exit=1;
|
||||
int exit=1;
|
||||
|
||||
while (*opt != '\0' && isOptSep(*opt)) opt++;
|
||||
if (*opt == '\0') break;
|
||||
@ -489,15 +489,13 @@ int nsk_jvmti_redefineClass(jvmtiEnv * jvmti,
|
||||
jclass classToRedefine,
|
||||
const char * fileName) {
|
||||
redefineAttempted = NSK_TRUE;
|
||||
if ( nsk_jvmti_findOptionValue(NSK_JVMTI_OPT_PATH_TO_NEW_BYTE_CODE)
|
||||
== NULL ) {
|
||||
nsk_printf("# error expected: %s \n",
|
||||
NSK_JVMTI_OPT_PATH_TO_NEW_BYTE_CODE );
|
||||
if (nsk_jvmti_findOptionValue(NSK_JVMTI_OPT_PATH_TO_NEW_BYTE_CODE) == NULL) {
|
||||
nsk_printf("# error expected: %s \n", NSK_JVMTI_OPT_PATH_TO_NEW_BYTE_CODE);
|
||||
nsk_printf("Hint :: missing java -agentlib:agentlib=%s=DirName, ($TESTBASE/bin) \n",
|
||||
NSK_JVMTI_OPT_PATH_TO_NEW_BYTE_CODE );
|
||||
NSK_JVMTI_OPT_PATH_TO_NEW_BYTE_CODE);
|
||||
return NSK_FALSE;
|
||||
}
|
||||
if ( fileName == NULL) {
|
||||
if (fileName == NULL) {
|
||||
nsk_printf("# error file name expected did not found \n");
|
||||
return NSK_FALSE;
|
||||
}
|
||||
@ -517,7 +515,7 @@ int nsk_jvmti_redefineClass(jvmtiEnv * jvmti,
|
||||
|
||||
bytecode = fopen(file, "rb");
|
||||
error= JVMTI_ERROR_NONE;
|
||||
if ( bytecode == NULL ) {
|
||||
if (bytecode == NULL) {
|
||||
nsk_printf("# error **Agent::error opening file %s \n",file);
|
||||
return NSK_FALSE;
|
||||
}
|
||||
@ -528,12 +526,12 @@ int nsk_jvmti_redefineClass(jvmtiEnv * jvmti,
|
||||
nsk_printf("# info file size= %ld\n",ftell(bytecode));
|
||||
rewind(bytecode);
|
||||
error = jvmti->Allocate(size,&classBytes);
|
||||
if ( error != JVMTI_ERROR_NONE) {
|
||||
if (error != JVMTI_ERROR_NONE) {
|
||||
nsk_printf(" Failed to create memory %s \n",TranslateError(error));
|
||||
return NSK_FALSE;
|
||||
}
|
||||
|
||||
if ( ((jint) fread( classBytes, 1,size,bytecode )) != size ) {
|
||||
if (((jint) fread(classBytes, 1,size,bytecode)) != size) {
|
||||
nsk_printf(" # error failed to read all the bytes , could be less or more \n");
|
||||
return NSK_FALSE;
|
||||
} else {
|
||||
@ -546,9 +544,9 @@ int nsk_jvmti_redefineClass(jvmtiEnv * jvmti,
|
||||
classDef.class_byte_count= size;
|
||||
classDef.class_bytes = classBytes;
|
||||
error = jvmti->RedefineClasses(1,&classDef);
|
||||
if ( error != JVMTI_ERROR_NONE ) {
|
||||
if (error != JVMTI_ERROR_NONE) {
|
||||
nsk_printf("# error occured while redefining %s ",
|
||||
TranslateError(error) );
|
||||
TranslateError(error));
|
||||
return NSK_FALSE;
|
||||
}
|
||||
}
|
||||
@ -570,7 +568,7 @@ Java_nsk_share_jvmti_RedefineAgent_redefineAttempted(JNIEnv *jni, jobject obj)
|
||||
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_nsk_share_jvmti_RedefineAgent_isRedefined(JNIEnv * jni, jobject obj ) {
|
||||
Java_nsk_share_jvmti_RedefineAgent_isRedefined(JNIEnv * jni, jobject obj) {
|
||||
|
||||
if (redefineSucceed == NSK_TRUE) {
|
||||
return JNI_TRUE;
|
||||
@ -582,8 +580,8 @@ Java_nsk_share_jvmti_RedefineAgent_isRedefined(JNIEnv * jni, jobject obj ) {
|
||||
* This jni method is a Java wrapper for agent status.
|
||||
*/
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_nsk_share_jvmti_RedefineAgent_agentStatus(JNIEnv * jni, jobject obj ) {
|
||||
if ( agentFailed == NSK_TRUE) {
|
||||
Java_nsk_share_jvmti_RedefineAgent_agentStatus(JNIEnv * jni, jobject obj) {
|
||||
if (agentFailed == NSK_TRUE) {
|
||||
return JNI_FALSE;
|
||||
} else {
|
||||
return JNI_TRUE;
|
||||
|
@ -22,7 +22,7 @@
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
#if (defined(WIN32) || defined (_WIN32) )
|
||||
#if (defined(WIN32) || defined (_WIN32))
|
||||
#include <process.h>
|
||||
#define getpid _getpid
|
||||
#define pidType int
|
||||
|
@ -133,11 +133,11 @@ void nsk_lvcomplain(const char file[], int line,
|
||||
char msg_buf[1024];
|
||||
nsk_context.nComplains++;
|
||||
if (!nsk_context.verbose) {
|
||||
if ( nsk_context.nComplains > NSK_MAX_COMPLAINS_NON_VERBOSE ) {
|
||||
if (nsk_context.nComplains > NSK_MAX_COMPLAINS_NON_VERBOSE) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( nsk_context.nComplains == NSK_MAX_COMPLAINS_NON_VERBOSE ) {
|
||||
if (nsk_context.nComplains == NSK_MAX_COMPLAINS_NON_VERBOSE) {
|
||||
nsk_printf("# ...\n"
|
||||
"# ERROR: too many complains, giving up to save disk space (CR 6341460)\n"
|
||||
"# Please rerun the test with -verbose option to listen to the entire song\n");
|
||||
|
@ -35,14 +35,14 @@ Java_nsk_stress_jni_JNIter007_incCount (JNIEnv *env, jobject jobj, jstring name)
|
||||
const char *str = env->GetStringUTFChars(name, 0); CE
|
||||
|
||||
if (env->MonitorEnter(jobj))
|
||||
printf("Error in monitor lock\n");
|
||||
printf("Error in monitor lock\n");
|
||||
clazz = env->GetObjectClass(jobj); CE
|
||||
fld = env->GetStaticFieldID(clazz, "nativeCount", "I"); CE
|
||||
value = env->GetStaticIntField(clazz, fld); CE
|
||||
env->SetStaticIntField(clazz, fld, (jint)(++value)); CE
|
||||
env->MonitorExit(jobj); CE
|
||||
if (value%1000 == 0 )
|
||||
printf("in %s Count after %u\n", str, value);
|
||||
if (value % 1000 == 0)
|
||||
printf("in %s Count after %u\n", str, value);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ Java_nsk_stress_strace_strace011Thread_recursiveMethod(JNIEnv *env, jobject obj)
|
||||
alltime = 0;
|
||||
GET_STATIC_BOOL_FIELD(isLocked, testClass, "isLocked");
|
||||
|
||||
while ( isLocked != JNI_TRUE )
|
||||
while (isLocked != JNI_TRUE)
|
||||
{
|
||||
MONITOR_ENTER(testField);
|
||||
CALL_VOID(testField, threadClass, "wait", Slongparam, 1LL);
|
||||
|
@ -75,35 +75,35 @@ Java_vm_mlvm_indy_func_jvmti_share_IndyRedefineClass_checkStatus(JNIEnv * pEnv,
|
||||
NSK_DISPLAY1("Single step event fired? %i\n", gIsSingleStepWorking);
|
||||
NSK_DISPLAY0("The following value should be zero for test to pass:\n");
|
||||
NSK_DISPLAY1("Any other error occured? %i\n", gIsErrorOccured);
|
||||
return gIsMethodEntryWorking && gIsSingleStepWorking && ! gIsErrorOccured;
|
||||
return gIsMethodEntryWorking && gIsSingleStepWorking && !gIsErrorOccured;
|
||||
}
|
||||
|
||||
static void popFrameLogic(jvmtiEnv * jvmti_env, jthread thread) {
|
||||
|
||||
TLSStruct * tls = (TLSStruct *) getTLS(jvmti_env, thread, sizeof(TLSStruct));
|
||||
|
||||
if ( ! tls )
|
||||
if (!tls)
|
||||
return;
|
||||
|
||||
if ( tls->countOfFramesToPop <= 0 ) {
|
||||
if (tls->countOfFramesToPop <= 0) {
|
||||
|
||||
NSK_DISPLAY0("Disabling single step\n");
|
||||
if ( ! NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, NULL)) )
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, NULL)))
|
||||
gIsErrorOccured = JNI_TRUE;
|
||||
|
||||
} else {
|
||||
|
||||
NSK_DISPLAY0("Enabling single step\n");
|
||||
if ( ! NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, NULL)) )
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, NULL)))
|
||||
gIsErrorOccured = JNI_TRUE;
|
||||
|
||||
if ( tls->countOfFramesToPop == 1 ) {
|
||||
if (tls->countOfFramesToPop == 1) {
|
||||
NSK_DISPLAY0("Popping a frame\n");
|
||||
if ( ! NSK_JVMTI_VERIFY(jvmti_env->PopFrame(thread)) )
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->PopFrame(thread)))
|
||||
gIsErrorOccured = JNI_TRUE;
|
||||
} else {
|
||||
NSK_DISPLAY0("Forcing early return\n");
|
||||
if ( ! NSK_JVMTI_VERIFY(jvmti_env->ForceEarlyReturnVoid(thread)) )
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->ForceEarlyReturnVoid(thread)))
|
||||
gIsErrorOccured = JNI_TRUE;
|
||||
}
|
||||
|
||||
@ -123,10 +123,10 @@ MethodEntry(jvmtiEnv *jvmti_env,
|
||||
|
||||
gIsMethodEntryWorking = JNI_TRUE;
|
||||
mn = getMethodName(jvmti_env, method);
|
||||
if ( ! mn )
|
||||
if (!mn)
|
||||
return;
|
||||
|
||||
if ( strcmp(mn->methodName, gszRedefineTriggerMethodName) != 0 ) {
|
||||
if (strcmp(mn->methodName, gszRedefineTriggerMethodName) != 0) {
|
||||
free(mn);
|
||||
return;
|
||||
}
|
||||
@ -134,17 +134,17 @@ MethodEntry(jvmtiEnv *jvmti_env,
|
||||
NSK_DISPLAY2("Entering redefine tigger method: %s.%s\n", mn->classSig, mn->methodName);
|
||||
free(mn); mn = NULL;
|
||||
|
||||
if ( gIsClassRedefined ) {
|
||||
if (gIsClassRedefined) {
|
||||
NSK_DISPLAY0("Class is already redefined.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
NSK_DISPLAY1("Redefining class %s\n", gszRedefinedClassFileName);
|
||||
|
||||
if ( ! NSK_JVMTI_VERIFY(jvmti_env->GetMethodDeclaringClass(method, &clazz)) )
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->GetMethodDeclaringClass(method, &clazz)))
|
||||
return;
|
||||
|
||||
if ( ! NSK_VERIFY(nsk_jvmti_redefineClass(jvmti_env, clazz, gszRedefinedClassFileName)) ) {
|
||||
if (!NSK_VERIFY(nsk_jvmti_redefineClass(jvmti_env, clazz, gszRedefinedClassFileName))) {
|
||||
gIsErrorOccured = JNI_TRUE;
|
||||
return;
|
||||
}
|
||||
@ -183,13 +183,13 @@ jint Agent_Initialize(JavaVM * vm, char * options, void * reserved) {
|
||||
jvmtiEventCallbacks callbacks;
|
||||
jvmtiCapabilities caps;
|
||||
|
||||
if ( ! NSK_VERIFY(nsk_jvmti_parseOptions(options)) )
|
||||
if (!NSK_VERIFY(nsk_jvmti_parseOptions(options)))
|
||||
return JNI_ERR;
|
||||
|
||||
if ( ! NSK_VERIFY((gJvmtiEnv = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL) )
|
||||
if (!NSK_VERIFY((gJvmtiEnv = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if ( nsk_jvmti_findOptionValue("debuggerCompatible") ) {
|
||||
if (nsk_jvmti_findOptionValue("debuggerCompatible")) {
|
||||
gIsDebuggerCompatible = JNI_TRUE;
|
||||
}
|
||||
|
||||
@ -200,20 +200,20 @@ jint Agent_Initialize(JavaVM * vm, char * options, void * reserved) {
|
||||
caps.can_force_early_return = 1;
|
||||
caps.can_redefine_classes = 1;
|
||||
|
||||
if ( ! NSK_JVMTI_VERIFY(gJvmtiEnv->AddCapabilities(&caps)) )
|
||||
if (!NSK_JVMTI_VERIFY(gJvmtiEnv->AddCapabilities(&caps)))
|
||||
return JNI_ERR;
|
||||
|
||||
memset(&callbacks, 0, sizeof(callbacks));
|
||||
callbacks.MethodEntry = &MethodEntry;
|
||||
callbacks.SingleStep = &SingleStep;
|
||||
|
||||
if ( ! NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventCallbacks(&callbacks, sizeof(callbacks))) )
|
||||
if (!NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventCallbacks(&callbacks, sizeof(callbacks))))
|
||||
return JNI_ERR;
|
||||
|
||||
if ( ! NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_METHOD_ENTRY, NULL) ) )
|
||||
if (!NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_METHOD_ENTRY, NULL)))
|
||||
return JNI_ERR;
|
||||
|
||||
if ( ! NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, NULL) ) )
|
||||
if (!NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, NULL)))
|
||||
return JNI_ERR;
|
||||
|
||||
return JNI_OK;
|
||||
|
@ -63,7 +63,7 @@ Java_vm_mlvm_indy_func_jvmti_stepBreakPopReturn_INDIFY_1Test_checkStatus(JNIEnv
|
||||
NSK_DISPLAY0("The following values should be non-zero for test to pass:\n");
|
||||
NSK_DISPLAY1("Method entry event fired? %i\n", gIsMethodEntryWorking);
|
||||
NSK_DISPLAY1("Single step event fired? %i\n", gIsSingleStepWorking);
|
||||
if ( ! gIsDebuggerCompatible )
|
||||
if (!gIsDebuggerCompatible)
|
||||
NSK_DISPLAY1("Breakpoint event fired? %i\n", gIsBreakpointWorking);
|
||||
|
||||
return gIsMethodEntryWorking && !gErrorHappened && gIsSingleStepWorking
|
||||
@ -79,16 +79,16 @@ MethodEntry(jvmtiEnv *jvmti_env,
|
||||
struct MethodName * mn;
|
||||
|
||||
mn = getMethodName(jvmti_env, method);
|
||||
if ( ! mn )
|
||||
if (!mn)
|
||||
return;
|
||||
|
||||
if ( strcmp(mn->classSig, gszDebuggeeClassName) == 0 ) {
|
||||
if (strcmp(mn->classSig, gszDebuggeeClassName) == 0) {
|
||||
NSK_DISPLAY2("Entering method: %s.%s\n", mn->classSig, mn->methodName);
|
||||
|
||||
if ( strcmp(mn->methodName, gszDebuggeeMethodName) == 0 ) {
|
||||
if (strcmp(mn->methodName, gszDebuggeeMethodName) == 0) {
|
||||
gIsMethodEntryWorking = JNI_TRUE;
|
||||
|
||||
if ( ! gIsBreakpointSet )
|
||||
if (!gIsBreakpointSet)
|
||||
NSK_JVMTI_VERIFY(jvmti_env->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_SINGLE_STEP, NULL));
|
||||
}
|
||||
}
|
||||
@ -118,8 +118,8 @@ SingleStep(jvmtiEnv *jvmti_env,
|
||||
|
||||
NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventNotificationMode(JVMTI_DISABLE, JVMTI_EVENT_SINGLE_STEP, NULL));
|
||||
|
||||
if ( ! gIsDebuggerCompatible ) {
|
||||
if ( ! NSK_JVMTI_VERIFY(jvmti_env->SetBreakpoint(method, location)) )
|
||||
if (!gIsDebuggerCompatible) {
|
||||
if (!NSK_JVMTI_VERIFY(jvmti_env->SetBreakpoint(method, location)))
|
||||
return;
|
||||
|
||||
NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_BREAKPOINT, NULL));
|
||||
@ -128,7 +128,7 @@ SingleStep(jvmtiEnv *jvmti_env,
|
||||
NSK_DISPLAY0("Pop a frame\n");
|
||||
NSK_JVMTI_VERIFY(gJvmtiEnv->PopFrame(thread));
|
||||
} else {
|
||||
if ( gIsFirstCall ) {
|
||||
if (gIsFirstCall) {
|
||||
NSK_DISPLAY0("Pop a frame\n");
|
||||
NSK_JVMTI_VERIFY(gJvmtiEnv->PopFrame(thread));
|
||||
gIsFirstCall = JNI_FALSE;
|
||||
@ -170,24 +170,24 @@ jint Agent_Initialize(JavaVM * vm, char * options, void * reserved) {
|
||||
jvmtiEventCallbacks callbacks;
|
||||
jvmtiCapabilities caps;
|
||||
|
||||
if ( ! NSK_VERIFY(nsk_jvmti_parseOptions(options)) )
|
||||
if (!NSK_VERIFY(nsk_jvmti_parseOptions(options)))
|
||||
return JNI_ERR;
|
||||
|
||||
if ( ! NSK_VERIFY((gJvmtiEnv = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL) )
|
||||
if (!NSK_VERIFY((gJvmtiEnv = nsk_jvmti_createJVMTIEnv(vm, reserved)) != NULL))
|
||||
return JNI_ERR;
|
||||
|
||||
if ( nsk_jvmti_findOptionValue("debuggerCompatible") ) {
|
||||
if (nsk_jvmti_findOptionValue("debuggerCompatible")) {
|
||||
gIsDebuggerCompatible = JNI_TRUE;
|
||||
}
|
||||
|
||||
memset(&caps, 0, sizeof(caps));
|
||||
caps.can_generate_method_entry_events = 1;
|
||||
caps.can_generate_single_step_events = 1;
|
||||
caps.can_generate_breakpoint_events = ! gIsDebuggerCompatible;
|
||||
caps.can_generate_breakpoint_events = !gIsDebuggerCompatible;
|
||||
caps.can_pop_frame = 1;
|
||||
caps.can_force_early_return = 1;
|
||||
|
||||
if ( ! NSK_JVMTI_VERIFY(gJvmtiEnv->AddCapabilities(&caps)) )
|
||||
if (!NSK_JVMTI_VERIFY(gJvmtiEnv->AddCapabilities(&caps)))
|
||||
return JNI_ERR;
|
||||
|
||||
memset(&callbacks, 0, sizeof(callbacks));
|
||||
@ -195,10 +195,10 @@ jint Agent_Initialize(JavaVM * vm, char * options, void * reserved) {
|
||||
callbacks.SingleStep = &SingleStep;
|
||||
callbacks.Breakpoint = &Breakpoint;
|
||||
|
||||
if ( ! NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventCallbacks(&callbacks, sizeof(callbacks))) )
|
||||
if (!NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventCallbacks(&callbacks, sizeof(callbacks))))
|
||||
return JNI_ERR;
|
||||
|
||||
if ( ! NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_METHOD_ENTRY, NULL) ) )
|
||||
if (!NSK_JVMTI_VERIFY(gJvmtiEnv->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_METHOD_ENTRY, NULL)))
|
||||
return JNI_ERR;
|
||||
|
||||
return JNI_OK;
|
||||
|
@ -48,10 +48,10 @@ Java_vm_mlvm_meth_stress_jni_nativeAndMH_Test_native01(
|
||||
jobjectArray arguments;
|
||||
jobject result;
|
||||
|
||||
if ( ! NSK_JNI_VERIFY(pEnv, (mhClass = pEnv->GetObjectClass(mhToCall)) != NULL) )
|
||||
if (!NSK_JNI_VERIFY(pEnv, (mhClass = pEnv->GetObjectClass(mhToCall)) != NULL))
|
||||
return NULL;
|
||||
|
||||
if ( ! NSK_JNI_VERIFY(pEnv, NULL != (mid = pEnv->GetMethodID(mhClass, "invokeWithArguments", "([Ljava/lang/Object;)Ljava/lang/Object;"))) )
|
||||
if (!NSK_JNI_VERIFY(pEnv, NULL != (mid = pEnv->GetMethodID(mhClass, "invokeWithArguments", "([Ljava/lang/Object;)Ljava/lang/Object;"))))
|
||||
return NULL;
|
||||
|
||||
NSK_JNI_VERIFY(pEnv, NULL != (objectClass = pEnv->FindClass("java/lang/Object")));
|
||||
|
@ -36,7 +36,7 @@ void copyFromJString(JNIEnv * pEnv, jstring src, char ** dst) {
|
||||
const char * pStr;
|
||||
jsize len;
|
||||
|
||||
if ( ! NSK_VERIFY((pStr = pEnv->GetStringUTFChars(src, NULL)) != NULL) ) {
|
||||
if (!NSK_VERIFY((pStr = pEnv->GetStringUTFChars(src, NULL)) != NULL)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -53,16 +53,16 @@ struct MethodName * getMethodName(jvmtiEnv * pJvmtiEnv, jmethodID method) {
|
||||
jclass clazz;
|
||||
struct MethodName * mn;
|
||||
|
||||
if ( ! NSK_JVMTI_VERIFY(pJvmtiEnv->GetMethodName(method, &szName, NULL, NULL)) ) {
|
||||
if (!NSK_JVMTI_VERIFY(pJvmtiEnv->GetMethodName(method, &szName, NULL, NULL))) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ( ! NSK_JVMTI_VERIFY(pJvmtiEnv->GetMethodDeclaringClass(method, &clazz)) ) {
|
||||
if (!NSK_JVMTI_VERIFY(pJvmtiEnv->GetMethodDeclaringClass(method, &clazz))) {
|
||||
NSK_JVMTI_VERIFY(pJvmtiEnv->Deallocate((unsigned char*) szName));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if ( ! NSK_JVMTI_VERIFY(pJvmtiEnv->GetClassSignature(clazz, &szSignature, NULL)) ) {
|
||||
if (!NSK_JVMTI_VERIFY(pJvmtiEnv->GetClassSignature(clazz, &szSignature, NULL))) {
|
||||
NSK_JVMTI_VERIFY(pJvmtiEnv->Deallocate((unsigned char*) szName));
|
||||
return NULL;
|
||||
}
|
||||
@ -83,7 +83,7 @@ char * locationToString(jvmtiEnv * pJvmtiEnv, jmethodID method, jlocation locati
|
||||
const char * const format = "%s .%s :" JLONG_FORMAT;
|
||||
|
||||
pMN = getMethodName(pJvmtiEnv, method);
|
||||
if ( ! pMN )
|
||||
if (!pMN)
|
||||
return strdup("NONE");
|
||||
|
||||
len = snprintf(NULL, 0, format, pMN->classSig, pMN->methodName, location) + 1;
|
||||
@ -107,16 +107,16 @@ char * locationToString(jvmtiEnv * pJvmtiEnv, jmethodID method, jlocation locati
|
||||
|
||||
void * getTLS(jvmtiEnv * pJvmtiEnv, jthread thread, jsize sizeToAllocate) {
|
||||
void * tls;
|
||||
if ( ! NSK_JVMTI_VERIFY(pJvmtiEnv->GetThreadLocalStorage(thread, &tls)) )
|
||||
if (!NSK_JVMTI_VERIFY(pJvmtiEnv->GetThreadLocalStorage(thread, &tls)))
|
||||
return NULL;
|
||||
|
||||
if ( ! tls) {
|
||||
if ( ! NSK_VERIFY((tls = malloc(sizeToAllocate)) != NULL) )
|
||||
if (!tls) {
|
||||
if (!NSK_VERIFY((tls = malloc(sizeToAllocate)) != NULL))
|
||||
return NULL;
|
||||
|
||||
memset(tls, 0, sizeToAllocate);
|
||||
|
||||
if ( ! NSK_JVMTI_VERIFY(pJvmtiEnv->SetThreadLocalStorage(thread, tls)) )
|
||||
if (!NSK_JVMTI_VERIFY(pJvmtiEnv->SetThreadLocalStorage(thread, tls)))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ JNIEXPORT jboolean JNICALL Java_vm_share_ProcessUtils_sendCtrlBreak
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
static BOOL (WINAPI *_MiniDumpWriteDump) ( HANDLE, DWORD, HANDLE, MINIDUMP_TYPE, PMINIDUMP_EXCEPTION_INFORMATION,
|
||||
static BOOL (WINAPI *_MiniDumpWriteDump) (HANDLE, DWORD, HANDLE, MINIDUMP_TYPE, PMINIDUMP_EXCEPTION_INFORMATION,
|
||||
PMINIDUMP_USER_STREAM_INFORMATION, PMINIDUMP_CALLBACK_INFORMATION);
|
||||
void reportLastError(const char *msg) {
|
||||
long errcode = GetLastError();
|
||||
@ -171,9 +171,10 @@ jboolean doDumpCore() {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
_MiniDumpWriteDump = (
|
||||
BOOL(WINAPI *)( HANDLE, DWORD, HANDLE, MINIDUMP_TYPE, PMINIDUMP_EXCEPTION_INFORMATION,
|
||||
PMINIDUMP_USER_STREAM_INFORMATION, PMINIDUMP_CALLBACK_INFORMATION)) GetProcAddress(dbghelp, "MiniDumpWriteDump");
|
||||
_MiniDumpWriteDump =
|
||||
(BOOL(WINAPI *)(HANDLE, DWORD, HANDLE, MINIDUMP_TYPE, PMINIDUMP_EXCEPTION_INFORMATION,
|
||||
PMINIDUMP_USER_STREAM_INFORMATION, PMINIDUMP_CALLBACK_INFORMATION))
|
||||
GetProcAddress(dbghelp, "MiniDumpWriteDump");
|
||||
|
||||
if (_MiniDumpWriteDump == NULL) {
|
||||
printf("Failed to find MiniDumpWriteDump() in module dbghelp.dll");
|
||||
|
Loading…
Reference in New Issue
Block a user