Esempio n. 1
0
JNIEXPORT void JNICALL Java_org_gontard_fluorescein_Fluorescein_printPathToRoot(JNIEnv *env, jclass fluoresceinClass, jstring className)
{
	printf("Java_org_gontard_fluorescein_Fluorescein_printPathToRoot\n");
	gdata->classname = (char*)calloc(100, 1);
	strcpy(gdata->classname, env->GetStringUTFChars(className, 0));	
    dataDumpRequest(gdata->jvmti);
}
/* Callback for JVMTI_EVENT_VM_DEATH */
static void JNICALL
vmDeath(jvmtiEnv *jvmti, JNIEnv *env)
{
    jvmtiError          err;

    /* Make sure everything has been garbage collected */
    err = (*jvmti)->ForceGarbageCollection(jvmti);
    check_jvmti_error(jvmti, err, "force garbage collection");

    /* Disable events and dump the heap information */
    enterAgentMonitor(jvmti); {
        err = (*jvmti)->SetEventNotificationMode(jvmti, JVMTI_DISABLE,
                            JVMTI_EVENT_DATA_DUMP_REQUEST, NULL);
        check_jvmti_error(jvmti, err, "set event notification");

        dataDumpRequest(jvmti);

        gdata->vmDeathCalled = JNI_TRUE;
    } exitAgentMonitor(jvmti);
}