Skip to content

Commit

Permalink
Clear breakpts in class redef and fix HCR warning
Browse files Browse the repository at this point in the history
The current implementwation emits a warning message when a JVMTI
operation suceeds.

Also, clear breakpoints unconditionally when a class is redefined as
required by the spec.

Fixes: eclipse-openj9#19691

Signed-off-by: tajila <[email protected]>
  • Loading branch information
tajila committed Jun 25, 2024
1 parent b679b57 commit e9fde3f
Show file tree
Hide file tree
Showing 9 changed files with 136 additions and 133 deletions.
239 changes: 121 additions & 118 deletions runtime/jvmti/jvmtiClass.c

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion runtime/util/hshelp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3347,7 +3347,9 @@ verifyMethodsAreSame(J9VMThread * currentThread, J9JVMTIClassPair * classPair, U
/* If extensions are not enabled, treat any schema change as a real error */

if (extensionsEnabled == 0) {
emitExtendedHCRWarning(currentThread);
if (JVMTI_ERROR_NONE != rc) {
emitExtendedHCRWarning(currentThread);
}
return rc;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
<test>
<testCaseName>IllegalAccessProtectedMethodTest_j9</testCaseName>
<command>$(JAVA_COMMAND) $(JVM_OPTIONS) \
-XX:+EnableExtendedHCR \
-javaagent:$(Q)$(TEST_RESROOT)$(D)IllegalAccessProtectedMethod.jar$(Q) \
-cp $(Q)$(RESOURCES_DIR)$(P)$(TESTNG)$(P)$(LIB_DIR)$(D)asm-all.jar$(P)$(TEST_RESROOT)$(D)IllegalAccessProtectedMethod.jar$(Q) \
org.testng.TestNG -d $(REPORTDIR) $(Q)$(TEST_RESROOT)$(D)testng.xml$(Q) \
Expand Down
4 changes: 2 additions & 2 deletions test/functional/cmdLineTests/jvmtitests/jvmtitests.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
-->

<suite id="JVMTI Tests" timeout="240">
<variable name="JVM_OPTS" value="-XX:+EnableExtendedHCR" />
<variable name="JVM_OPTS" value=" " />
<variable name="JVM_MX512M" value="-Xmx512m" />
<variable name="AGENTLIB" value="-agentlib:jvmtitest" />
<variable name="TESTID" value="testid" />
Expand Down Expand Up @@ -392,7 +392,7 @@
</test>

<test id="rnwr001">
<command>$EXE$ $JVM_OPTS$ $AGENTLIB$=test:rnwr001 -cp $Q$$JAR$$Q$ $TESTRUNNER$</command>
<command>$EXE$ $JVM_OPTS$ $AGENTLIB$=test:rnwr001 -XX:+EnableExtendedHCR -cp $Q$$JAR$$Q$ $TESTRUNNER$</command>
<return type="success" value="0"/>
</test>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
-->

<suite id="JVMTI Tests" timeout="240">
<variable name="JVM_OPTS" value="-XX:+EnableExtendedHCR" />
<variable name="JVM_OPTS" value=" " />
<variable name="AGENTLIB" value="-agentlib:jvmtitest" />
<variable name="TESTRUNNER" value="com.ibm.jvmti.tests.util.TestRunner" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
-->

<suite id="JVMTI Tests" timeout="240">
<variable name="JVM_OPTS" value="-XX:+EnableExtendedHCR" />
<variable name="JVM_OPTS" value=" " />
<variable name="AGENTLIB" value="-agentlib:jvmtitest" />
<variable name="TESTRUNNER" value="com.ibm.jvmti.tests.util.TestRunner" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
$TESTRUNNER$ testid=[TESTID] -->

<suite id="JVMTI Tests" timeout="240">
<variable name="JVM_OPTS" value="-XX:+EnableExtendedHCR" />
<variable name="JVM_OPTS" value=" " />
<variable name="AGENTLIB" value="-agentlib:jvmtitest" />
<variable name="TESTID" value="testid" />
<variable name="ENABLE_ATTACH" value="-Dcom.ibm.tools.attach.enable=yes" />
Expand Down
14 changes: 7 additions & 7 deletions test/functional/cmdLineTests/jvmtitests/jvmtitests_hcr.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<!DOCTYPE suite SYSTEM "cmdlinetester.dtd">

<suite id="JVMTI Tests" timeout="240">
<variable name="JVM_OPTS" value="-XX:+EnableExtendedHCR" />
<variable name="JVM_OPTS" value=" " />
<variable name="AGENTLIB" value="-agentlib:jvmtitest" />
<variable name="TESTRUNNER" value="com.ibm.jvmti.tests.util.TestRunner" />

Expand All @@ -44,17 +44,17 @@
</test>

<test id="rc002">
<command>$EXE$ $JVM_OPTS$ $AGENTLIB$=test:rc002 -cp $Q$$JAR$$Q$ $TESTRUNNER$</command>
<command>$EXE$ $JVM_OPTS$ $AGENTLIB$=test:rc002 -XX:+EnableExtendedHCR -cp $Q$$JAR$$Q$ $TESTRUNNER$</command>
<return type="success" value="0"/>
</test>

<test id="rc003">
<command>$EXE$ $JVM_OPTS$ $AGENTLIB$=test:rc003 -cp $Q$$JAR$$Q$ $TESTRUNNER$</command>
<command>$EXE$ $JVM_OPTS$ $AGENTLIB$=test:rc003 -XX:+EnableExtendedHCR -cp $Q$$JAR$$Q$ $TESTRUNNER$</command>
<return type="success" value="0"/>
</test>

<test id="rc004">
<command>$EXE$ $JVM_OPTS$ $AGENTLIB$=test:rc004 -cp $Q$$JAR$$Q$ $TESTRUNNER$</command>
<command>$EXE$ $JVM_OPTS$ $AGENTLIB$=test:rc004 -XX:+EnableExtendedHCR -cp $Q$$JAR$$Q$ $TESTRUNNER$</command>
<return type="success" value="0"/>
</test>

Expand All @@ -79,12 +79,12 @@
</test>

<test id="rc009">
<command>$EXE$ $JVM_OPTS$ $AGENTLIB$=test:rc009 -cp $Q$$JAR$$Q$ $TESTRUNNER$</command>
<command>$EXE$ $JVM_OPTS$ $AGENTLIB$=test:rc009 -XX:+EnableExtendedHCR -cp $Q$$JAR$$Q$ $TESTRUNNER$</command>
<return type="success" value="0"/>
</test>

<test id="rc010">
<command>$EXE$ $JVM_OPTS$ $AGENTLIB$=test:rc010 -cp $Q$$JAR$$Q$ $TESTRUNNER$</command>
<command>$EXE$ $JVM_OPTS$ $AGENTLIB$=test:rc010 -XX:+EnableExtendedHCR -cp $Q$$JAR$$Q$ $TESTRUNNER$</command>
<return type="success" value="0"/>
</test>

Expand All @@ -99,7 +99,7 @@
</test>

<test id="rc013">
<command>$EXE$ $JVM_OPTS$ $AGENTLIB$=test:rc013 -cp $Q$$JAR$$Q$ $TESTRUNNER$</command>
<command>$EXE$ $JVM_OPTS$ $AGENTLIB$=test:rc013 -XX:+EnableExtendedHCR -cp $Q$$JAR$$Q$ $TESTRUNNER$</command>
<return type="success" value="0"/>
</test>

Expand Down
1 change: 0 additions & 1 deletion test/functional/cmdLineTests/jvmtitests/playlist.xml
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,6 @@
-DTEST_ROOT=$(Q)$(TEST_RESROOT)$(Q) \
-DJAR=$(Q)$(TEST_RESROOT)$(D)jvmtitest.jar$(Q) \
-DEXE=$(SQ)$(JAVA_COMMAND) $(JVM_OPTIONS) -Xdump $(SQ) \
-XX:+EnableExtendedHCR \
-DMODE_HINTS=$(Q)$(MODE_HINTS)$(Q) \
-jar $(CMDLINETESTER_JAR) \
-config $(Q)$(TEST_RESROOT)$(D)fieldwatchtests.xml$(Q) \
Expand Down

0 comments on commit e9fde3f

Please sign in to comment.