use of com.intellij.debugger.engine.events.DebuggerCommandImpl in project intellij-community by JetBrains.
the class AddSteppingFilterAction method actionPerformed.
public void actionPerformed(final AnActionEvent e) {
final DebuggerContextImpl debuggerContext = DebuggerAction.getDebuggerContext(e.getDataContext());
DebugProcessImpl process = debuggerContext.getDebugProcess();
if (process == null) {
return;
}
final StackFrameProxyImpl proxy = PopFrameAction.getStackFrameProxy(e);
process.getManagerThread().schedule(new DebuggerCommandImpl() {
protected void action() throws Exception {
final String name = getClassName(proxy != null ? proxy : debuggerContext.getFrameProxy());
if (name == null) {
return;
}
final Project project = e.getData(CommonDataKeys.PROJECT);
ApplicationManager.getApplication().invokeLater(() -> {
String filter = Messages.showInputDialog(project, "", "Add Stepping Filter", null, name, null);
if (filter != null) {
ClassFilter[] newFilters = ArrayUtil.append(DebuggerSettings.getInstance().getSteppingFilters(), new ClassFilter(filter));
DebuggerSettings.getInstance().setSteppingFilters(newFilters);
}
});
}
});
}
use of com.intellij.debugger.engine.events.DebuggerCommandImpl in project intellij-community by JetBrains.
the class DebuggerManagerThreadImpl method invokeCommand.
@Override
public void invokeCommand(final DebuggerCommand command) {
if (command instanceof SuspendContextCommand) {
SuspendContextCommand suspendContextCommand = (SuspendContextCommand) command;
schedule(new SuspendContextCommandImpl((SuspendContextImpl) suspendContextCommand.getSuspendContext()) {
@Override
public void contextAction() throws Exception {
command.action();
}
@Override
protected void commandCancelled() {
command.commandCancelled();
}
});
} else {
schedule(new DebuggerCommandImpl() {
@Override
protected void action() throws Exception {
command.action();
}
@Override
protected void commandCancelled() {
command.commandCancelled();
}
});
}
}
use of com.intellij.debugger.engine.events.DebuggerCommandImpl in project intellij-community by JetBrains.
the class DebuggerManagerThreadImpl method startLongProcessAndFork.
void startLongProcessAndFork(Runnable process) {
assertIsManagerThread();
startNewWorkerThread();
try {
process.run();
} finally {
final WorkerThreadRequest request = getCurrentThreadRequest();
if (LOG.isDebugEnabled()) {
LOG.debug("Switching back to " + request);
}
super.invokeAndWait(new DebuggerCommandImpl() {
@Override
protected void action() throws Exception {
switchToRequest(request);
}
@Override
protected void commandCancelled() {
LOG.debug("Event queue was closed, killing request");
request.requestStop();
}
});
}
}
use of com.intellij.debugger.engine.events.DebuggerCommandImpl in project intellij-community by JetBrains.
the class JavaBreakpointHandler method registerBreakpoint.
@Override
public void registerBreakpoint(@NotNull XBreakpoint breakpoint) {
Breakpoint javaBreakpoint = BreakpointManager.getJavaBreakpoint(breakpoint);
if (javaBreakpoint == null) {
javaBreakpoint = createJavaBreakpoint(breakpoint);
breakpoint.putUserData(Breakpoint.DATA_KEY, javaBreakpoint);
}
if (javaBreakpoint != null) {
final Breakpoint bpt = javaBreakpoint;
BreakpointManager.addBreakpoint(bpt);
// use schedule not to block initBreakpoints
myProcess.getManagerThread().schedule(new DebuggerCommandImpl() {
@Override
protected void action() throws Exception {
bpt.createRequest(myProcess);
}
@Override
public Priority getPriority() {
return Priority.HIGH;
}
});
}
}
use of com.intellij.debugger.engine.events.DebuggerCommandImpl in project intellij-community by JetBrains.
the class DebuggerContextUtil method setStackFrame.
public static void setStackFrame(final DebuggerStateManager manager, final StackFrameProxyImpl stackFrame) {
ApplicationManager.getApplication().assertIsDispatchThread();
final DebuggerContextImpl context = manager.getContext();
final DebuggerSession session = context.getDebuggerSession();
if (session != null) {
session.getProcess().getManagerThread().schedule(new DebuggerCommandImpl() {
@Override
public Priority getPriority() {
return Priority.HIGH;
}
@Override
protected void action() throws Exception {
SuspendContextImpl threadSuspendContext = SuspendManagerUtil.findContextByThread(session.getProcess().getSuspendManager(), stackFrame.threadProxy());
final DebuggerContextImpl newContext = DebuggerContextImpl.createDebuggerContext(session, threadSuspendContext, stackFrame.threadProxy(), stackFrame);
DebuggerInvocationUtil.swingInvokeLater(session.getProject(), () -> {
manager.setState(newContext, session.getState(), DebuggerSession.Event.REFRESH, null);
SourceCodeChecker.checkSource(newContext);
});
}
});
} else {
manager.setState(DebuggerContextImpl.EMPTY_CONTEXT, DebuggerSession.State.DISPOSED, DebuggerSession.Event.REFRESH, null);
}
}
Aggregations