mirror of
https://github.com/revanced/smali.git
synced 2025-05-05 17:14:25 +02:00
Call ContextUtil.getSourcePosition on the debugger manager thread
This commit is contained in:
parent
3aad871652
commit
a5d82813f1
@ -35,6 +35,7 @@ import com.intellij.debugger.SourcePosition;
|
||||
import com.intellij.debugger.engine.ContextUtil;
|
||||
import com.intellij.debugger.engine.DebugProcessImpl.ResumeCommand;
|
||||
import com.intellij.debugger.engine.SuspendContextImpl;
|
||||
import com.intellij.debugger.engine.events.DebuggerCommandImpl;
|
||||
import com.intellij.debugger.impl.JvmSteppingCommandProvider;
|
||||
import com.sun.jdi.request.StepRequest;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@ -44,8 +45,16 @@ public class SmaliSteppingCommandProvider extends JvmSteppingCommandProvider {
|
||||
@Override
|
||||
public ResumeCommand getStepOverCommand(@NotNull final SuspendContextImpl suspendContext, boolean ignoreBreakpoints,
|
||||
int stepSize) {
|
||||
SourcePosition locationPosition = ContextUtil.getSourcePosition(suspendContext);
|
||||
if (locationPosition != null && locationPosition.getFile().getLanguage() == SmaliLanguage.INSTANCE) {
|
||||
|
||||
final SourcePosition[] location = new SourcePosition[1];
|
||||
|
||||
suspendContext.getDebugProcess().getManagerThread().invokeAndWait(new DebuggerCommandImpl() {
|
||||
@Override protected void action() throws Exception {
|
||||
location[0] = ContextUtil.getSourcePosition(suspendContext);
|
||||
}
|
||||
}) ;
|
||||
|
||||
if (location[0] != null && location[0].getFile().getLanguage() == SmaliLanguage.INSTANCE) {
|
||||
return suspendContext.getDebugProcess().createStepOverCommand(suspendContext, ignoreBreakpoints,
|
||||
StepRequest.STEP_MIN);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user