Try-catch exception value is not visible in debugger's local variables
#KT-3070 Fixed
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user