Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8287362: FieldAccessWatch testcase failed on AIX platform #420

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2013, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -101,7 +101,7 @@ Agent_OnLoad(JavaVM* vm,
void* reserved) {

jvmtiCapabilities capa;
jvmtiEventCallbacks cbs = {0};
jvmtiEventCallbacks cbs;

(*vm)->GetEnv(vm, (void**)&jvmti, JVMTI_VERSION_1_0);

@@ -110,6 +110,7 @@ Agent_OnLoad(JavaVM* vm,
capa.can_generate_single_step_events = 1;
(*jvmti)->AddCapabilities(jvmti, &capa);

memset(&cbs, 0, sizeof(cbs));
cbs.ClassPrepare = classprepare;
cbs.Breakpoint = breakpoint;
(*jvmti)->SetEventCallbacks(jvmti, &cbs, sizeof(cbs));
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019 SAP SE and/or its affiliates. All rights reserved.
* Copyright (c) 2019, 2022 SAP SE and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -119,14 +119,15 @@ static void JNICALL onFieldAccess(jvmtiEnv *jvmti_env, JNIEnv* jni_env, jthread

JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM* vm, char* options, void* reserved) {
jvmtiCapabilities capa;
jvmtiEventCallbacks cbs = {0};
jvmtiEventCallbacks cbs;

(*vm)->GetEnv(vm, (void**)&jvmti, JVMTI_VERSION_1_0);

memset(&capa, 0, sizeof(capa));
capa.can_generate_field_access_events = 1;
(*jvmti)->AddCapabilities(jvmti, &capa);

memset(&cbs, 0, sizeof(cbs));
cbs.FieldAccess = &onFieldAccess;
(*jvmti)->SetEventCallbacks(jvmti, &cbs, sizeof(cbs));
(*jvmti)->SetEventNotificationMode(jvmti, JVMTI_ENABLE, JVMTI_EVENT_FIELD_ACCESS, NULL);
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, 2021, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -214,14 +214,15 @@ JNIEXPORT jint JNICALL
Agent_OnLoad(JavaVM *jvm, char *options, void *reserved)
{
jvmtiError err;
jvmtiCapabilities caps = {0};
jvmtiEventCallbacks callbacks = {0};
jvmtiCapabilities caps;
jvmtiEventCallbacks callbacks;
jint res = (*jvm)->GetEnv(jvm, (void **) &jvmti, JVMTI_VERSION_1_1);
if (res != JNI_OK || jvmti == NULL) {
reportError("GetEnv failed", res);
return JNI_ERR;
}

memset(&caps, 0, sizeof(caps));
caps.can_generate_field_modification_events = 1;
caps.can_generate_field_access_events = 1;
caps.can_tag_objects = 1;
@@ -231,6 +232,7 @@ Agent_OnLoad(JavaVM *jvm, char *options, void *reserved)
return JNI_ERR;
}

memset(&callbacks, 0, sizeof(callbacks));
callbacks.FieldModification = &onFieldModification;
callbacks.FieldAccess = &onFieldAccess;

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2020, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -45,7 +45,8 @@ JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *vm, char *options, void *reserved) {

if (options != NULL && strcmp(options, "maintain_original_method_order") == 0) {
printf("Enabled capability: maintain_original_method_order\n");
jvmtiCapabilities caps = {};
jvmtiCapabilities caps;
memset(&caps, 0, sizeof(caps));
caps.can_maintain_original_method_order = 1;

jvmtiError err = jvmti->AddCapabilities(&caps);