Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8345515

Debug agent should print stack trace when exiting due to an exception

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Duplicate
    • Icon: P4 P4
    • None
    • 24
    • core-svc
    • None

      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.

            cjplummer Chris Plummer
            cjplummer Chris Plummer
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: