[rd debugger] New splitted InterruptThreadAction based on XDebuggerTree (RPC)

IJPL-199588

GitOrigin-RevId: a9219adad73166727304b1179a5b2ad1159ba16d
This commit is contained in:
Maria Sokolova
2025-08-01 11:11:15 +00:00
committed by intellij-monorepo-bot
parent 314bc94f0f
commit e1f6355aab
6 changed files with 71 additions and 5 deletions
@@ -2,6 +2,7 @@
package com.intellij.java.debugger.impl.backend
import com.intellij.debugger.actions.FreezeThreadAction
import com.intellij.debugger.actions.InterruptThreadAction
import com.intellij.debugger.actions.ThreadDumpAction
import com.intellij.debugger.engine.AsyncStacksUtils
import com.intellij.debugger.engine.JavaDebugProcess
@@ -71,6 +72,10 @@ internal class BackendJavaDebuggerSessionApi : JavaDebuggerSessionApi {
invokeThreadCommand(executionStackId, ThreadCommand.FREEZE)
}
override suspend fun interruptThread(executionStackId: XExecutionStackId) {
invokeThreadCommand(executionStackId, ThreadCommand.INTERRUPT)
}
private fun invokeThreadCommand(executionStackId: XExecutionStackId, command: ThreadCommand) {
val executionStackModel = executionStackId.findValue() ?: return
val xSession = executionStackModel.session
@@ -90,11 +95,14 @@ internal class BackendJavaDebuggerSessionApi : JavaDebuggerSessionApi {
ThreadCommand.FREEZE -> {
FreezeThreadAction.freezeThread(threadProxy, debugProcess, managerThread)
}
ThreadCommand.INTERRUPT -> {
InterruptThreadAction.interruptThread(threadProxy, debugProcess, managerThread)
}
}
}
companion object {
private enum class ThreadCommand { FREEZE, RESUME }
private enum class ThreadCommand { FREEZE, RESUME, INTERRUPT }
}
}