[debugger] Add Step Over Instruction internal action

IJ-CR-128361

GitOrigin-RevId: 97eb4d31c3d268bd7bd713d26f6acdc2ed185524
This commit is contained in:
Alexey Merkulov
2024-03-12 17:48:34 +01:00
committed by intellij-monorepo-bot
parent 163d700ab7
commit 39f08a085d
5 changed files with 45 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
// 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.actions
import com.intellij.debugger.DebuggerManagerEx
import com.intellij.openapi.actionSystem.ActionUpdateThread
import com.intellij.openapi.actionSystem.AnActionEvent
import com.intellij.openapi.diagnostic.thisLogger
import com.intellij.openapi.project.DumbAware
class StepOverInstructionAction : DebuggerAction(), DumbAware {
override fun actionPerformed(e: AnActionEvent) {
debuggerSession(e)?.stepOverInstruction() ?: thisLogger().error("Inconsistent update")
}
override fun update(e: AnActionEvent) {
e.presentation.isEnabledAndVisible = debuggerSession(e) != null
}
override fun getActionUpdateThread() = ActionUpdateThread.BGT
private fun debuggerSession(e: AnActionEvent) =
e.project?.let { DebuggerManagerEx.getInstanceEx(it).context.debuggerSession }
}

View File

@@ -1820,7 +1820,7 @@ public abstract class DebugProcessImpl extends UserDataHolderBase implements Deb
}
@Override
@NotNull
@Nullable
public RequestHint getHint(SuspendContextImpl suspendContext, ThreadReferenceProxyImpl stepThread, @Nullable RequestHint parentHint) {
// need this hint while stepping over for JSR45 support:
// several lines of generated java code may correspond to a single line in the source file,

View File

@@ -346,6 +346,20 @@ public final class DebuggerSession implements AbstractDebuggerSession {
stepInto(ignoreFilters, smartStepFilter, StepRequest.STEP_LINE);
}
public void stepOverInstruction() {
SuspendContextImpl suspendContext = getSuspendContext();
DebugProcessImpl.ResumeCommand cmd = myDebugProcess.new StepOverCommand(suspendContext, false, null, StepRequest.STEP_MIN) {
@Override
public @Nullable RequestHint getHint(SuspendContextImpl suspendContext,
ThreadReferenceProxyImpl stepThread,
@Nullable RequestHint parentHint) {
return null;
}
};
setSteppingThrough(cmd.getContextThread());
resumeAction(cmd, Event.STEP);
}
public void runToCursor(@NotNull XSourcePosition position, final boolean ignoreBreakpoints) {
try {
SuspendContextImpl suspendContext = getSuspendContext();

View File

@@ -909,6 +909,8 @@ action.StepOver.text=Step _Over
action.StepOver.description=Step to the next line in this file
action.StepInto.text=Step _Into
action.StepInto.description=Step to the next line executed
action.StepOverInstruction.text=Step Over Instruction
action.StepOverInstruction.description=Perform stop into on instruction level
action.SmartStepInto.text=Smart Ste_p Into
action.SmartStepInto.description=Step into the particular method
action.StepOut.text=Step Ou_t

View File

@@ -410,6 +410,10 @@
<add-to-group group-id="Internal.Errors"/>
</action>
<action id="StepOverInstruction" internal="true" class="com.intellij.debugger.actions.StepOverInstructionAction" icon="AllIcons.Actions.Play_forward">
<add-to-group group-id="DebuggingActionsGroup"/>
</action>
<group id="Internal.Java" popup="true" internal="true" compact="true">
<action id="GenerateVisitorByHierarchy" internal="true" class="com.intellij.internal.GenerateVisitorByHierarchyAction"/>