Debugger: support field watchpoints for kotlin

This commit is contained in:
Natalia Ukhorskaya
2015-05-20 15:13:28 +03:00
parent 7406627e26
commit 2b015ae09a
10 changed files with 493 additions and 0 deletions
@@ -0,0 +1,65 @@
package fieldWatchpoints
class A {
//FieldWatchpoint! (propVal)
val propVal = 1
//FieldWatchpoint! (propVar)
var propVar = 1
fun testPublicPropertyInClass() {
propVal
propVar
propVar = 2
}
}
//FieldWatchpoint! (topPropVal)
val topPropVal = 1
//FieldWatchpoint! (topPropVar)
var topPropVar = 1
fun testPublicTopLevelProperty() {
topPropVal
topPropVar
topPropVar = 2
}
class B(
//FieldWatchpoint! (bPropVal)
val bPropVal: Int,
//FieldWatchpoint! (bPropVar)
var bPropVar: Int
) {
fun testConstructorProperty() {
bPropVal
bPropVar
bPropVar = 2
}
}
class AWithCompanion {
companion object {
//FieldWatchpoint! (compPropVal)
val compPropVal = 1
//FieldWatchpoint! (compPropVar)
var compPropVar = 1
fun testCompanionProperty() {
compPropVal
compPropVar
compPropVar = 2
}
}
}
fun main(args: Array<String>) {
A().testPublicPropertyInClass()
testPublicTopLevelProperty()
B(1, 1).testConstructorProperty()
AWithCompanion.testCompanionProperty()
}
// STEP_OUT: 36
@@ -0,0 +1,23 @@
package inapplicableFieldWatchpoints
class A {
//FieldWatchpoint! (propWithGet)
val propWithGet: Int get() = 1
}
interface T {
//FieldWatchpoint! (propInInterface)
val propInInterface: Int
}
fun main(args: Array<String>) {
//FieldWatchpoint! (localVal)
val localVal = 1
}
fun foo(
//FieldWatchpoint! (funParam)
funParam: Int
) {
}