[TESTBUG] Simple test setup for JVMTI ClassFileLoadHook

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P3
    • 9
    • Affects Version/s: 9
    • Component/s: 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.

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

              Created:
              Updated:
              Resolved: