debug information test: handle vm resume correctly.
This commit is contained in:
committed by
Ilmir Usmanov
parent
251899c31a
commit
0ea407fef9
@@ -12,9 +12,9 @@ fun box() {
|
|||||||
// TestKt:8:
|
// TestKt:8:
|
||||||
// A:3: x:java.lang.String, y:int
|
// A:3: x:java.lang.String, y:int
|
||||||
// TestKt:8:
|
// TestKt:8:
|
||||||
// TestKt:5: $dstr$x$y:A
|
// TestKt:5: a:A, block:TestKt$box$1
|
||||||
// TestKt$box$1:8:
|
// TestKt$box$1:8: $dstr$x$y:A
|
||||||
// TestKt$box$1.invoke(java.lang.Object)+8: a:A, block:TestKt$box$1
|
// TestKt$box$1.invoke(java.lang.Object)+8:
|
||||||
// TestKt:5: a:A, block:TestKt$box$1
|
// TestKt:5: a:A, block:TestKt$box$1
|
||||||
// TestKt:8:
|
// TestKt:8:
|
||||||
// TestKt:9:
|
// TestKt:9:
|
||||||
+1
-1
@@ -11,6 +11,6 @@ fun box() {
|
|||||||
// IGNORE_BACKEND: JVM_IR
|
// IGNORE_BACKEND: JVM_IR
|
||||||
// LOCAL VARIABLES
|
// LOCAL VARIABLES
|
||||||
// TestKt:9:
|
// TestKt:9:
|
||||||
// TestKt:4: $fun$bar$1:TestKt$foo$1
|
// TestKt:4:
|
||||||
// TestKt:6: $fun$bar$1:TestKt$foo$1
|
// TestKt:6: $fun$bar$1:TestKt$foo$1
|
||||||
// TestKt:10:
|
// TestKt:10:
|
||||||
+11
-11
@@ -28,22 +28,22 @@ fun box() {
|
|||||||
// A:3: x:double, y:java.lang.String, z:char
|
// A:3: x:double, y:java.lang.String, z:char
|
||||||
// A:3:
|
// A:3:
|
||||||
// TestKt:11:
|
// TestKt:11:
|
||||||
// TestKt:5: $dstr$x$_u24__u24$y:A, $noName_1:java.lang.String, w:int
|
// TestKt:5: a:A, block:TestKt$box$1
|
||||||
// TestKt$box$1:14:
|
// TestKt$box$1:14: $dstr$x$_u24__u24$y:A, $noName_1:java.lang.String, w:int
|
||||||
|
// A:3:
|
||||||
// A:3: x:double, y:java.lang.String, z:char
|
// A:3: x:double, y:java.lang.String, z:char
|
||||||
// A:3:
|
// A:3:
|
||||||
// A:3: $dstr$x$_u24__u24$y:A, $noName_1:java.lang.String, w:int, x:double, y:char
|
// TestKt$box$1:14: $dstr$x$_u24__u24$y:A, $noName_1:java.lang.String, w:int, x:double, y:char
|
||||||
// TestKt$box$1:14: $dstr$x$_u24__u24$y:A, $noName_1:java.lang.String, w:int, x:double, y:char, a:double, c:char
|
// TestKt$box$1:15: $dstr$x$_u24__u24$y:A, $noName_1:java.lang.String, w:int, x:double, y:char, a:double, c:char
|
||||||
// TestKt$box$1:15:
|
// A:3:
|
||||||
// A:3: x:double, y:java.lang.String, z:char
|
// A:3: x:double, y:java.lang.String, z:char
|
||||||
// A:3:
|
// A:3:
|
||||||
// A:3: $dstr$x$_u24__u24$y:A, $noName_1:java.lang.String, w:int, x:double, y:char, a:double, c:char
|
// TestKt$box$1:15: $dstr$x$_u24__u24$y:A, $noName_1:java.lang.String, w:int, x:double, y:char, a:double, c:char
|
||||||
// TestKt$box$1:15: $dstr$x$_u24__u24$y:A, $noName_1:java.lang.String, w:int, x:double, y:char, a:double, c:char, _:java.lang.String, d:char
|
|
||||||
// TestKt$box$1:17:
|
|
||||||
// TestKt:7: $dstr$x$_u24__u24$y:A, $noName_1:java.lang.String, w:int, x:double, y:char, a:double, c:char, _:java.lang.String, d:char
|
|
||||||
// TestKt$box$1:17: $dstr$x$_u24__u24$y:A, $noName_1:java.lang.String, w:int, x:double, y:char, a:double, c:char, _:java.lang.String, d:char
|
// TestKt$box$1:17: $dstr$x$_u24__u24$y:A, $noName_1:java.lang.String, w:int, x:double, y:char, a:double, c:char, _:java.lang.String, d:char
|
||||||
// TestKt$box$1:21:
|
// TestKt:7:
|
||||||
// TestKt$box$1.invoke(java.lang.Object, java.lang.Object, java.lang.Object)+19: a:A, block:TestKt$box$1
|
// TestKt$box$1:17: $dstr$x$_u24__u24$y:A, $noName_1:java.lang.String, w:int, x:double, y:char, a:double, c:char, _:java.lang.String, d:char
|
||||||
|
// TestKt$box$1:21: $dstr$x$_u24__u24$y:A, $noName_1:java.lang.String, w:int, x:double, y:char, a:double, c:char, _:java.lang.String, d:char
|
||||||
|
// TestKt$box$1.invoke(java.lang.Object, java.lang.Object, java.lang.Object)+19:
|
||||||
// TestKt:5: a:A, block:TestKt$box$1
|
// TestKt:5: a:A, block:TestKt$box$1
|
||||||
// TestKt:11:
|
// TestKt:11:
|
||||||
// TestKt:23:
|
// TestKt:23:
|
||||||
+7
-6
@@ -170,6 +170,9 @@ abstract class AbstractDebugTest : CodegenTestCase() {
|
|||||||
|
|
||||||
val classLoader = createGeneratedClassLoader(classesDir)
|
val classLoader = createGeneratedClassLoader(classesDir)
|
||||||
val aClass = getGeneratedClass(classLoader, TEST_CLASS)
|
val aClass = getGeneratedClass(classLoader, TEST_CLASS)
|
||||||
|
if (virtualMachine.allThreads().any { it.isSuspended }) {
|
||||||
|
virtualMachine.resume()
|
||||||
|
}
|
||||||
invokeBoxInSeparateProcess(classLoader, aClass, proxyPort)
|
invokeBoxInSeparateProcess(classLoader, aClass, proxyPort)
|
||||||
|
|
||||||
val manager = virtualMachine.eventRequestManager()
|
val manager = virtualMachine.eventRequestManager()
|
||||||
@@ -178,7 +181,7 @@ abstract class AbstractDebugTest : CodegenTestCase() {
|
|||||||
var inBoxMethod = false
|
var inBoxMethod = false
|
||||||
vmLoop@
|
vmLoop@
|
||||||
while (true) {
|
while (true) {
|
||||||
val eventSet = virtualMachine.eventQueue().remove(1000)
|
val eventSet = virtualMachine.eventQueue().remove(1000) ?: continue
|
||||||
for (event in eventSet) {
|
for (event in eventSet) {
|
||||||
when (event) {
|
when (event) {
|
||||||
is VMDeathEvent, is VMDisconnectEvent -> {
|
is VMDeathEvent, is VMDisconnectEvent -> {
|
||||||
@@ -201,33 +204,31 @@ abstract class AbstractDebugTest : CodegenTestCase() {
|
|||||||
inBoxMethod = true
|
inBoxMethod = true
|
||||||
storeStep(loggedItems, event)
|
storeStep(loggedItems, event)
|
||||||
}
|
}
|
||||||
virtualMachine.resume()
|
|
||||||
}
|
}
|
||||||
is StepEvent -> {
|
is StepEvent -> {
|
||||||
// Handle the case where an Exception causing program to exit without MethodExitEvent.
|
// Handle the case where an Exception causing program to exit without MethodExitEvent.
|
||||||
if (inBoxMethod && event.location().method().name() == "run") {
|
if (inBoxMethod && event.location().method().name() == "run") {
|
||||||
virtualMachine.resume()
|
manager.stepRequests().map { it.disable() }
|
||||||
break@vmLoop
|
break@vmLoop
|
||||||
}
|
}
|
||||||
if (inBoxMethod) {
|
if (inBoxMethod) {
|
||||||
storeStep(loggedItems, event)
|
storeStep(loggedItems, event)
|
||||||
}
|
}
|
||||||
virtualMachine.resume()
|
|
||||||
}
|
}
|
||||||
is MethodExitEvent -> {
|
is MethodExitEvent -> {
|
||||||
if (event.location().method().name() == BOX_METHOD) {
|
if (event.location().method().name() == BOX_METHOD) {
|
||||||
manager.stepRequests().map { it.disable() }
|
manager.stepRequests().map { it.disable() }
|
||||||
virtualMachine.resume()
|
|
||||||
break@vmLoop
|
break@vmLoop
|
||||||
}
|
}
|
||||||
virtualMachine.resume()
|
|
||||||
}
|
}
|
||||||
else -> {
|
else -> {
|
||||||
throw IllegalStateException("event not handled: $event")
|
throw IllegalStateException("event not handled: $event")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
eventSet.resume()
|
||||||
}
|
}
|
||||||
|
virtualMachine.resume()
|
||||||
checkResult(wholeFile, loggedItems)
|
checkResult(wholeFile, loggedItems)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user