Skip to content

Commit 6ad151d

Browse files
committedSep 27, 2022
8293143: Workaround for JDK-8292217 when doing "step over" of bytecode with unresolved cp reference
Reviewed-by: sspitsyn, amenkov
1 parent 22b59b6 commit 6ad151d

File tree

2 files changed

+17
-7
lines changed

2 files changed

+17
-7
lines changed
 

‎src/jdk.jdwp.agent/share/native/libjdwp/eventHandler.c

+8-3
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,14 @@ deferEventReport(JNIEnv *env, jthread thread,
334334
jlocation end;
335335
error = methodLocation(method, &start, &end);
336336
if (error == JVMTI_ERROR_NONE) {
337-
deferring = isBreakpointSet(clazz, method, start) ||
338-
threadControl_getInstructionStepMode(thread)
339-
== JVMTI_ENABLE;
337+
if (isBreakpointSet(clazz, method, start)) {
338+
deferring = JNI_TRUE;
339+
} else {
340+
StepRequest* step = threadControl_getStepRequest(thread);
341+
if (step->pending && step->depth == JDWP_STEP_DEPTH(INTO)) {
342+
deferring = JNI_TRUE;
343+
}
344+
}
340345
if (!deferring) {
341346
threadControl_saveCLEInfo(env, thread, ei,
342347
clazz, method, start);

‎test/jdk/com/sun/jdi/CLETest.java

+9-4
Original file line numberDiff line numberDiff line change
@@ -215,10 +215,15 @@ public void eventSetReceived(EventSet set) {
215215
// more than one Event in it.
216216
if (set.size() != 1) {
217217
testcaseFailed = true;
218-
// For now, we expect these two test cases to fail due to 8292217,
219-
// so don't fail the overall test run as a result of these failures.
220-
// testFailed = true;
221-
System.out.println("TESTCASE #" + testcase + " FAILED (ignoring): too many events in EventSet: " + set.size());
218+
// For now, we expect the 2nd test cases to fail due to 8292217,
219+
// so don't fail the overall test run as a result of this failure.
220+
// There is a workaround in place that allows the 1st test case to pass.
221+
if (testcase == 1) {
222+
testFailed = true;
223+
}
224+
System.out.println("TESTCASE #" + testcase + " FAILED" +
225+
(testcase == 2 ? "(ignoring)" : "") +
226+
": too many events in EventSet: " + set.size());
222227
}
223228
break;
224229
}

0 commit comments

Comments
 (0)
Please sign in to comment.