The following is a somewhat common pattern in the debug agent:
if (JNI_FUNC_PTR(env,ExceptionCheck)(env)) {
JNI_FUNC_PTR(env,ExceptionClear)(env); // keep -Xcheck:jni happy
ERROR_MESSAGE(("JNI Exception occurred calling Module.getName()"));
EXIT_ERROR(AGENT_ERROR_JNI_EXCEPTION, NULL);
}
It would be useful to print the exception when this code is executed and also create a utility function or macro to handle all of this. Something like EXIT_ERROR_ON_EXCEPTION.
if (JNI_FUNC_PTR(env,ExceptionCheck)(env)) {
JNI_FUNC_PTR(env,ExceptionClear)(env); // keep -Xcheck:jni happy
ERROR_MESSAGE(("JNI Exception occurred calling Module.getName()"));
EXIT_ERROR(AGENT_ERROR_JNI_EXCEPTION, NULL);
}
It would be useful to print the exception when this code is executed and also create a utility function or macro to handle all of this. Something like EXIT_ERROR_ON_EXCEPTION.
- duplicates
-
JDK-8345515 Debug agent should print stack trace when exiting due to an exception
-
- Closed
-
- relates to
-
JDK-8344804 Test serviceability/jdwp/AllModulesCommandTest.java times out after JNI check warning
-
- Resolved
-