Try-catch exception value is not visible in debugger's local variables

#KT-3070 Fixed
This commit is contained in:
Natalia Ukhorskaya
2014-06-20 15:54:37 +04:00
parent a17bcce682
commit bdc60441c0
3 changed files with 25 additions and 0 deletions
@@ -3413,6 +3413,11 @@ The "returned" value of try expression with no finally is either the last expres
myFrameMap.leave(descriptor);
Label clauseEnd = new Label();
v.mark(clauseEnd);
v.visitLocalVariable(descriptor.getName().asString(), descriptorType.getDescriptor(), null, clauseStart, clauseEnd, index);
genFinallyBlockOrGoto(finallyBlockStackElement, i != size - 1 || finallyBlock != null ? end : null);
generateExceptionTable(clauseStart, tryBlockRegions, descriptorType.getInternalName());
@@ -0,0 +1,15 @@
class A {
fun foo() {
try {
val a = 1
}
catch(e : Throwable) {
}
}
}
// METHOD : A.foo()V
// VARIABLE : NAME=a TYPE=I INDEX=1
// VARIABLE : NAME=e TYPE=Ljava/lang/Throwable; INDEX=1
// VARIABLE : NAME=this TYPE=LA; INDEX=0
@@ -36,6 +36,11 @@ public class CheckLocalVariablesTableTestGenerated extends AbstractCheckLocalVar
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), "org.jetbrains.jet.generators.tests.TestsPackage", new File("compiler/testData/checkLocalVariablesTable"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("catchClause.kt")
public void testCatchClause() throws Exception {
doTest("compiler/testData/checkLocalVariablesTable/catchClause.kt");
}
@TestMetadata("copyFunction.kt")
public void testCopyFunction() throws Exception {
doTest("compiler/testData/checkLocalVariablesTable/copyFunction.kt");