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

Some JVMTI calls in the jdwp debug agent are using FUNC_PTR instead of JVMTI_FUNC_PTR

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P5
    • 16
    • 16
    • core-svc
    • None
    • b23

    Description

      The debug agent has the following macros:

      #define JVM_ENV_PTR(e,name) (LOG_JVM(("%s()",#name)), (e))
      #define JNI_ENV_PTR(e,name) (LOG_JNI(("%s()",#name)), (e))
      #define JVMTI_ENV_PTR(e,name) (LOG_JVMTI(("%s()",#name)),(e))

      #define FUNC_PTR(e,name) (*((*(e))->name))
      #define JVM_FUNC_PTR(e,name) FUNC_PTR(JVM_ENV_PTR (e,name),name)
      #define JNI_FUNC_PTR(e,name) FUNC_PTR(JNI_ENV_PTR (e,name),name)
      #define JVMTI_FUNC_PTR(e,name) FUNC_PTR(JVMTI_ENV_PTR(e,name),name)

      JVMTI calls are normally made using JVMTI_FUNC_PTR. This allows tracing of the JVMTI call via its reference to the JVMTI_ENV_PTR macro. However, many of the calls in util.c are using the FUNC_PTR directly, bypassing the tracing. I can't see a good reason for this. I'd like for all of them to be converted to use JVMTI_ENV_PTR, with the exception of the IsSameObject call, which is likely to just generate a lot of useless noise in the log file.

      There there is also one JVM call done using FUNC_PTR instead of JVM_FUNC_PTR. It is for GetEnv, and also is probably best left as is since it is called a lot and logging its use is not of any value.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: