use of com.intellij.xdebugger.XDebugSession in project intellij-community by JetBrains.
the class DebuggerPanelsManager method attachVirtualMachine.
@Nullable
public RunContentDescriptor attachVirtualMachine(DebugUIEnvironment environment) throws ExecutionException {
final DebugEnvironment modelEnvironment = environment.getEnvironment();
final DebuggerSession debuggerSession = DebuggerManagerEx.getInstanceEx(myProject).attachVirtualMachine(modelEnvironment);
if (debuggerSession == null) {
return null;
}
XDebugSession debugSession = XDebuggerManager.getInstance(myProject).startSessionAndShowTab(modelEnvironment.getSessionName(), environment.getReuseContent(), new XDebugProcessStarter() {
@Override
@NotNull
public XDebugProcess start(@NotNull XDebugSession session) {
return JavaDebugProcess.create(session, debuggerSession);
}
});
return debugSession.getRunContentDescriptor();
}
use of com.intellij.xdebugger.XDebugSession in project intellij-community by JetBrains.
the class HotSwapProgressImpl method notifyUser.
private void notifyUser(String title, String message, NotificationType type) {
NotificationListener notificationListener = null;
if (SoftReference.dereference(mySessionRef) != null) {
notificationListener = (notification, event) -> {
if (event.getEventType() != HyperlinkEvent.EventType.ACTIVATED) {
return;
}
XDebugSession session = SoftReference.dereference(mySessionRef);
if (session == null) {
return;
}
notification.expire();
switch(event.getDescription()) {
case "stop":
session.stop();
break;
case "restart":
ExecutionEnvironment environment = ((XDebugSessionImpl) session).getExecutionEnvironment();
if (environment != null) {
ExecutionUtil.restart(environment);
}
break;
}
};
}
NOTIFICATION_GROUP.createNotification(title, message, type, notificationListener).setImportant(false).notify(getProject());
}
use of com.intellij.xdebugger.XDebugSession in project intellij-community by JetBrains.
the class ShowInstancesFromClassesViewAction method perform.
@Override
protected void perform(AnActionEvent e) {
final Project project = e.getProject();
final ReferenceType selectedClass = getSelectedClass(e);
if (project != null && selectedClass != null) {
final XDebugSession debugSession = XDebuggerManager.getInstance(project).getCurrentSession();
if (debugSession != null) {
new InstancesWindow(debugSession, limit -> selectedClass.instances(limit), selectedClass.name()).show();
}
}
}
use of com.intellij.xdebugger.XDebugSession in project intellij-community by JetBrains.
the class ShowNewInstancesAction method perform.
@Override
protected void perform(AnActionEvent e) {
final Project project = e.getProject();
final ReferenceType selectedClass = getSelectedClass(e);
final InstancesProvider provider = e.getData(ClassesTable.NEW_INSTANCES_PROVIDER_KEY);
final XDebugSession session = project != null ? XDebuggerManager.getInstance(project).getCurrentSession() : null;
if (selectedClass != null && provider != null && session != null) {
new InstancesWindow(session, provider, selectedClass.name()).show();
}
}
use of com.intellij.xdebugger.XDebugSession in project intellij-community by JetBrains.
the class JumpToAllocationSourceAction method perform.
@Override
protected void perform(XValueNodeImpl node, @NotNull String nodeName, AnActionEvent e) {
final Project project = e.getProject();
final List<StackFrameItem> stack = getStack(e);
if (project != null && stack != null) {
final XDebugSession session = XDebuggerManager.getInstance(project).getCurrentSession();
if (session != null) {
DebugProcessImpl process = (DebugProcessImpl) DebuggerManager.getInstance(project).getDebugProcess(session.getDebugProcess().getProcessHandler());
StackFramePopup.show(stack, process);
}
}
}
Aggregations