8287362: FieldAccessWatch testcase failed on AIX platform
Reviewed-by: cjplummer, mdoerr
This commit is contained in:
parent
410a25d59a
commit
66340372d5
test/hotspot/jtreg
compiler/jsr292/cr8026328
runtime/jni/FastGetField
serviceability/jvmti
@ -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,7 +119,7 @@ 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);
|
||||
|
||||
@ -127,6 +127,7 @@ JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM* vm, char* options, void* reserved) {
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user