*
* @param suspendContext
* @param stepThread
+ * @param size the step size. One of {@link StepRequest#STEP_LINE} or {@link StepRequest#STEP_MIN}
* @param depth
* @param hint may be null
*/
- protected void doStep(final SuspendContextImpl suspendContext, final ThreadReferenceProxyImpl stepThread, int depth, RequestHint hint) {
+ protected void doStep(final SuspendContextImpl suspendContext, final ThreadReferenceProxyImpl stepThread, int size, int depth,
+ RequestHint hint) {
if (stepThread == null) {
return;
}
}
deleteStepRequests(stepThreadReference);
EventRequestManager requestManager = getVirtualMachineProxy().eventRequestManager();
- StepRequest stepRequest = requestManager.createStepRequest(stepThreadReference, StepRequest.STEP_LINE, depth);
+ StepRequest stepRequest = requestManager.createStepRequest(stepThreadReference, size, depth);
if (!(hint != null && hint.isIgnoreFilters()) /*&& depth == StepRequest.STEP_INTO*/) {
final List<ClassFilter> activeFilters = new ArrayList<ClassFilter>();
DebuggerSettings settings = DebuggerSettings.getInstance();
}
private class StepOutCommand extends ResumeCommand {
- public StepOutCommand(SuspendContextImpl suspendContext) {
+ private final int myStepSize;
+
+ public StepOutCommand(SuspendContextImpl suspendContext, int stepSize) {
super(suspendContext);
+ myStepSize = stepSize;
}
@Override
if (rvWatcher != null) {
rvWatcher.enable(thread.getThreadReference());
}
- doStep(suspendContext, thread, StepRequest.STEP_OUT, hint);
+ doStep(suspendContext, thread, myStepSize, StepRequest.STEP_OUT, hint);
super.contextAction();
}
}
private final MethodFilter mySmartStepFilter;
@Nullable
private final StepIntoBreakpoint myBreakpoint;
+ private final int myStepSize;
- public StepIntoCommand(SuspendContextImpl suspendContext, boolean ignoreFilters, @Nullable final MethodFilter methodFilter) {
+ public StepIntoCommand(SuspendContextImpl suspendContext, boolean ignoreFilters, @Nullable final MethodFilter methodFilter,
+ int stepSize) {
super(suspendContext);
myForcedIgnoreFilters = ignoreFilters || methodFilter != null;
mySmartStepFilter = methodFilter;
myBreakpoint = methodFilter instanceof BreakpointStepMethodFilter ?
DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager().addStepIntoBreakpoint(((BreakpointStepMethodFilter)methodFilter)) :
null;
+ myStepSize = stepSize;
}
@Override
myBreakpoint.createRequest(suspendContext.getDebugProcess());
myRunToCursorBreakpoint = myBreakpoint;
}
- doStep(suspendContext, stepThread, StepRequest.STEP_INTO, hint);
+ doStep(suspendContext, stepThread, myStepSize, StepRequest.STEP_INTO, hint);
super.contextAction();
}
}
private class StepOverCommand extends ResumeCommand {
private final boolean myIsIgnoreBreakpoints;
+ private final int myStepSize;
- public StepOverCommand(SuspendContextImpl suspendContext, boolean ignoreBreakpoints) {
+ public StepOverCommand(SuspendContextImpl suspendContext, boolean ignoreBreakpoints, int stepSize) {
super(suspendContext);
myIsIgnoreBreakpoints = ignoreBreakpoints;
+ myStepSize = stepSize;
}
@Override
rvWatcher.enable(stepThread.getThreadReference());
}
- doStep(suspendContext, stepThread, StepRequest.STEP_OVER, hint);
+ doStep(suspendContext, stepThread, myStepSize, StepRequest.STEP_OVER, hint);
if (myIsIgnoreBreakpoints) {
DebuggerManagerEx.getInstanceEx(myProject).getBreakpointManager().disableBreakpoints(DebugProcessImpl.this);
}
public ResumeCommand createStepOverCommand(SuspendContextImpl suspendContext, boolean ignoreBreakpoints) {
- return new StepOverCommand(suspendContext, ignoreBreakpoints);
+ return createStepOverCommand(suspendContext, ignoreBreakpoints, StepRequest.STEP_LINE);
+ }
+
+ public ResumeCommand createStepOverCommand(SuspendContextImpl suspendContext, boolean ignoreBreakpoints, int stepSize) {
+ return new StepOverCommand(suspendContext, ignoreBreakpoints, stepSize);
}
public ResumeCommand createStepOutCommand(SuspendContextImpl suspendContext) {
- return new StepOutCommand(suspendContext);
+ return createStepOutCommand(suspendContext, StepRequest.STEP_LINE);
+ }
+
+ public ResumeCommand createStepOutCommand(SuspendContextImpl suspendContext, int stepSize) {
+ return new StepOutCommand(suspendContext, stepSize);
}
public ResumeCommand createStepIntoCommand(SuspendContextImpl suspendContext, boolean ignoreFilters, final MethodFilter smartStepFilter) {
- return new StepIntoCommand(suspendContext, ignoreFilters, smartStepFilter);
+ return createStepIntoCommand(suspendContext, ignoreFilters, smartStepFilter, StepRequest.STEP_LINE);
+ }
+
+ public ResumeCommand createStepIntoCommand(SuspendContextImpl suspendContext, boolean ignoreFilters, final MethodFilter smartStepFilter,
+ int stepSize) {
+ return new StepIntoCommand(suspendContext, ignoreFilters, smartStepFilter, stepSize);
}
public ResumeCommand createRunToCursorCommand(SuspendContextImpl suspendContext, Document document, int lineIndex,
public class RequestHint {
public static final int STOP = 0;
private static final Logger LOG = Logger.getInstance("#com.intellij.debugger.engine.RequestHint");
+ private final int mySize;
private final int myDepth;
private final SourcePosition myPosition;
private final int myFrameCount;
private boolean myRestoreBreakpoints = false;
public RequestHint(final ThreadReferenceProxyImpl stepThread, final SuspendContextImpl suspendContext, @NotNull MethodFilter methodFilter) {
- this(stepThread, suspendContext, StepRequest.STEP_INTO, methodFilter);
+ this(stepThread, suspendContext, StepRequest.STEP_LINE, StepRequest.STEP_INTO, methodFilter);
}
public RequestHint(final ThreadReferenceProxyImpl stepThread, final SuspendContextImpl suspendContext, int depth) {
- this(stepThread, suspendContext, depth, null);
+ this(stepThread, suspendContext, StepRequest.STEP_LINE, depth, null);
}
- private RequestHint(final ThreadReferenceProxyImpl stepThread, final SuspendContextImpl suspendContext, int depth, @Nullable MethodFilter methodFilter) {
+ private RequestHint(final ThreadReferenceProxyImpl stepThread, final SuspendContextImpl suspendContext, int stepSize, int depth, @Nullable MethodFilter methodFilter) {
+ mySize = stepSize;
myDepth = depth;
myMethodFilter = methodFilter;
return myIgnoreFilters;
}
+ public int getSize() {
+ return mySize;
+ }
+
public int getDepth() {
return myDepth;
}
import com.sun.jdi.ThreadReference;
import com.sun.jdi.event.Event;
import com.sun.jdi.request.EventRequest;
+import com.sun.jdi.request.StepRequest;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
myDebugProcess.getManagerThread().schedule(command);
}
- public void stepOut() {
+ public void stepOut(int stepSize) {
final SuspendContextImpl suspendContext = getSuspendContext();
- final DebugProcessImpl.ResumeCommand cmd = myDebugProcess.createStepOutCommand(suspendContext);
+ final DebugProcessImpl.ResumeCommand cmd = myDebugProcess.createStepOutCommand(suspendContext, stepSize);
mySteppingThroughThreads.add(cmd.getContextThread());
resumeAction(cmd, EVENT_STEP);
}
- public void stepOver(boolean ignoreBreakpoints) {
+ public void stepOut() {
+ stepOut(StepRequest.STEP_LINE);
+ }
+
+ public void stepOver(boolean ignoreBreakpoints, int stepSize) {
final SuspendContextImpl suspendContext = getSuspendContext();
- final DebugProcessImpl.ResumeCommand cmd = myDebugProcess.createStepOverCommand(suspendContext, ignoreBreakpoints);
+ final DebugProcessImpl.ResumeCommand cmd = myDebugProcess.createStepOverCommand(suspendContext, ignoreBreakpoints, stepSize);
mySteppingThroughThreads.add(cmd.getContextThread());
resumeAction(cmd, EVENT_STEP);
}
- public void stepInto(final boolean ignoreFilters, final @Nullable MethodFilter smartStepFilter) {
+ public void stepOver(boolean ignoreBreakpoints) {
+ stepOver(ignoreBreakpoints, StepRequest.STEP_LINE);
+ }
+
+ public void stepInto(final boolean ignoreFilters, final @Nullable MethodFilter smartStepFilter, int stepSize) {
final SuspendContextImpl suspendContext = getSuspendContext();
- final DebugProcessImpl.ResumeCommand cmd = myDebugProcess.createStepIntoCommand(suspendContext, ignoreFilters, smartStepFilter);
+ final DebugProcessImpl.ResumeCommand cmd = myDebugProcess.createStepIntoCommand(suspendContext, ignoreFilters, smartStepFilter, stepSize);
mySteppingThroughThreads.add(cmd.getContextThread());
resumeAction(cmd, EVENT_STEP);
}
+ public void stepInto(final boolean ignoreFilters, final @Nullable MethodFilter smartStepFilter) {
+ stepInto(ignoreFilters, smartStepFilter, StepRequest.STEP_LINE);
+ }
+
public void runToCursor(Document document, int line, final boolean ignoreBreakpoints) {
try {
DebugProcessImpl.ResumeCommand runToCursorCommand = myDebugProcess.createRunToCursorCommand(getSuspendContext(), document, line, ignoreBreakpoints);