Debugger: allow evaluate expression in constructors

This commit is contained in:
Natalia Ukhorskaya
2015-07-24 12:24:50 +03:00
parent e423e99253
commit 519c2784ff
12 changed files with 128 additions and 0 deletions
+17
View File
@@ -0,0 +1,17 @@
LineBreakpoint created at constructors.kt:9
LineBreakpoint created at constructors.kt:13
LineBreakpoint created at constructors.kt:20
LineBreakpoint created at constructors.kt:28
!JDK_HOME!\bin\java -agentlib:jdwp=transport=dt_socket,address=!HOST_NAME!:!HOST_PORT!,suspend=y,server=n -Dfile.encoding=!FILE_ENCODING! -classpath !OUTPUT_PATH!;!KOTLIN_RUNTIME!;!CUSTOM_LIBRARY!;!RT_JAR! constructors.ConstructorsPackage
Connected to the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
constructors.kt:9
Compile bytecode for p
constructors.kt:13
Compile bytecode for p + 1
constructors.kt:20
Compile bytecode for p1 + p2
constructors.kt:28
Compile bytecode for i1
Disconnected from the target VM, address: '!HOST_NAME!:PORT_NAME!', transport: 'socket'
Process finished with exit code 0
@@ -0,0 +1,37 @@
package constructors
class Derived2(): Base(1) {
// constructor with body
// EXPRESSION: p
// RESULT: 1: I
//Breakpoint!
constructor(p: Int): this() {
// EXPRESSION: p + 1
// RESULT: 2: I
//Breakpoint!
val a = 1
}
// constructor without body
// EXPRESSION: p1 + p2
// RESULT: 2: I
//Breakpoint!
constructor(p1: Int, p2: Int): this()
}
// EXPRESSION: i1
// RESULT: 1: I
class Derived1(
i1: Int
//Breakpoint!
): Base(i1)
open class Base(i: Int)
fun main(args: Array<String>) {
Derived2(1)
Derived2(1, 1)
Derived1(1)
}