Debugger, BE: Provide Java-like stepping for 'for' loops

- Visit '}' instead of 'for' keyword on post-condition
- Visit 'for' keyword on pre-condition
This commit is contained in:
Yan Zhulanow
2019-11-29 18:55:33 +09:00
parent 8b17718086
commit f115bde682
11 changed files with 46 additions and 13 deletions
@@ -677,6 +677,10 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
generator.checkEmptyLoop(loopExit);
v.mark(loopEntry);
resetLastLineNumber();
markStartLineNumber(generator.getForExpression());
v.nop();
generator.checkPreCondition(loopExit);
// Some forms of for-loop can be optimized as post-condition loops.
@@ -1507,10 +1511,14 @@ public class ExpressionCodegen extends KtVisitor<StackValue, StackValue> impleme
}
} else {
//if it used as argument of infix call (in this case lineNumber for simple inlineCall also would be reset)
myLastLineNumber = -1;
resetLastLineNumber();
}
}
private void resetLastLineNumber() {
myLastLineNumber = -1;
}
@Override
public int getLastLineNumber() {
return myLastLineNumber;