Debugger: Fix missing NOP in empty 'when' header (KT-29189)
This commit is contained in:
@@ -4856,6 +4856,10 @@ The "returned" value of try expression with no finally is either the last expres
|
|||||||
KtProperty subjectVariable = expression.getSubjectVariable();
|
KtProperty subjectVariable = expression.getSubjectVariable();
|
||||||
KtExpression subjectExpression = expression.getSubjectExpression();
|
KtExpression subjectExpression = expression.getSubjectExpression();
|
||||||
|
|
||||||
|
if (subjectVariable == null && subjectExpression == null) {
|
||||||
|
v.nop();
|
||||||
|
}
|
||||||
|
|
||||||
SwitchCodegen switchCodegen = switchCodegenProvider.buildAppropriateSwitchCodegenIfPossible(
|
SwitchCodegen switchCodegen = switchCodegenProvider.buildAppropriateSwitchCodegenIfPossible(
|
||||||
expression, isStatement, CodegenUtil.isExhaustive(bindingContext, expression, isStatement)
|
expression, isStatement, CodegenUtil.isExhaustive(bindingContext, expression, isStatement)
|
||||||
);
|
);
|
||||||
|
|||||||
+1
-1
@@ -12,4 +12,4 @@ fun foo(x: Int) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 2 +3 4 5 6 +8 +9 10 11 8 13
|
// 2 3 4 5 6 +8 9 10 11 8 13
|
||||||
+1
-1
@@ -86,4 +86,4 @@ inline fun foo(f: () -> Int): Int {
|
|||||||
|
|
||||||
fun test(i: Int) = i
|
fun test(i: Int) = i
|
||||||
|
|
||||||
// STEP_OVER: 30
|
// STEP_OVER: 32
|
||||||
+6
-1
@@ -2,13 +2,16 @@ LineBreakpoint created at stepOverWhenWithInline.kt:5
|
|||||||
Run Java
|
Run Java
|
||||||
Connected to the target VM
|
Connected to the target VM
|
||||||
stepOverWhenWithInline.kt:5
|
stepOverWhenWithInline.kt:5
|
||||||
|
stepOverWhenWithInline.kt:7
|
||||||
stepOverWhenWithInline.kt:8
|
stepOverWhenWithInline.kt:8
|
||||||
stepOverWhenWithInline.kt:9
|
stepOverWhenWithInline.kt:9
|
||||||
stepOverWhenWithInline.kt:7
|
stepOverWhenWithInline.kt:7
|
||||||
|
stepOverWhenWithInline.kt:13
|
||||||
stepOverWhenWithInline.kt:14
|
stepOverWhenWithInline.kt:14
|
||||||
stepOverWhenWithInline.kt:17
|
stepOverWhenWithInline.kt:17
|
||||||
stepOverWhenWithInline.kt:18
|
stepOverWhenWithInline.kt:18
|
||||||
stepOverWhenWithInline.kt:13
|
stepOverWhenWithInline.kt:13
|
||||||
|
stepOverWhenWithInline.kt:25
|
||||||
stepOverWhenWithInline.kt:26
|
stepOverWhenWithInline.kt:26
|
||||||
stepOverWhenWithInline.kt:27
|
stepOverWhenWithInline.kt:27
|
||||||
stepOverWhenWithInline.kt:25
|
stepOverWhenWithInline.kt:25
|
||||||
@@ -21,14 +24,16 @@ stepOverWhenWithInline.kt:38
|
|||||||
stepOverWhenWithInline.kt:51
|
stepOverWhenWithInline.kt:51
|
||||||
stepOverWhenWithInline.kt:52
|
stepOverWhenWithInline.kt:52
|
||||||
stepOverWhenWithInline.kt:51
|
stepOverWhenWithInline.kt:51
|
||||||
|
stepOverWhenWithInline.kt:57
|
||||||
stepOverWhenWithInline.kt:58
|
stepOverWhenWithInline.kt:58
|
||||||
stepOverWhenWithInline.kt:57
|
stepOverWhenWithInline.kt:57
|
||||||
|
stepOverWhenWithInline.kt:63
|
||||||
stepOverWhenWithInline.kt:64
|
stepOverWhenWithInline.kt:64
|
||||||
stepOverWhenWithInline.kt:65
|
stepOverWhenWithInline.kt:65
|
||||||
stepOverWhenWithInline.kt:63
|
stepOverWhenWithInline.kt:63
|
||||||
|
stepOverWhenWithInline.kt:75
|
||||||
stepOverWhenWithInline.kt:76
|
stepOverWhenWithInline.kt:76
|
||||||
stepOverWhenWithInline.kt:75
|
stepOverWhenWithInline.kt:75
|
||||||
stepOverWhenWithInline.kt:80
|
|
||||||
Disconnected from the target VM
|
Disconnected from the target VM
|
||||||
|
|
||||||
Process finished with exit code 0
|
Process finished with exit code 0
|
||||||
|
|||||||
+19
@@ -0,0 +1,19 @@
|
|||||||
|
package whenWithoutExpression
|
||||||
|
|
||||||
|
fun test(a: String): String {
|
||||||
|
val b = a.toLowerCase()
|
||||||
|
//Breakpoint!
|
||||||
|
return when {
|
||||||
|
b.startsWith("a") -> "A"
|
||||||
|
b.startsWith("b") -> "B"
|
||||||
|
b.startsWith("c") -> "C"
|
||||||
|
else -> "other"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
test("abcd")
|
||||||
|
}
|
||||||
|
|
||||||
|
// STEP_OVER: 4
|
||||||
|
// PRINT_FRAME
|
||||||
+11
@@ -0,0 +1,11 @@
|
|||||||
|
LineBreakpoint created at whenWithoutExpression.kt:6
|
||||||
|
Run Java
|
||||||
|
Connected to the target VM
|
||||||
|
whenWithoutExpression.kt:6
|
||||||
|
whenWithoutExpression.kt:7
|
||||||
|
whenWithoutExpression.kt:6
|
||||||
|
whenWithoutExpression.kt:15
|
||||||
|
whenWithoutExpression.kt:16
|
||||||
|
Disconnected from the target VM
|
||||||
|
|
||||||
|
Process finished with exit code 0
|
||||||
+5
@@ -922,6 +922,11 @@ public class KotlinSteppingTestGenerated extends AbstractKotlinSteppingTest {
|
|||||||
public void testStopInlineCallInLocalFunInSecondaryConstructor() throws Exception {
|
public void testStopInlineCallInLocalFunInSecondaryConstructor() throws Exception {
|
||||||
runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInlineCallInLocalFunInSecondaryConstructor.kt");
|
runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/stopInlineCallInLocalFunInSecondaryConstructor.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("whenWithoutExpression.kt")
|
||||||
|
public void testWhenWithoutExpression() throws Exception {
|
||||||
|
runTest("idea/testData/debugger/tinyApp/src/stepping/stepOver/whenWithoutExpression.kt");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@TestMetadata("idea/testData/debugger/tinyApp/src/stepping/stepOverForce")
|
@TestMetadata("idea/testData/debugger/tinyApp/src/stepping/stepOverForce")
|
||||||
|
|||||||
Reference in New Issue
Block a user