8210429: Clean up JNI_ENV_ARG for vmTestbase/jvmti/Get[G-Z] tests

Remove the JNI_ENV_ARG for the rest of the Get[G-Z]

Reviewed-by: dholmes, sspitsyn, cjplummer
This commit is contained in:
Jean Christophe Beyler 2018-09-07 09:50:02 -07:00
parent 23ec584fda
commit d90f0a51c2
85 changed files with 153 additions and 1294 deletions

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -126,6 +112,4 @@ Java_nsk_jvmti_GetImplementedInterfaces_getintrf005_check(JNIEnv *env, jclass cl
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -112,6 +98,4 @@ JNIEXPORT int JNICALL Java_nsk_jvmti_GetImplementedInterfaces_getintrf006_getRes
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -112,8 +99,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -182,6 +168,4 @@ JNIEXPORT int JNICALL Java_nsk_jvmti_GetImplementedInterfaces_getintrf007_getRes
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "agent_common.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ========================================================================== */
@ -224,6 +222,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ========================================================================== */
#ifdef __cplusplus
}
#endif

View File

@ -26,9 +26,7 @@
#include "agent_common.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ========================================================================== */
@ -97,6 +95,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ========================================================================== */
#ifdef __cplusplus
}
#endif

View File

@ -32,19 +32,8 @@
#include "JVMTITools.h"
#include "native_thread.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x, y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#ifndef JNI_ENV_ARG1
#ifdef __cplusplus
@ -95,16 +84,14 @@ static void doRedirect(JNIEnv *env) {
result = STATUS_FAILED;
printf("(%s,%d): TEST FAILED: failed to get original JNI function table: %s\n",
__FILE__, __LINE__, TranslateError(err));
JNI_ENV_PTR(env)->FatalError(JNI_ENV_ARG(env,
"failed to get original JNI function table"));
env->FatalError("failed to get original JNI function table");
}
if ((err = jvmti->GetJNIFunctionTable(&redir_jni_functions)) !=
JVMTI_ERROR_NONE) {
result = STATUS_FAILED;
printf("(%s,%d): TEST FAILED: failed to get redirected JNI function table: %s\n",
__FILE__, __LINE__, TranslateError(err));
JNI_ENV_PTR(env)->FatalError(JNI_ENV_ARG(env,
"failed to get redirected JNI function table"));
env->FatalError("failed to get redirected JNI function table");
}
if (verbose)
printf("doRedirect: the JNI function table obtained successfully\n");
@ -118,8 +105,7 @@ static void doRedirect(JNIEnv *env) {
result = STATUS_FAILED;
printf("(%s,%d): TEST FAILED: failed to get new JNI function table: %s\n",
__FILE__, __LINE__, TranslateError(err));
JNI_ENV_PTR(env)->FatalError(JNI_ENV_ARG(env,
"failed to get new JNI function table"));
env->FatalError("failed to get new JNI function table");
}
if (verbose)
@ -136,8 +122,7 @@ static void doRestore(JNIEnv *env) {
result = STATUS_FAILED;
printf("(%s,%d): TEST FAILED: failed to restore original JNI function table: %s\n",
__FILE__, __LINE__, TranslateError(err));
JNI_ENV_PTR(env)->FatalError(JNI_ENV_ARG(env,
"failed to restore original JNI function table"));
env->FatalError("failed to restore original JNI function table");
}
if (verbose)
printf("doRestore: the original JNI function table is restored successfully\n");
@ -155,8 +140,7 @@ static void checkRedir(JNIEnv *env, int exCalls) {
result = STATUS_FAILED;
printf("(%s,%d): TEST FAILED: failed to get modified JNI function table: %s\n",
__FILE__, __LINE__, TranslateError(err));
JNI_ENV_PTR(env)->FatalError(JNI_ENV_ARG(env,
"failed to get modified JNI function table"));
env->FatalError("failed to get modified JNI function table");
}
if (verbose)
printf("checkRedir: the JNI function table obtained successfully\n\tcalling GetVersion() ...\n");
@ -222,8 +206,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
if (verbose)
printf("verbose mode on\n");
res = JNI_ENV_PTR(jvm)->
GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti), JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("(%s,%d): Failed to call GetEnv\n", __FILE__, __LINE__);
return JNI_ERR;
@ -232,6 +215,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
return JNI_OK;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,19 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x, y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#ifndef JNI_ENV_ARG1
#ifdef __cplusplus
@ -100,9 +89,7 @@ Java_nsk_jvmti_GetJNIFunctionTable_getjniftab002_check(JNIEnv *env, jobject obj)
only since JDK 1.2 */
if (verbose)
printf("\nb) Checking the function with the detached thread ...\n\ndetaching the main thread ...\n");
if ((err =
JNI_ENV_PTR(vm)->DetachCurrentThread(
JNI_ENV_ARG1(vm))) != 0)
if ((err = vm->DetachCurrentThread(JNI_ENV_ARG1(vm))) != 0)
printf("(%s,%d): Warning: DetachCurrentThread() returns: %d\n\
\tcheck with the detached main thread skipped\n",
__FILE__, __LINE__, err);
@ -111,9 +98,7 @@ Java_nsk_jvmti_GetJNIFunctionTable_getjniftab002_check(JNIEnv *env, jobject obj)
if (verbose)
printf("\nattaching the main thread back ...\n");
if ((err =
JNI_ENV_PTR(vm)->AttachCurrentThread(
JNI_ENV_ARG(vm, (void **) &nextEnv), (void *) 0)) != 0) {
if ((err = vm->AttachCurrentThread((void **) &nextEnv, (void *) 0)) != 0) {
printf("(%s,%d): TEST FAILURE: waitingThread: AttachCurrentThread() returns: %d\n",
__FILE__, __LINE__, err);
return STATUS_FAILED;
@ -143,8 +128,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
if (verbose)
printf("verbose mode on\n");
res = JNI_ENV_PTR(jvm)->
GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti), JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("(%s,%d): Failed to call GetEnv\n", __FILE__, __LINE__);
return JNI_ERR;
@ -155,6 +139,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
return JNI_OK;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -76,11 +63,9 @@ void checkMeth(JNIEnv *env, jclass cl, const char *name, const char *sig,
jvmtiLineNumberEntry *exp_table = meth_tab[meth_ind].table;
if (stat) {
mid = JNI_ENV_PTR(env)->
GetStaticMethodID(JNI_ENV_ARG(env, cl), name, sig);
mid = env->GetStaticMethodID(cl, name, sig);
} else {
mid = JNI_ENV_PTR(env)->
GetMethodID(JNI_ENV_ARG(env, cl), name, sig);
mid = env->GetMethodID(cl, name, sig);
}
if (mid == NULL) {
printf("Name = %s, sig = %s: mid = NULL\n", name, sig);
@ -146,8 +131,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jvmtiError err;
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -188,6 +172,4 @@ Java_nsk_jvmti_GetLineNumberTable_linetab001_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -70,8 +57,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -121,7 +107,7 @@ Java_nsk_jvmti_GetLineNumberTable_linetab002_check(JNIEnv *env, jclass cls) {
return result;
}
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), "<init>", "()V");
mid = env->GetMethodID(cls, "<init>", "()V");
if (mid == NULL) {
printf("Cannot get method ID!\n");
return STATUS_FAILED;
@ -164,6 +150,4 @@ Java_nsk_jvmti_GetLineNumberTable_linetab002_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -70,8 +57,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -122,7 +108,7 @@ Java_nsk_jvmti_GetLineNumberTable_linetab003_check(JNIEnv *env, jclass cls) {
return result;
}
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), "meth", "()I");
mid = env->GetMethodID(cls, "meth", "()I");
if (mid == NULL) {
printf("Cannot get method ID!\n");
return STATUS_FAILED;
@ -153,6 +139,4 @@ Java_nsk_jvmti_GetLineNumberTable_linetab003_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -115,6 +101,4 @@ Java_nsk_jvmti_GetLoadedClasses_loadedclss001_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "agent_common.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ========================================================================== */
@ -168,6 +166,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ========================================================================== */
#ifdef __cplusplus
}
#endif

View File

@ -27,31 +27,11 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#define JNI_EARG(x)
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#define JNI_EARG(x) x
#endif
#endif
#ifndef JNI_EARG
#ifdef __cplusplus
#define JNI_EARG(x)
#else
#define JNI_EARG(x) x
#endif
#endif
@ -190,15 +170,14 @@ void check3(jvmtiEnv *jvmti_env, JNIEnv *env, jthread thr, jint depth,
result = STATUS_FAILED;
continue;
}
fid = JNI_ENV_PTR(env)->GetFieldID(JNI_ENV_ARG(env, cls),
"fld", "I");
fid = env->GetFieldID(cls, "fld", "I");
if (fid == NULL) {
printf("Cannot find ID for \"fld\" field of meth03\n");
JNI_ENV_PTR(env)->ExceptionClear(JNI_EARG(env));
env->ExceptionClear();
result = STATUS_FAILED;
continue;
}
fldVal = JNI_ENV_PTR(env)->GetIntField(JNI_ENV_ARG(env, ob1), fid);
fldVal = env->GetIntField(ob1, fid);
} else if (strcmp(table[i].name, "ob2") == 0) {
err = jvmti_env->GetLocalObject(thr, depth,
table[i].slot, &ob2);
@ -207,8 +186,7 @@ void check3(jvmtiEnv *jvmti_env, JNIEnv *env, jthread thr, jint depth,
TranslateError(err), err);
result = STATUS_FAILED;
}
JNI_ENV_PTR(env)->GetIntArrayRegion(JNI_ENV_ARG(env, (jintArray) ob2),
0, 10, arr);
env->GetIntArrayRegion((jintArray) ob2, 0, 10, arr);
}
}
if ((fldVal != 17) || (arr[2] != 8)) {
@ -423,8 +401,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -482,25 +459,19 @@ Java_nsk_jvmti_GetLocalVariable_getlocal001_getMeth(JNIEnv *env, jclass cls,
fval = f;
dval = d;
mid1 = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls),
"meth01", "()D");
mid2 = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls),
"meth02", "(I)V");
mid3 = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
"meth03", "(Lnsk/jvmti/GetLocalVariable/getlocal001;)V");
mid4 = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
"meth04", "(IJSDCFBZ)V");
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
"checkPoint", "()V");
mid1 = env->GetMethodID(cls, "meth01", "()D");
mid2 = env->GetMethodID(cls, "meth02", "(I)V");
mid3 = env->GetStaticMethodID(cls, "meth03", "(Lnsk/jvmti/GetLocalVariable/getlocal001;)V");
mid4 = env->GetStaticMethodID(cls, "meth04", "(IJSDCFBZ)V");
mid = env->GetStaticMethodID(cls, "checkPoint", "()V");
if (mid == 0 || mid1 == 0 || mid2 == 0 || mid3 == 0 || mid4 == 0) {
printf("Cannot find Method ID for a method\n");
JNI_ENV_PTR(env)->ExceptionDescribe(JNI_EARG(env));
JNI_ENV_PTR(env)->ExceptionClear(JNI_EARG(env));
env->ExceptionDescribe();
env->ExceptionClear();
result = STATUS_FAILED;
return;
}
err = jvmti->SetEventNotificationMode(JVMTI_ENABLE,
JVMTI_EVENT_METHOD_EXIT, NULL);
err = jvmti->SetEventNotificationMode(JVMTI_ENABLE, JVMTI_EVENT_METHOD_EXIT, NULL);
if (err != JVMTI_ERROR_NONE) {
printf("Failed to enable METHOD_EXIT event: %s (%d)\n",
TranslateError(err), err);
@ -526,6 +497,4 @@ Java_nsk_jvmti_GetLocalVariable_getlocal001_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -146,8 +133,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -204,7 +190,7 @@ Java_nsk_jvmti_GetLocalVariable_getlocal002_getMeth(JNIEnv *env, jclass cls) {
if (!caps.can_access_local_variables ||
!caps.can_generate_method_exit_events) return;
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), "meth01", "()D");
mid = env->GetMethodID(cls, "meth01", "()D");
if (mid == NULL) {
printf("Cannot find Method ID for meth01\n");
result = STATUS_FAILED;
@ -233,8 +219,7 @@ Java_nsk_jvmti_GetLocalVariable_getlocal002_checkLoc(JNIEnv *env,
return;
}
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
"meth02", "()V");
mid = env->GetStaticMethodID(cls, "meth02", "()V");
if (mid == NULL) {
printf("Cannot find Method ID for meth02\n");
result = STATUS_FAILED;
@ -287,6 +272,4 @@ Java_nsk_jvmti_GetLocalVariable_getlocal002_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -115,9 +102,9 @@ void checkMeth(JNIEnv *env, jclass cl, const char *name, const char *sig,
jvmtiLocalVariableEntry *exp_table = meth_tab[meth_ind].table;
if (stat) {
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cl), name, sig);
mid = env->GetStaticMethodID(cl, name, sig);
} else {
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cl), name, sig);
mid = env->GetMethodID(cl, name, sig);
}
if (mid == NULL) {
printf("Name = %s, sig = %s: mid = NULL\n", name, sig);
@ -206,8 +193,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jint res;
jvmtiError err;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -257,6 +243,4 @@ Java_nsk_jvmti_GetLocalVariableTable_localtab001_getRes(JNIEnv *env, jclass cls)
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -70,8 +57,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -119,7 +105,7 @@ Java_nsk_jvmti_GetLocalVariableTable_localtab002_check(JNIEnv *env, jclass cls)
if (!caps.can_access_local_variables) return result;
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), "<init>", "()V");
mid = env->GetMethodID(cls, "<init>", "()V");
if (mid == NULL) {
printf("Cannot get method ID for \"<init>\"!\n");
return STATUS_FAILED;
@ -155,8 +141,7 @@ Java_nsk_jvmti_GetLocalVariableTable_localtab002_check(JNIEnv *env, jclass cls)
result = STATUS_FAILED;
}
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
"check", "()I");
mid = env->GetStaticMethodID(cls, "check", "()I");
if (mid == NULL) {
printf("Cannot get method ID for \"check\"!\n");
return STATUS_FAILED;
@ -179,6 +164,4 @@ Java_nsk_jvmti_GetLocalVariableTable_localtab002_check(JNIEnv *env, jclass cls)
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -70,8 +57,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -120,7 +106,7 @@ Java_nsk_jvmti_GetLocalVariableTable_localtab003_check(JNIEnv *env, jclass cls)
if (!caps.can_access_local_variables) return result;
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), "meth", "()I");
mid = env->GetMethodID(cls, "meth", "()I");
if (mid == NULL) {
printf("Cannot get method ID!\n");
return STATUS_FAILED;
@ -154,6 +140,4 @@ Java_nsk_jvmti_GetLocalVariableTable_localtab003_check(JNIEnv *env, jclass cls)
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -30,9 +30,7 @@
#include "JVMTITools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
#define METH_NUM 3 /* overall number of methods */
@ -221,6 +219,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
return JNI_OK;
}
#ifdef __cplusplus
}
#endif

View File

@ -30,9 +30,7 @@
#include "JVMTITools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
#define METH_NUM 3 /* overall number of methods */
@ -242,6 +240,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
return JNI_OK;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -55,9 +42,9 @@ void checkMeth(JNIEnv *env, jclass cl, const char *name, const char *sig, int st
jint ret_loc;
if (stat) {
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cl), name, sig);
mid = env->GetStaticMethodID(cl, name, sig);
} else {
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cl), name, sig);
mid = env->GetMethodID(cl, name, sig);
}
if (mid == NULL) {
printf("Name = %s, sig = %s: mid = 0\n", name, sig);
@ -89,8 +76,7 @@ JNIEXPORT jint JNI_OnLoad_maxloc001(JavaVM *jvm, char *options, void *reserved)
jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -108,16 +94,12 @@ Java_nsk_jvmti_GetMaxLocals_maxloc001_check(JNIEnv *env, jclass cls) {
checkMeth(env, cls, "meth_stat", "(ILjava/lang/String;)[F", 1, 3);
checkMeth(env, cls, "meth_1", "(C)C", 0, 4);
checkMeth(env, cls, "meth_2", "(FF)F", 0, 6);
clsId = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
"nsk/jvmti/GetMaxLocals/maxloc001a"));
clsId = env->FindClass("nsk/jvmti/GetMaxLocals/maxloc001a");
checkMeth(env, clsId, "meth_new", "()Lnsk/jvmti/GetMaxLocals/maxloc001;", 0, 3);
checkMeth(env, clsId, "meth_abs", "()V", 0, 0);
clsId = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
"nsk/jvmti/GetMaxLocals/maxloc001$Inn"));
clsId = env->FindClass("nsk/jvmti/GetMaxLocals/maxloc001$Inn");
checkMeth(env, clsId, "meth_inn", "(Ljava/lang/String;)V", 0, 2);
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -89,7 +75,7 @@ Java_nsk_jvmti_GetMaxLocals_maxloc002_check(JNIEnv *env, jclass cls) {
return STATUS_FAILED;
}
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), "<init>", "()V");
mid = env->GetMethodID(cls, "<init>", "()V");
if (mid == NULL) {
printf("Cannot get method ID for \"<init>\"!\n");
return STATUS_FAILED;
@ -115,8 +101,7 @@ Java_nsk_jvmti_GetMaxLocals_maxloc002_check(JNIEnv *env, jclass cls) {
result = STATUS_FAILED;
}
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
"check", "()I");
mid = env->GetStaticMethodID(cls, "check", "()I");
if (mid == NULL) {
printf("Cannot get method ID for \"check\"!\n");
return STATUS_FAILED;
@ -139,6 +124,4 @@ Java_nsk_jvmti_GetMaxLocals_maxloc002_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -56,12 +43,11 @@ void checkMeth(JNIEnv *env, const char *cl_name, const char *name, const char *s
char *cl_sig, *generic;
jclass cl, ret_decl_cl;
cl = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, cl_name));
cl = env->FindClass(cl_name);
if (stat) {
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cl),
name, sig);
mid = env->GetStaticMethodID(cl, name, sig);
} else {
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cl), name, sig);
mid = env->GetMethodID(cl, name, sig);
}
if (mid == NULL) {
printf("%s.%s%s: mid = NULL\n", cl_name, name, sig);
@ -108,8 +94,7 @@ JNIEXPORT jint JNI_OnLoad_declcls001(JavaVM *jvm, char *options, void *reserved)
jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -139,6 +124,4 @@ Java_nsk_jvmti_GetMethodDeclaringClass_declcls001_check(JNIEnv *env, jclass cls)
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -89,8 +75,7 @@ Java_nsk_jvmti_GetMethodDeclaringClass_declcls002_check(JNIEnv *env, jclass cls)
return STATUS_FAILED;
}
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls),
"<init>", "()V");
mid = env->GetMethodID(cls, "<init>", "()V");
if (mid == NULL) {
printf("Cannot get method ID!\n");
return STATUS_FAILED;
@ -123,6 +108,4 @@ Java_nsk_jvmti_GetMethodDeclaringClass_declcls002_check(JNIEnv *env, jclass cls)
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -66,8 +53,8 @@ void do_check(JNIEnv *env, const char *name, const char *meth, const char *sig)
printf(">>> checking: %s.%s%s\n", name, meth, sig);
}
cl = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env, name));
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cl), meth, sig);
cl = env->FindClass(name);
mid = env->GetMethodID(cl, meth, sig);
if (mid == NULL) {
printf("%s.%s%s: mid = NULL\n", name, meth, sig);
result = STATUS_FAILED;
@ -122,8 +109,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -153,6 +139,4 @@ Java_nsk_jvmti_GetMethodDeclaringClass_declcls003_check(JNIEnv *env, jclass cls)
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -25,21 +25,8 @@
#include "jvmti.h"
#include "agent_common.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,10 +55,9 @@ void checkMeth(JNIEnv *env, jclass cl, const char *name, const char *sig,
jlocation exp_end = meth_tab[meth_ind].end;
if (stat) {
mid = JNI_ENV_PTR(env)->
GetStaticMethodID(JNI_ENV_ARG(env, cl), name, sig);
mid = env->GetStaticMethodID(cl, name, sig);
} else {
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cl), name, sig);
mid = env->GetMethodID(cl, name, sig);
}
if (mid == NULL) {
printf("Name = %s, sig = %s: mid = NULL\n", name, sig);
@ -116,8 +102,7 @@ JNIEXPORT jint JNI_OnLoad_methloc001(JavaVM *jvm, char *options, void *reserved)
jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -133,6 +118,4 @@ JNIEXPORT jint JNICALL Java_nsk_jvmti_GetMethodLocation_methloc001_check(JNIEnv
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -90,7 +76,7 @@ Java_nsk_jvmti_GetMethodLocation_methloc002_check(JNIEnv *env, jclass cls) {
return STATUS_FAILED;
}
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls), "<init>", "()V");
mid = env->GetMethodID(cls, "<init>", "()V");
if (mid == NULL) {
printf("Cannot get method ID for \"<init>\"!\n");
return STATUS_FAILED;
@ -126,8 +112,7 @@ Java_nsk_jvmti_GetMethodLocation_methloc002_check(JNIEnv *env, jclass cls) {
result = STATUS_FAILED;
}
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
"check", "()I");
mid = env->GetStaticMethodID(cls, "check", "()I");
if (mid == NULL) {
printf("Cannot get method ID for \"check\"!\n");
return STATUS_FAILED;
@ -150,6 +135,4 @@ Java_nsk_jvmti_GetMethodLocation_methloc002_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -81,10 +68,9 @@ void checkMeth(jvmtiEnv *jvmti_env, JNIEnv *env, jclass cl,
jint modifiers;
if (stat) {
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cl),
name, sig);
mid = env->GetStaticMethodID(cl, name, sig);
} else {
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cl), name, sig);
mid = env->GetMethodID(cl, name, sig);
}
if (mid == NULL) {
printf("Cannot find MethodID for \"%s%s\"\n", name, sig);
@ -155,8 +141,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -188,19 +173,13 @@ JNIEXPORT jint JNICALL Java_nsk_jvmti_GetMethodModifiers_methmod001_check(JNIEnv
checkMeth(jvmti, env, cls, "meth_1", "(C)C", 0, ACC_PRIVATE);
checkMeth(jvmti, env, cls, "meth_2", "(FF)F", 0, ACC_STRICT);
checkMeth(jvmti, env, cls, "check", "()I", 1, ACC_NATIVE | ACC_STATIC);
clsId = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
"nsk/jvmti/GetMethodModifiers/methmod001a"));
checkMeth(jvmti, env, clsId, "meth_new",
"()Lnsk/jvmti/GetMethodModifiers/methmod001;", 0, ACC_SYNCHRONIZED);
clsId = env->FindClass("nsk/jvmti/GetMethodModifiers/methmod001a");
checkMeth(jvmti, env, clsId, "meth_new", "()Lnsk/jvmti/GetMethodModifiers/methmod001;", 0, ACC_SYNCHRONIZED);
checkMeth(jvmti, env, clsId, "meth_abs", "()V", 0, ACC_ABSTRACT);
clsId = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
"nsk/jvmti/GetMethodModifiers/methmod001$Inn"));
checkMeth(jvmti, env, clsId, "meth_inn", "(Ljava/lang/String;)V",
0, ACC_PUBLIC | ACC_SYNCHRONIZED | ACC_FINAL);
clsId = env->FindClass("nsk/jvmti/GetMethodModifiers/methmod001$Inn");
checkMeth(jvmti, env, clsId, "meth_inn", "(Ljava/lang/String;)V", 0, ACC_PUBLIC | ACC_SYNCHRONIZED | ACC_FINAL);
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -89,8 +75,7 @@ Java_nsk_jvmti_GetMethodModifiers_methmod002_check(JNIEnv *env, jclass cls) {
return STATUS_FAILED;
}
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls),
"<init>", "()V");
mid = env->GetMethodID(cls, "<init>", "()V");
if (mid == NULL) {
printf("Cannot get method ID!\n");
return STATUS_FAILED;
@ -123,6 +108,4 @@ Java_nsk_jvmti_GetMethodModifiers_methmod002_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -59,10 +46,9 @@ void checkMeth(jvmtiEnv *jvmti_env, JNIEnv *env, jclass cl,
char *ret_name, *ret_sig, *generic;
if (stat) {
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cl),
name, sig);
mid = env->GetStaticMethodID(cl, name, sig);
} else {
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cl), name, sig);
mid = env->GetMethodID(cl, name, sig);
}
if (mid == NULL) {
printf("Cannot find MethodID for \"%s%s\"\n", name, sig);
@ -133,8 +119,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -166,17 +151,12 @@ Java_nsk_jvmti_GetMethodName_methname001_check(JNIEnv *env, jclass cls) {
checkMeth(jvmti, env, cls, "<init>", "()V", 0);
checkMeth(jvmti, env, cls, "meth_1", "(C)C", 0);
checkMeth(jvmti, env, cls, "meth_1", "(CC)C", 0);
clsId = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
"nsk/jvmti/GetMethodName/methname001a"));
checkMeth(jvmti, env, clsId, "meth_new",
"()Lnsk/jvmti/GetMethodName/methname001;", 0);
clsId = JNI_ENV_PTR(env)->FindClass(JNI_ENV_ARG(env,
"nsk/jvmti/GetMethodName/methname001$Inn"));
clsId = env->FindClass("nsk/jvmti/GetMethodName/methname001a");
checkMeth(jvmti, env, clsId, "meth_new", "()Lnsk/jvmti/GetMethodName/methname001;", 0);
clsId = env->FindClass("nsk/jvmti/GetMethodName/methname001$Inn");
checkMeth(jvmti, env, clsId, "meth_inn", "(Ljava/lang/String;)V", 0);
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -89,8 +75,7 @@ Java_nsk_jvmti_GetMethodName_methname002_check(JNIEnv *env, jclass cls) {
return STATUS_FAILED;
}
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, cls),
"<init>", "()V");
mid = env->GetMethodID(cls, "<init>", "()V");
if (mid == NULL) {
printf("Cannot get method ID!\n");
return STATUS_FAILED;
@ -171,6 +156,4 @@ Java_nsk_jvmti_GetMethodName_methname002_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -31,9 +31,7 @@
#include "JVMTITools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* number of tested methods in particular class */
#define METH_NUM 2
@ -201,6 +199,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
return JNI_OK;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -210,6 +208,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x,y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x,y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -70,8 +57,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -159,8 +145,7 @@ Java_nsk_jvmti_GetObjectMonitorUsage_objmonusage001_check(JNIEnv *env,
}
}
if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, owner),
inf.owner) != JNI_TRUE) {
if (!env->IsSameObject(owner, inf.owner)) {
jvmti->GetThreadInfo(inf.owner, &tinf);
printf("(%d) unexpected owner: %s (0x%p)\n", i, tinf.name, inf.owner);
result = STATUS_FAILED;
@ -184,6 +169,4 @@ Java_nsk_jvmti_GetObjectMonitorUsage_objmonusage001_getResult(JNIEnv *env, jclas
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -70,8 +57,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -145,6 +131,4 @@ Java_nsk_jvmti_GetObjectMonitorUsage_objmonusage002_check(JNIEnv *env,
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -71,8 +58,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -149,8 +135,7 @@ Java_nsk_jvmti_GetObjectMonitorUsage_objmonusage003_check(JNIEnv *env,
}
}
if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, owner),
inf.owner) != JNI_TRUE) {
if (!env->IsSameObject(owner, inf.owner)) {
printf("(%d) unexpected owner: 0x%p\n", count, inf.owner);
result = STATUS_FAILED;
}
@ -173,6 +158,4 @@ Java_nsk_jvmti_GetObjectMonitorUsage_objmonusage003_getRes(JNIEnv *env, jclass c
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -71,8 +58,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -149,8 +135,7 @@ Java_nsk_jvmti_GetObjectMonitorUsage_objmonusage004_check(JNIEnv *env,
}
}
if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, owner),
inf.owner) != JNI_TRUE) {
if (!env->IsSameObject(owner, inf.owner)) {
printf("(%d) unexpected owner: 0x%p\n", count, inf.owner);
result = STATUS_FAILED;
}
@ -173,6 +158,4 @@ Java_nsk_jvmti_GetObjectMonitorUsage_objmonusage004_getRes(JNIEnv *env, jclass c
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -65,8 +52,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jint res;
jvmtiError err;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -121,6 +107,4 @@ Java_nsk_jvmti_GetObjectMonitorUsage_objmonusage005_getRes(JNIEnv *env, jclass c
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -65,8 +52,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jint res;
jvmtiError err;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -121,6 +107,4 @@ Java_nsk_jvmti_GetObjectMonitorUsage_objmonusage006_getRes(JNIEnv *env, jclass c
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -208,6 +206,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -472,6 +470,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -65,8 +52,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jint res;
jvmtiError err;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -139,8 +125,7 @@ Java_nsk_jvmti_GetOwnedMonitorInfo_ownmoninf001_checkMon1(JNIEnv *env,
if ((monitors = getInfo(env, point, thr, 1)) == NULL) {
return;
}
if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, lock), monitors[0])
== JNI_FALSE) {
if (!env->IsSameObject(lock, monitors[0])) {
result = STATUS_FAILED;
printf("Point %d: not expected monitor: 0x%p\n", point, monitors[0]);
}
@ -153,19 +138,12 @@ Java_nsk_jvmti_GetOwnedMonitorInfo_ownmoninf001_checkMon2(JNIEnv *env,
if ((monitors = getInfo(env, point, thr, 2)) == NULL) {
return;
}
if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, lock1), monitors[0])
== JNI_FALSE &&
JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, lock2), monitors[0])
== JNI_FALSE) {
if (!env->IsSameObject(lock1, monitors[0]) && !env->IsSameObject(lock2, monitors[0])) {
result = STATUS_FAILED;
printf("Point %d: not expected monitor: 0x%p\n", point, monitors[0]);
}
if ((JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, lock1), monitors[1])
== JNI_FALSE &&
JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, lock2), monitors[1])
== JNI_FALSE) ||
JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, monitors[0]),
monitors[1]) == JNI_TRUE) {
if ((!env->IsSameObject(lock1, monitors[1]) && !env->IsSameObject(lock2, monitors[1]))
|| env->IsSameObject(monitors[0], monitors[1])) {
result = STATUS_FAILED;
printf("Point %d: not expected monitor: 0x%p\n", point, monitors[1]);
}
@ -176,6 +154,4 @@ Java_nsk_jvmti_GetOwnedMonitorInfo_ownmoninf001_getRes(JNIEnv *env, jclass cls)
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -65,8 +52,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jint res;
jvmtiError err;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -124,6 +110,4 @@ Java_nsk_jvmti_GetOwnedMonitorInfo_ownmoninf002_getRes(JNIEnv *env, jclass cls)
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -70,8 +57,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -160,6 +146,4 @@ Java_nsk_jvmti_GetOwnedMonitorInfo_ownmoninf003_check(JNIEnv *env,
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -26,9 +26,7 @@
#include "agent_common.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ========================================================================== */
@ -384,6 +382,4 @@ Agent_OnUnload(JavaVM *jvm)
/* ========================================================================== */
#ifdef __cplusplus
}
#endif

View File

@ -26,9 +26,7 @@
#include "agent_common.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ========================================================================== */
@ -97,6 +95,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ========================================================================== */
#ifdef __cplusplus
}
#endif

View File

@ -28,9 +28,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -260,6 +258,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define STATUS_FAILED 2
#define PASSED 0
@ -65,8 +52,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jvmtiError err;
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -138,6 +124,4 @@ Java_nsk_jvmti_GetSourceDebugExtension_srcdebugex001_getSrcDebugX(JNIEnv *env,
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define STATUS_FAILED 2
#define PASSED 0
@ -65,8 +52,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jvmtiError err;
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -149,6 +135,4 @@ Java_nsk_jvmti_GetSourceDebugExtension_srcdebugex002_getSrcDebugX(JNIEnv *env,
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define STATUS_FAILED 2
#define PASSED 0
@ -67,8 +54,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jvmtiError err;
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -144,6 +130,4 @@ Java_nsk_jvmti_GetSourceDebugExtension_srcdebugex003_getSrcDebugX(JNIEnv *env,
return (result);
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -70,8 +57,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
code = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
code = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (code != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -150,6 +136,4 @@ Java_nsk_jvmti_GetSourceFileName_getsrcfn004_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -70,8 +57,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
code = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
code = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (code != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -136,6 +122,4 @@ JNIEXPORT int JNICALL Java_nsk_jvmti_GetSourceFileName_getsrcfn005_getRes(JNIEnv
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -76,8 +63,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
code = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
code = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (code != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -145,6 +131,4 @@ JNIEXPORT int JNICALL Java_nsk_jvmti_GetSourceFileName_getsrcfn006_getRes(JNIEnv
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -86,8 +73,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -100,9 +86,8 @@ JNIEXPORT jint JNICALL
Java_nsk_jvmti_GetStackTrace_getstacktr001_chain(JNIEnv *env, jclass cls) {
jmethodID mid;
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
"dummy", "()V");
JNI_ENV_PTR(env)->CallStaticVoidMethod(JNI_ENV_ARG(env, cls), mid);
mid = env->GetStaticMethodID(cls, "dummy", "()V");
env->CallStaticVoidMethod(cls, mid);
return result;
}
@ -186,6 +171,4 @@ Java_nsk_jvmti_GetStackTrace_getstacktr001_check(JNIEnv *env, jclass cls, jthrea
}
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -136,6 +122,4 @@ Java_nsk_jvmti_GetStackTrace_getstacktr002_check(JNIEnv *env, jclass cls, jthrea
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -85,8 +72,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -124,12 +110,11 @@ JNIEXPORT void JNICALL
Java_nsk_jvmti_GetStackTrace_getstacktr003_chain(JNIEnv *env, jclass cls) {
jmethodID mid;
mid = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, cls),
"dummy", "()V");
mid = env->GetStaticMethodID(cls, "dummy", "()V");
if (mid == NULL) {
printf("Could not find method ID for dummy()V!\n");
} else {
JNI_ENV_PTR(env)->CallStaticVoidMethod(JNI_ENV_ARG(env, cls), mid);
env->CallStaticVoidMethod(cls, mid);
}
return;
@ -235,6 +220,4 @@ Java_nsk_jvmti_GetStackTrace_getstacktr003_check(JNIEnv *env, jclass cls, jthrea
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -174,8 +161,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -231,8 +217,7 @@ Java_nsk_jvmti_GetStackTrace_getstacktr004_getReady(JNIEnv *env, jclass cls, jcl
return;
}
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, clazz),
"checkPoint", "()V");
mid = env->GetMethodID(clazz, "checkPoint", "()V");
if (mid == NULL) {
printf("Cannot find Method ID for method checkPoint\n");
result = STATUS_FAILED;
@ -260,6 +245,4 @@ Java_nsk_jvmti_GetStackTrace_getstacktr004_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -223,8 +210,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -283,8 +269,7 @@ Java_nsk_jvmti_GetStackTrace_getstacktr005_getReady(JNIEnv *env, jclass cls, jcl
return;
}
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, clazz),
"checkPoint", "()V");
mid = env->GetMethodID(clazz, "checkPoint", "()V");
if (mid == NULL) {
printf("Cannot find Method ID for method checkPoint\n");
result = STATUS_FAILED;
@ -312,6 +297,4 @@ Java_nsk_jvmti_GetStackTrace_getstacktr005_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -229,8 +216,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -290,8 +276,7 @@ Java_nsk_jvmti_GetStackTrace_getstacktr006_getReady(JNIEnv *env, jclass cls, jcl
return;
}
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, clazz),
"checkPoint", "()V");
mid = env->GetMethodID(clazz, "checkPoint", "()V");
if (mid == NULL) {
printf("Cannot find Method ID for method checkPoint\n");
result = STATUS_FAILED;
@ -320,6 +305,4 @@ Java_nsk_jvmti_GetStackTrace_getstacktr006_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -183,10 +170,8 @@ void JNICALL Breakpoint(jvmtiEnv *jvmti_env, JNIEnv *env,
classDef.klass = klass;
classDef.class_byte_count =
JNI_ENV_PTR(env)->GetArrayLength(JNI_ENV_ARG((JNIEnv *)env, classBytes));
classDef.class_bytes = (unsigned char*)
JNI_ENV_PTR(env)->GetByteArrayElements(JNI_ENV_ARG((JNIEnv *)env,
classBytes), NULL);
env->GetArrayLength(classBytes);
classDef.class_bytes = (unsigned char*) env->GetByteArrayElements(classBytes, NULL);
err = jvmti->RedefineClasses(1, &classDef);
if (err != JVMTI_ERROR_NONE) {
@ -195,7 +180,7 @@ void JNICALL Breakpoint(jvmtiEnv *jvmti_env, JNIEnv *env,
result = STATUS_FAILED;
return;
}
JNI_ENV_PTR(env)->DeleteGlobalRef(JNI_ENV_ARG((JNIEnv *)env, classBytes));
env->DeleteGlobalRef(classBytes);
classBytes = NULL;
check(jvmti_env, thr);
@ -220,8 +205,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -278,10 +262,9 @@ Java_nsk_jvmti_GetStackTrace_getstacktr007_getReady(JNIEnv *env, jclass cls,
return;
}
classBytes = (jbyteArray) JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG(env, bytes));
classBytes = (jbyteArray) env->NewGlobalRef(bytes);
mid = JNI_ENV_PTR(env)->GetMethodID(JNI_ENV_ARG(env, clazz),
"checkPoint", "()V");
mid = env->GetMethodID(clazz, "checkPoint", "()V");
if (mid == NULL) {
printf("Cannot find Method ID for method checkPoint\n");
result = STATUS_FAILED;
@ -310,6 +293,4 @@ Java_nsk_jvmti_GetStackTrace_getstacktr007_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -250,11 +237,8 @@ void JNICALL SingleStep(jvmtiEnv *jvmti_env, JNIEnv *env,
printf(">>> redefining class ...\n");
}
classDef.klass = klass;
classDef.class_byte_count =
JNI_ENV_PTR(env)->GetArrayLength(JNI_ENV_ARG((JNIEnv *)env, classBytes));
classDef.class_bytes = (unsigned char*)
JNI_ENV_PTR(env)->GetByteArrayElements(JNI_ENV_ARG((JNIEnv *)env,
classBytes), NULL);
classDef.class_byte_count = env->GetArrayLength(classBytes);
classDef.class_bytes = (unsigned char*) env->GetByteArrayElements(classBytes, NULL);
err = jvmti->RedefineClasses(1, &classDef);
if (err != JVMTI_ERROR_NONE) {
printf("(RedefineClasses) unexpected error: %s (%d)\n",
@ -262,7 +246,7 @@ void JNICALL SingleStep(jvmtiEnv *jvmti_env, JNIEnv *env,
result = STATUS_FAILED;
return;
}
JNI_ENV_PTR(env)->DeleteGlobalRef(JNI_ENV_ARG((JNIEnv *)env, classBytes));
env->DeleteGlobalRef(classBytes);
classBytes = NULL;
check(jvmti_env, thread, 2, "swap");
}
@ -287,8 +271,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -344,32 +327,30 @@ Java_nsk_jvmti_GetStackTrace_getstacktr008_getReady(JNIEnv *env, jclass cls,
return;
}
testedThread = JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG(env, thr));
testedThread = env->NewGlobalRef(thr);
if (!caps.can_generate_breakpoint_events ||
!caps.can_generate_single_step_events) {
return;
}
classBytes = (jbyteArray) JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG(env, bytes));
classBytes = (jbyteArray) env->NewGlobalRef(bytes);
clazz = JNI_ENV_PTR(env)->GetObjectClass(JNI_ENV_ARG(env, thr));
clazz = env->GetObjectClass(thr);
if (clazz == NULL) {
printf("Cannot get the class of thread object\n");
result = STATUS_FAILED;
return;
}
mid_checkPoint = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, clazz),
"checkPoint", "()V");
mid_checkPoint = env->GetStaticMethodID(clazz, "checkPoint", "()V");
if (mid_checkPoint == NULL) {
printf("Cannot find Method ID for method \"checkPoint\"\n");
result = STATUS_FAILED;
return;
}
mid_chain4 = JNI_ENV_PTR(env)->GetStaticMethodID(JNI_ENV_ARG(env, clazz),
"chain4", "()V");
mid_chain4 = env->GetStaticMethodID(clazz, "chain4", "()V");
if (mid_chain4 == NULL) {
printf("Cannot find Method ID for method \"chain4\"\n");
result = STATUS_FAILED;
@ -395,8 +376,7 @@ Java_nsk_jvmti_GetStackTrace_getstacktr008_getReady(JNIEnv *env, jclass cls,
JNIEXPORT void JNICALL
Java_nsk_jvmti_GetStackTrace_getstacktr008_nativeChain(JNIEnv *env, jclass cls) {
if (mid_chain4 != NULL) {
JNI_ENV_PTR(env)->CallStaticVoidMethod(JNI_ENV_ARG(env, cls),
mid_chain4);
env->CallStaticVoidMethod(cls, mid_chain4);
}
check(jvmti, testedThread, 3, "native");
}
@ -406,6 +386,4 @@ Java_nsk_jvmti_GetStackTrace_getstacktr008_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -119,6 +105,4 @@ Java_nsk_jvmti_GetStackTrace_getstacktr009_check(JNIEnv *env, jclass cls,
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -144,6 +142,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -176,6 +174,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -157,6 +155,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -156,6 +154,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -180,6 +178,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -28,9 +28,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -376,6 +374,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -28,9 +28,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -404,6 +402,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -28,9 +28,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -298,6 +296,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -432,6 +430,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -70,8 +57,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -117,8 +103,7 @@ Java_nsk_jvmti_GetThreadGroupInfo_thrgrpinfo001_check(JNIEnv *env, jclass cls, j
result = STATUS_FAILED;
}
if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, parent),
inf.parent) != JNI_TRUE) {
if (!env->IsSameObject(parent, inf.parent)) {
printf("(%d) parent is not the same\n", stage);
result = STATUS_FAILED;
}
@ -143,6 +128,4 @@ Java_nsk_jvmti_GetThreadGroupInfo_thrgrpinfo001_check(JNIEnv *env, jclass cls, j
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -127,6 +113,4 @@ Java_nsk_jvmti_GetThreadGroupInfo_thrgrpinfo002_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -75,8 +62,7 @@ JNIEXPORT jint JNI_OnLoad_thrinfo001(JavaVM *jvm, char *options, void *reserved)
jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -112,8 +98,7 @@ JNIEXPORT void JNICALL Java_nsk_jvmti_GetThreadInfo_thrinfo001_checkInfo(JNIEnv
threads[ind].name, threads[ind].is_daemon, inf.is_daemon);
result = STATUS_FAILED;
}
if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, group),
inf.thread_group) != JNI_TRUE) {
if (!env->IsSameObject(group, inf.thread_group)) {
printf("Thread %s: invalid thread group\n", threads[ind].name);
result = STATUS_FAILED;
}
@ -123,6 +108,4 @@ JNIEXPORT jint JNICALL Java_nsk_jvmti_GetThreadInfo_thrinfo001_getRes(JNIEnv *en
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -113,8 +99,7 @@ Java_nsk_jvmti_GetThreadInfo_thrinfo002_check(JNIEnv *env, jclass cls, jthread t
"main", 0, inf.is_daemon);
result = STATUS_FAILED;
}
if (JNI_ENV_PTR(env)->IsSameObject(JNI_ENV_ARG(env, group),
inf.thread_group) != JNI_TRUE) {
if (!env->IsSameObject(group, inf.thread_group)) {
printf("Thread %s: invalid thread group\n", "main");
result = STATUS_FAILED;
}
@ -132,6 +117,4 @@ Java_nsk_jvmti_GetThreadInfo_thrinfo002_check(JNIEnv *env, jclass cls, jthread t
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,9 +27,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -138,6 +136,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -117,7 +104,7 @@ ThreadStart(jvmtiEnv *jvmti_env, JNIEnv *env, jthread thread) {
result = STATUS_FAILED;
}
if (thrInfo.name != NULL && strcmp(thrInfo.name, "thr1") == 0) {
thr_ptr = JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG((JNIEnv *)env, thread));
thr_ptr = env->NewGlobalRef(thread);
if (printdump == JNI_TRUE) {
printf(">>> ThreadStart: \"%s\", 0x%p\n", thrInfo.name, thr_ptr);
}
@ -244,8 +231,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->
GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti), JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -437,6 +423,4 @@ Java_nsk_jvmti_GetThreadState_thrstat001_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -102,7 +89,7 @@ ThreadStart(jvmtiEnv *jvmti_env, JNIEnv *env, jthread thread) {
result = STATUS_FAILED;
}
if (thrInfo.name != NULL && strcmp(thrInfo.name, "thr1") == 0) {
thr_ptr = JNI_ENV_PTR(env)->NewGlobalRef(JNI_ENV_ARG((JNIEnv *)env, thread));
thr_ptr = env->NewGlobalRef(thread);
if (printdump == JNI_TRUE) {
printf(">>> ThreadStart: \"%s\", 0x%p\n", thrInfo.name, thr_ptr);
}
@ -135,8 +122,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv !\n");
return JNI_ERR;
@ -376,6 +362,4 @@ Java_nsk_jvmti_GetThreadState_thrstat002_getRes(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -81,8 +68,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -170,6 +156,4 @@ Java_nsk_jvmti_GetThreadState_thrstat003_check(JNIEnv *env, jclass cls,
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -111,6 +97,4 @@ Java_nsk_jvmti_GetThreadState_thrstat004_check(JNIEnv *env, jclass cls, jthread
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -33,21 +33,8 @@
#include "JVMTITools.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define THREAD_STATE_MASK ~(JVMTI_THREAD_STATE_SUSPENDED \
| JVMTI_THREAD_STATE_INTERRUPTED \
@ -113,7 +100,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
jvmtiError error;
jint res;
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &g_ppJvmtiEnv), JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &g_ppJvmtiEnv, JVMTI_VERSION_1_1);
if ( res != JNI_OK || ! g_ppJvmtiEnv ) {
printf("Agent_OnLoad: Error: GetEnv returned error or NULL\n");
return JNI_ERR;
@ -171,6 +158,4 @@ Java_nsk_jvmti_GetThreadState_thrstat005_checkThreadState(JNIEnv * pEnv, jclass
return JNI_FALSE;
}
#ifdef __cplusplus
}
#endif

View File

@ -28,9 +28,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -215,6 +213,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -28,9 +28,7 @@
#include "jni_tools.h"
#include "jvmti_tools.h"
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================= */
@ -232,6 +230,4 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
/* ============================================================================= */
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -134,6 +120,4 @@ Java_nsk_jvmti_GetTopThreadGroups_topthrgrp001_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x, y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x, y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti),
JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -116,6 +102,4 @@ Java_nsk_jvmti_GetTopThreadGroups_topthrgrp002_check(JNIEnv *env, jclass cls) {
return result;
}
#ifdef __cplusplus
}
#endif

View File

@ -27,21 +27,8 @@
#include "agent_common.h"
#include "JVMTITools.h"
#ifdef __cplusplus
extern "C" {
#endif
#ifndef JNI_ENV_ARG
#ifdef __cplusplus
#define JNI_ENV_ARG(x,y) y
#define JNI_ENV_PTR(x) x
#else
#define JNI_ENV_ARG(x,y) x,y
#define JNI_ENV_PTR(x) (*x)
#endif
#endif
#define PASSED 0
#define STATUS_FAILED 2
@ -68,8 +55,7 @@ jint Agent_Initialize(JavaVM *jvm, char *options, void *reserved) {
printdump = JNI_TRUE;
}
res = JNI_ENV_PTR(jvm)->
GetEnv(JNI_ENV_ARG(jvm, (void **) &jvmti), JVMTI_VERSION_1_1);
res = jvm->GetEnv((void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
printf("Wrong result of a valid call to GetEnv!\n");
return JNI_ERR;
@ -117,6 +103,4 @@ JNIEXPORT jint JNICALL Java_nsk_jvmti_GetVersionNumber_getvern001_check(JNIEnv *
return result;
}
#ifdef __cplusplus
}
#endif