[debugger] Add listener to track the start of debugger stepping actions

IJ-MR-145237

GitOrigin-RevId: dea3c2e4e005df9531867830284af76d45891579
This commit is contained in:
Alexey Merkulov
2024-10-01 15:14:39 +00:00
committed by intellij-monorepo-bot
parent 151b03f97d
commit c84dac7d1e
2 changed files with 23 additions and 0 deletions
@@ -2162,6 +2162,13 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
(context.getSuspendPolicy() == EventRequest.SUSPEND_EVENT_THREAD || isResumeOnlyCurrentThread())) {
myThreadBlockedMonitor.startWatching(myContextThread);
}
if (context != null) {
ApplicationManager.getApplication().getMessageBus().syncPublisher(SteppingListener.TOPIC)
.beforeSteppingStarted(context, getSteppingAction());
}
if (context != null
&& isResumeOnlyCurrentThread()
&& context.getSuspendPolicy() == EventRequest.SUSPEND_ALL
@@ -0,0 +1,16 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package com.intellij.debugger.engine
import com.intellij.util.messages.Topic
import org.jetbrains.annotations.ApiStatus
@ApiStatus.Internal
interface SteppingListener {
companion object {
@Topic.AppLevel
@JvmField
val TOPIC: Topic<SteppingListener> = Topic(SteppingListener::class.java, Topic.BroadcastDirection.NONE)
}
fun beforeSteppingStarted(suspendContext: SuspendContextImpl, steppingAction: SteppingAction) { }
}