use of com.intellij.debugger.engine.events.DebuggerCommandImpl in project intellij-community by JetBrains.
the class ThreadBlockedMonitor method onThreadBlocked.
private static void onThreadBlocked(@NotNull final ThreadReference blockedThread, @NotNull final ThreadReference blockingThread, final DebugProcessImpl process) {
XDebugSessionImpl.NOTIFICATION_GROUP.createNotification(DebuggerBundle.message("status.thread.blocked.by", blockedThread.name(), blockingThread.name()), DebuggerBundle.message("status.thread.blocked.by.resume", blockingThread.name()), NotificationType.INFORMATION, (notification, event) -> {
if (event.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
notification.expire();
process.getManagerThread().schedule(new DebuggerCommandImpl() {
@Override
protected void action() throws Exception {
ThreadReferenceProxyImpl threadProxy = process.getVirtualMachineProxy().getThreadReferenceProxy(blockingThread);
SuspendContextImpl suspendingContext = SuspendManagerUtil.getSuspendingContext(process.getSuspendManager(), threadProxy);
process.getManagerThread().invoke(process.createResumeThreadCommand(suspendingContext, threadProxy));
}
});
}
}).notify(process.getProject());
}
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;
}
});
}
}
Aggregations