Debugger: get correct context for breakpoints inside lambdas

This commit is contained in:
Natalia Ukhorskaya
2014-09-11 14:15:27 +04:00
parent a1e586cf7c
commit 50dcef254d
19 changed files with 351 additions and 38 deletions
@@ -0,0 +1,9 @@
LineBreakpoint created at callableBug.kt:8
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! callableBug.CallableBugPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
callableBug.kt:7
Compile bytecode for callable
callableBug.kt:7
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -0,0 +1,8 @@
LineBreakpoint created at inlineLambda.kt:9
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! inlineLambda.InlineLambdaPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
inlineLambda.kt:8
inlineLambda.kt:8
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -0,0 +1,10 @@
LineBreakpoint created at lambdaOnSecondLine.kt:10
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! lambdaOnSecondLine.LambdaOnSecondLinePackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
lambdaOnSecondLine.kt:9
lambdaOnSecondLine.kt:14
lambdaOnSecondLine.kt:9
Compile bytecode for it
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -0,0 +1,10 @@
LineBreakpoint created at oneLineLambda.kt:9
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! oneLineLambda.OneLineLambdaPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
oneLineLambda.kt:8
oneLineLambda.kt:13
oneLineLambda.kt:8
Compile bytecode for it
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -0,0 +1,10 @@
LineBreakpoint created at twoLambdasOnOneLineFirst.kt:9
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! twoLambdasOnOneLineFirst.TwoLambdasOnOneLineFirstPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
twoLambdasOnOneLineFirst.kt:8
twoLambdasOnOneLineFirst.kt:13
twoLambdasOnOneLineFirst.kt:8
Compile bytecode for it
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -0,0 +1,12 @@
LineBreakpoint created at twoLambdasOnOneLineSecond.kt:9
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !APP_PATH!\classes;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! twoLambdasOnOneLineSecond.TwoLambdasOnOneLineSecondPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
twoLambdasOnOneLineSecond.kt:8
twoLambdasOnOneLineSecond.kt:15
twoLambdasOnOneLineSecond.kt:8
twoLambdasOnOneLineSecond.kt:15
twoLambdasOnOneLineSecond.kt:8
Compile bytecode for it
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -0,0 +1,12 @@
package callableBug
fun main(args: Array<String>) {
val callable = 1
array(1, 2).map {
it + 1
//Breakpoint!
}.forEach { it + 2 }
}
// EXPRESSION: callable
// RESULT: 1: I
@@ -0,0 +1,11 @@
package inlineLambda
fun main(args: Array<String>) {
val a = array(1)
// EXPRESSION: it
// RESULT: Unresolved reference: it
// STEP_INTO: 1
//Breakpoint!
a.map { it * 1 }
}
@@ -0,0 +1,18 @@
package lambdaOnSecondLine
fun main(args: Array<String>) {
val a = A()
// EXPRESSION: it
// RESULT: 1: I
// STEP_INTO: 2
a.foo { a }
//Breakpoint!
.foo { a }
}
class A {
fun foo(f: (Int) -> A): A {
return f(1)
}
}
@@ -0,0 +1,16 @@
package oneLineLambda
fun main(args: Array<String>) {
val a = A()
// EXPRESSION: it
// RESULT: 1: I
// STEP_INTO: 2
//Breakpoint!
a.foo { a }
}
class A {
fun foo(f: (Int) -> A): A {
return f(1)
}
}
@@ -0,0 +1,16 @@
package twoLambdasOnOneLineFirst
fun main(args: Array<String>) {
val a = A()
// EXPRESSION: it
// RESULT: 1: I
// STEP_INTO: 2
//Breakpoint!
a.foo { a }.foo { a }
}
class A {
fun foo(f: (Int) -> A): A {
return f(1)
}
}
@@ -0,0 +1,18 @@
package twoLambdasOnOneLineSecond
fun main(args: Array<String>) {
val a = A()
// EXPRESSION: it
// RESULT: 2: I
// STEP_INTO: 4
//Breakpoint!
a.foo { counter++; a }.foo { a }
}
var counter = 1
class A {
fun foo(f: (Int) -> A): A {
return f(counter)
}
}