Thanks a lot! I modified the source code of SpecJVM and the agent works well now~!
2009-11-27 johnnylj98 发件人: Gregory Shimansky 发送时间: 2009-11-26 02:46:12 收件人: dev 抄送: 主题: Re: [DRLVM][JVMTI]a bug when running SpecJVM98 _201_compress IIRC VMDeath is not sent if System.exit is used by application. This is a limitation of JMVTI implementation in DRLVM. Most likely Spec uses exit to finish. > Hi all, > I'm doing some tuning work for Harmony running SpecJVM98. > I write a JVMTI agent to catch VMDeath event and do something at the end of > JVM's life, but that doesn't work(the same agent work well for hotspot). > > my agent likes bellow: > ... > static void JNICALL > callbackVMDeath(jvmtiEnv *jvmti, JNIEnv *jni) > { > assert(false); > printf("vm death\n"); > } > JNIEXPORT void JNICALL Agent_OnUnload(JavaVM *jvm) > { > assert(false); > printf("unload!"); > } > JNIEXPORT jint JNICALL Agent_OnLoad(JavaVM *jvm, char *options, void > *reserved) { > ... > error = jvmti->SetEventNotificationMode(JVMTI_ENABLE,JVMTI_EVENT_VM_DEATH, > (jthread)NULL); callbacks.VMDeath = &callbackVMDeath; > error = jvmti->SetEventCallbacks(&callbacks,(jint)sizeof(callbacks)); > ... > } > ... > The program ends correctly. This is really strange. Can anyone try this > case and explain for me? > > Thanks a lot. > > 2009-11-26 > > > > johnnylj98 >