Skip to content

Commit 98b3e1b

Browse files
committed
Notify client about initially running threads after attach
1 parent 2e61557 commit 98b3e1b

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

adapter/src/main/kotlin/org/javacs/ktda/adapter/KotlinDebugAdapter.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,12 @@ class KotlinDebugAdapter(
215215
AttachConfiguration(projectRoot, hostName, port, timeout),
216216
context
217217
).also(::setupDebuggeeListeners)
218+
219+
// Since we are attaching to a running VM, we have to send custom
220+
// 'start' events for all executing threads
221+
for (thread in debuggee!!.threads) {
222+
sendThreadEvent(thread.id, ThreadEventArgumentsReason.STARTED)
223+
}
218224
}
219225

220226
private fun setupCommonInitializationParams(args: Map<String, Any>) {

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import org.javacs.ktda.core.Position
77
import org.javacs.ktda.core.Source
88
import org.javacs.ktda.core.launch.LaunchConfiguration
99
import org.javacs.ktda.core.event.DebuggeeEventBus
10-
import org.javacs.ktda.core.event.ThreadEvent
1110
import org.javacs.ktda.core.breakpoint.Breakpoint
1211
import org.javacs.ktda.core.breakpoint.ExceptionBreakpoint
1312
import org.javacs.kt.LOG

0 commit comments

Comments
 (0)