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

[TESTBUG] Simple test setup for JVMTI ClassFileLoadHook

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • hotspot
    • None
    • b120
    • generic
    • generic

      For many HotSpot features, such as CDS, we need to test interaction with ClassFileLoadeHook (e.g. JDK-8141341).

      Writing a ClassFileLoadHook is complicated (native library is needed). To simplify test development, we should provide a simple way to use ClassFileLoadHook without having to write native code.

      The proposal is to add a generic native test library SimpleClassFileLoadHook. A test case can use this library like this:

      /*
       * @test
       * @run main/othervm/native -agentlib:SimpleClassFileLoadHook=Foo,XXX,YYY
       * SimpleClassFileLoadHookTest
       */

      This will replace all occurrences of "XXX" to "YYY" in the classfile of the Foo class. While this is a very simple transformation, it should be enough for test cases that just need to "do some simple stuff" with ClassFileLoadHook.

            iklam Ioi Lam
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: