Skip to content

Commit 2e61557

Browse files
committed
Make Debuggee.threads non-observable
Thread events are already issued via the VMEventBus.
1 parent e5f3369 commit 2e61557

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

adapter/src/main/kotlin/org/javacs/ktda/core/Debuggee.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
package org.javacs.ktda.core
22

33
import org.javacs.ktda.core.event.DebuggeeEventBus
4-
import org.javacs.ktda.util.ObservableList
54
import java.io.InputStream
65
import java.io.OutputStream
76

87
/** A debuggee that is launched upon construction */
98
interface Debuggee {
10-
val threads: ObservableList<DebuggeeThread>
9+
val threads: List<DebuggeeThread>
1110
val eventBus: DebuggeeEventBus
1211
val stdin: OutputStream?
1312
get() = null

adapter/src/main/kotlin/org/javacs/ktda/jdi/JDIDebuggee.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class JDIDebuggee(
3333
private val sourcesRoots: Set<Path>,
3434
private val context: DebugContext
3535
) : Debuggee, JDISessionContext {
36-
override val threads = ObservableList<DebuggeeThread>()
36+
override var threads = emptyList<DebuggeeThread>()
3737
override val eventBus: VMEventBus
3838
override val pendingStepRequestThreadIds = mutableSetOf<Long>()
3939
override val stdin: OutputStream?
@@ -55,7 +55,9 @@ class JDIDebuggee(
5555
hookBreakpoints()
5656
}
5757

58-
override fun updateThreads() = threads.setAll(vm.allThreads().map { JDIThread(it, this) })
58+
override fun updateThreads() {
59+
threads = vm.allThreads().map { JDIThread(it, this) }
60+
}
5961

6062
private fun hookBreakpoints() {
6163
context.breakpointManager.also { manager ->

0 commit comments

Comments
 (0)