8210205: build fails on AIX in hotspot cpp tests (for example getstacktr001.cpp)
authormbaesken
Thu, 30 Aug 2018 13:12:38 +0200
changeset 51604 72291a181f8d
parent 51603 d0b71f6163e1
child 51605 2ca553d34949
8210205: build fails on AIX in hotspot cpp tests (for example getstacktr001.cpp) Reviewed-by: mdoerr, stuefe
test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr001/getstacktr001.cpp
test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr003/getstacktr003.cpp
test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr004/getstacktr004.cpp
test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr005/getstacktr005.cpp
test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr006/getstacktr006.cpp
test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr007/getstacktr007.cpp
test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr008/getstacktr008.cpp
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr001/getstacktr001.cpp	Fri Aug 31 10:32:47 2018 +0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr001/getstacktr001.cpp	Thu Aug 30 13:12:38 2018 +0200
@@ -66,7 +66,7 @@
      "([Ljava/lang/String;)V"}
 };
 
-#define NUMBER_OF_FRAMES ((int) (sizeof(frames)/sizeof(frame_info)))
+#define NUMBER_OF_STACK_FRAMES ((int) (sizeof(frames)/sizeof(frame_info)))
 
 #ifdef STATIC_BUILD
 JNIEXPORT jint JNICALL Agent_OnLoad_getstacktr001(JavaVM *jvm, char *options, void *reserved) {
@@ -110,7 +110,7 @@
 JNIEXPORT void JNICALL
 Java_nsk_jvmti_GetStackTrace_getstacktr001_check(JNIEnv *env, jclass cls, jthread thread) {
     jvmtiError err;
-    jvmtiFrameInfo f[NUMBER_OF_FRAMES + 1];
+    jvmtiFrameInfo f[NUMBER_OF_STACK_FRAMES + 1];
     jclass callerClass;
     char *sigClass, *name, *sig, *generic;
     jint i, count;
@@ -122,16 +122,16 @@
     }
 
     err = jvmti->GetStackTrace(thread, 0,
-        NUMBER_OF_FRAMES + 1, f, &count);
+        NUMBER_OF_STACK_FRAMES + 1, f, &count);
     if (err != JVMTI_ERROR_NONE) {
         printf("(GetStackTrace) unexpected error: %s (%d)\n",
                TranslateError(err), err);
         result = STATUS_FAILED;
         return;
     }
-    if (count != NUMBER_OF_FRAMES) {
+    if (count != NUMBER_OF_STACK_FRAMES) {
         printf("Wrong number of frames: %d, expected: %d\n",
-               count, NUMBER_OF_FRAMES);
+               count, NUMBER_OF_STACK_FRAMES);
         result = STATUS_FAILED;
     }
     for (i = 0; i < count; i++) {
@@ -166,7 +166,7 @@
             printf(">>>   method: \"%s%s\"\n", name, sig);
             printf(">>>   %d ... done\n", i);
         }
-        if (i < NUMBER_OF_FRAMES) {
+        if (i < NUMBER_OF_STACK_FRAMES) {
             if (sigClass == NULL || strcmp(sigClass, frames[i].cls) != 0) {
                 printf("(frame#%d) wrong class sig: \"%s\", expected: \"%s\"\n",
                        i, sigClass, frames[i].cls);
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr003/getstacktr003.cpp	Fri Aug 31 10:32:47 2018 +0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr003/getstacktr003.cpp	Thu Aug 30 13:12:38 2018 +0200
@@ -63,7 +63,7 @@
     {"Lnsk/jvmti/GetStackTrace/getstacktr003$TestThread;", "run", "()V"},
 };
 
-#define NUMBER_OF_FRAMES ((int) (sizeof(frames)/sizeof(frame_info)))
+#define NUMBER_OF_STACK_FRAMES ((int) (sizeof(frames)/sizeof(frame_info)))
 #define MAX_NUMBER_OF_FRAMES 32
 
 #ifdef STATIC_BUILD
@@ -168,9 +168,9 @@
         result = STATUS_FAILED;
         return result;
     }
-    if (count < NUMBER_OF_FRAMES) {
+    if (count < NUMBER_OF_STACK_FRAMES) {
         printf("Number of frames: %d is less then expected: %d\n",
-               count, NUMBER_OF_FRAMES);
+               count, NUMBER_OF_STACK_FRAMES);
         result = STATUS_FAILED;
     }
     for (i = 0; i < count; i++) {
@@ -206,20 +206,20 @@
             printf(">>>   method: \"%s%s\"\n", name, sig);
             printf(">>>   %d ... done\n", i);
         }
-        if (i < NUMBER_OF_FRAMES) {
-            if (sigClass == NULL || strcmp(sigClass, frames[NUMBER_OF_FRAMES-1-i].cls) != 0) {
+        if (i < NUMBER_OF_STACK_FRAMES) {
+            if (sigClass == NULL || strcmp(sigClass, frames[NUMBER_OF_STACK_FRAMES-1-i].cls) != 0) {
                 printf("(frame#%d) wrong class sig: \"%s\", expected: \"%s\"\n",
-                       NUMBER_OF_FRAMES-1-i, sigClass, frames[NUMBER_OF_FRAMES-1-i].cls);
+                       NUMBER_OF_STACK_FRAMES-1-i, sigClass, frames[NUMBER_OF_STACK_FRAMES-1-i].cls);
                 result = STATUS_FAILED;
             }
-            if (name == NULL || strcmp(name, frames[NUMBER_OF_FRAMES-1-i].name) != 0) {
+            if (name == NULL || strcmp(name, frames[NUMBER_OF_STACK_FRAMES-1-i].name) != 0) {
                 printf("(frame#%d) wrong method name: \"%s\", expected: \"%s\"\n",
-                       NUMBER_OF_FRAMES-1-i, name, frames[NUMBER_OF_FRAMES-1-i].name);
+                       NUMBER_OF_STACK_FRAMES-1-i, name, frames[NUMBER_OF_STACK_FRAMES-1-i].name);
                 result = STATUS_FAILED;
             }
-            if (sig == NULL || strcmp(sig, frames[NUMBER_OF_FRAMES-1-i].sig) != 0) {
+            if (sig == NULL || strcmp(sig, frames[NUMBER_OF_STACK_FRAMES-1-i].sig) != 0) {
                 printf("(frame#%d) wrong method sig: \"%s\", expected: \"%s\"\n",
-                       NUMBER_OF_FRAMES-1-i, sig, frames[NUMBER_OF_FRAMES-1-i].sig);
+                       NUMBER_OF_STACK_FRAMES-1-i, sig, frames[NUMBER_OF_STACK_FRAMES-1-i].sig);
                 result = STATUS_FAILED;
             }
         }
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr004/getstacktr004.cpp	Fri Aug 31 10:32:47 2018 +0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr004/getstacktr004.cpp	Thu Aug 30 13:12:38 2018 +0200
@@ -67,26 +67,26 @@
     {"Lnsk/jvmti/GetStackTrace/getstacktr004$TestThread;", "run", "()V"},
 };
 
-#define NUMBER_OF_FRAMES ((int) (sizeof(frames)/sizeof(frame_info)))
+#define NUMBER_OF_STACK_FRAMES ((int) (sizeof(frames)/sizeof(frame_info)))
 
 void check(jvmtiEnv *jvmti_env, jthread thr) {
     jvmtiError err;
-    jvmtiFrameInfo f[NUMBER_OF_FRAMES + 1];
+    jvmtiFrameInfo f[NUMBER_OF_STACK_FRAMES + 1];
     jclass callerClass;
     char *sigClass, *name, *sig, *generic;
     jint i, count;
 
     err = jvmti_env->GetStackTrace(thr,
-        0, NUMBER_OF_FRAMES + 1, f, &count);
+        0, NUMBER_OF_STACK_FRAMES + 1, f, &count);
     if (err != JVMTI_ERROR_NONE) {
         printf("(GetStackTrace) unexpected error: %s (%d)\n",
                TranslateError(err), err);
         result = STATUS_FAILED;
         return;
     }
-    if (count != NUMBER_OF_FRAMES) {
+    if (count != NUMBER_OF_STACK_FRAMES) {
         printf("Wrong frame count, expected: %d, actual: %d\n",
-               NUMBER_OF_FRAMES, count);
+               NUMBER_OF_STACK_FRAMES, count);
         result = STATUS_FAILED;
     }
 
@@ -125,7 +125,7 @@
             printf(">>>   class:  \"%s\"\n", sigClass);
             printf(">>>   method: \"%s%s\"\n", name, sig);
         }
-        if (i < NUMBER_OF_FRAMES) {
+        if (i < NUMBER_OF_STACK_FRAMES) {
             if (sigClass == NULL || strcmp(sigClass, frames[i].cls) != 0) {
                 printf("(frame#%d) wrong class sig: \"%s\", expected: \"%s\"\n",
                        i, sigClass, frames[i].cls);
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr005/getstacktr005.cpp	Fri Aug 31 10:32:47 2018 +0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr005/getstacktr005.cpp	Thu Aug 30 13:12:38 2018 +0200
@@ -66,26 +66,26 @@
     {"Lnsk/jvmti/GetStackTrace/getstacktr005$TestThread;", "run", "()V"},
 };
 
-#define NUMBER_OF_FRAMES ((int) (sizeof(frames)/sizeof(frame_info)))
+#define NUMBER_OF_STACK_FRAMES ((int) (sizeof(frames)/sizeof(frame_info)))
 
 void check(jvmtiEnv *jvmti_env, jthread thr) {
     jvmtiError err;
-    jvmtiFrameInfo f[NUMBER_OF_FRAMES + 1];
+    jvmtiFrameInfo f[NUMBER_OF_STACK_FRAMES + 1];
     jclass callerClass;
     char *sigClass, *name, *sig, *generic;
     jint i, count;
 
     err = jvmti_env->GetStackTrace(thr,
-        0, NUMBER_OF_FRAMES + 1, f, &count);
+        0, NUMBER_OF_STACK_FRAMES + 1, f, &count);
     if (err != JVMTI_ERROR_NONE) {
         printf("(GetStackTrace) unexpected error: %s (%d)\n",
                TranslateError(err), err);
         result = STATUS_FAILED;
         return;
     }
-    if (count != NUMBER_OF_FRAMES) {
+    if (count != NUMBER_OF_STACK_FRAMES) {
         printf("Wrong frame count, expected: %d, actual: %d\n",
-               NUMBER_OF_FRAMES, count);
+               NUMBER_OF_STACK_FRAMES, count);
         result = STATUS_FAILED;
     }
 
@@ -124,7 +124,7 @@
             printf(">>>   class:  \"%s\"\n", sigClass);
             printf(">>>   method: \"%s%s\"\n", name, sig);
         }
-        if (i < NUMBER_OF_FRAMES) {
+        if (i < NUMBER_OF_STACK_FRAMES) {
             if (sigClass == NULL || strcmp(sigClass, frames[i].cls) != 0) {
                 printf("(frame#%d) wrong class sig: \"%s\", expected: \"%s\"\n",
                        i, sigClass, frames[i].cls);
@@ -167,9 +167,9 @@
         return;
     }
 
-    if (frameCount != NUMBER_OF_FRAMES + 1) {
+    if (frameCount != NUMBER_OF_STACK_FRAMES + 1) {
         printf("(bp) wrong frame count, expected: %d, actual: %d\n",
-               NUMBER_OF_FRAMES + 1, frameCount);
+               NUMBER_OF_STACK_FRAMES + 1, frameCount);
         result = STATUS_FAILED;
     }
 
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr006/getstacktr006.cpp	Fri Aug 31 10:32:47 2018 +0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr006/getstacktr006.cpp	Thu Aug 30 13:12:38 2018 +0200
@@ -66,26 +66,26 @@
     {"Lnsk/jvmti/GetStackTrace/getstacktr006$TestThread;", "run", "()V"},
 };
 
-#define NUMBER_OF_FRAMES ((int) (sizeof(frames)/sizeof(frame_info)))
+#define NUMBER_OF_STACK_FRAMES ((int) (sizeof(frames)/sizeof(frame_info)))
 
 void check(jvmtiEnv *jvmti_env, jthread thr) {
     jvmtiError err;
-    jvmtiFrameInfo f[NUMBER_OF_FRAMES + 1];
+    jvmtiFrameInfo f[NUMBER_OF_STACK_FRAMES + 1];
     jclass callerClass;
     char *sigClass, *name, *sig, *generic;
     jint i, count;
 
     err = jvmti_env->GetStackTrace(thr,
-        0, NUMBER_OF_FRAMES + 1, f, &count);
+        0, NUMBER_OF_STACK_FRAMES + 1, f, &count);
     if (err != JVMTI_ERROR_NONE) {
         printf("(GetStackTrace) unexpected error: %s (%d)\n",
                TranslateError(err), err);
         result = STATUS_FAILED;
         return;
     }
-    if (count != NUMBER_OF_FRAMES) {
+    if (count != NUMBER_OF_STACK_FRAMES) {
         printf("Wrong frame count, expected: %d, actual: %d\n",
-               NUMBER_OF_FRAMES, count);
+               NUMBER_OF_STACK_FRAMES, count);
         result = STATUS_FAILED;
     }
 
@@ -124,7 +124,7 @@
             printf(">>>   class:  \"%s\"\n", sigClass);
             printf(">>>   method: \"%s%s\"\n", name, sig);
         }
-        if (i < NUMBER_OF_FRAMES) {
+        if (i < NUMBER_OF_STACK_FRAMES) {
             if (sigClass == NULL || strcmp(sigClass, frames[i].cls) != 0) {
                 printf("(frame#%d) wrong class sig: \"%s\", expected: \"%s\"\n",
                        i, sigClass, frames[i].cls);
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr007/getstacktr007.cpp	Fri Aug 31 10:32:47 2018 +0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr007/getstacktr007.cpp	Thu Aug 30 13:12:38 2018 +0200
@@ -68,26 +68,26 @@
     {"Lnsk/jvmti/GetStackTrace/getstacktr007$TestThread;", "run", "()V"},
 };
 
-#define NUMBER_OF_FRAMES ((int) (sizeof(frames)/sizeof(frame_info)))
+#define NUMBER_OF_STACK_FRAMES ((int) (sizeof(frames)/sizeof(frame_info)))
 
 void check(jvmtiEnv *jvmti_env, jthread thr) {
     jvmtiError err;
-    jvmtiFrameInfo f[NUMBER_OF_FRAMES + 1];
+    jvmtiFrameInfo f[NUMBER_OF_STACK_FRAMES + 1];
     jclass callerClass;
     char *sigClass, *name, *sig, *generic;
     jint i, count;
 
     err = jvmti_env->GetStackTrace(thr,
-        0, NUMBER_OF_FRAMES + 1, f, &count);
+        0, NUMBER_OF_STACK_FRAMES + 1, f, &count);
     if (err != JVMTI_ERROR_NONE) {
         printf("(GetStackTrace) unexpected error: %s (%d)\n",
                TranslateError(err), err);
         result = STATUS_FAILED;
         return;
     }
-    if (count != NUMBER_OF_FRAMES) {
+    if (count != NUMBER_OF_STACK_FRAMES) {
         printf("Wrong frame count, expected: %d, actual: %d\n",
-               NUMBER_OF_FRAMES, count);
+               NUMBER_OF_STACK_FRAMES, count);
         result = STATUS_FAILED;
     }
 
@@ -126,7 +126,7 @@
             printf(">>>   class:  \"%s\"\n", sigClass);
             printf(">>>   method: \"%s%s\"\n", name, sig);
         }
-        if (i < NUMBER_OF_FRAMES) {
+        if (i < NUMBER_OF_STACK_FRAMES) {
             if (sigClass == NULL || strcmp(sigClass, frames[i].cls) != 0) {
                 printf("(frame#%d) wrong class sig: \"%s\", expected: \"%s\"\n",
                        i, sigClass, frames[i].cls);
--- a/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr008/getstacktr008.cpp	Fri Aug 31 10:32:47 2018 +0800
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetStackTrace/getstacktr008/getstacktr008.cpp	Thu Aug 30 13:12:38 2018 +0200
@@ -72,11 +72,11 @@
     {"Lnsk/jvmti/GetStackTrace/getstacktr008$TestThread;", "run", "()V"},
 };
 
-#define NUMBER_OF_FRAMES ((int) (sizeof(frames)/sizeof(frame_info)))
+#define NUMBER_OF_STACK_FRAMES ((int) (sizeof(frames)/sizeof(frame_info)))
 
 void check(jvmtiEnv *jvmti_env, jthread thr, int offset, const char *note) {
     jvmtiError err;
-    jvmtiFrameInfo f[NUMBER_OF_FRAMES + 1];
+    jvmtiFrameInfo f[NUMBER_OF_STACK_FRAMES + 1];
     jclass callerClass;
     char *sigClass, *name, *sig, *generic;
     jint i, count;
@@ -86,7 +86,7 @@
     }
 
     err = jvmti_env->GetStackTrace(thr,
-        0, NUMBER_OF_FRAMES + 1, f, &count);
+        0, NUMBER_OF_STACK_FRAMES + 1, f, &count);
     if (err != JVMTI_ERROR_NONE) {
         printf("(%s, GetStackTrace) unexpected error: %s (%d)\n",
                note, TranslateError(err), err);
@@ -98,9 +98,9 @@
             printf(">>>   frame count: %d\n", count);
     }
 
-    if (count != (jint)(NUMBER_OF_FRAMES - offset)) {
+    if (count != (jint)(NUMBER_OF_STACK_FRAMES - offset)) {
         printf("(%s) wrong frame count, expected: %d, actual: %d\n",
-               note, NUMBER_OF_FRAMES, count);
+               note, NUMBER_OF_STACK_FRAMES, count);
         result = STATUS_FAILED;
     }
     for (i = 0; i < count; i++) {
@@ -135,7 +135,7 @@
             printf(">>>   class:  \"%s\"\n", sigClass);
             printf(">>>   method: \"%s%s\"\n", name, sig);
         }
-        if (i < NUMBER_OF_FRAMES) {
+        if (i < NUMBER_OF_STACK_FRAMES) {
             if (sigClass == NULL ||
                     strcmp(sigClass, frames[i + offset].cls) != 0) {
                 printf("(%s, frame#%d) wrong class sig: \"%s\",\n",