void (@NotNull XSuspendContext suspendContext, @NotNull XDebugSession session) { XExecutionStack activeExecutionStack = suspendContext.getActiveExecutionStack(); if (activeExecutionStack != null) { activeExecutionStack.computeStackFrames(0, new XStackFrameContainerEx() { final List<XStackFrame> myFrames = new ArrayList<>(); @Override public void addStackFrames(@NotNull List<? extends XStackFrame> stackFrames, boolean last) { myFrames.addAll(stackFrames); if (last) { print(null); } } @Override public void addStackFrames(@NotNull List<? extends XStackFrame> stackFrames, @Nullable XStackFrame toSelect, boolean last) { addStackFrames(stackFrames, last); } @Override public void errorOccurred(@NotNull String errorMessage) { print(errorMessage); } void print(@Nullable String errorMessage) { ConsoleView view = session.getConsoleView(); Project project = session.getProject(); DebuggerUIUtil.invokeLater(() -> view.print("Stack: ", ConsoleViewContentType.SYSTEM_OUTPUT)); myFrames.forEach(f -> { SimpleColoredText text = new SimpleColoredText(); ReadAction.run(() -> f.customizePresentation(text)); XSourcePosition position = f.getSourcePosition(); Navigatable navigatable = position != null ? position.createNavigatable(project) : null; DebuggerUIUtil.invokeLater(() -> { view.print("\n\t", ConsoleViewContentType.SYSTEM_OUTPUT); view.printHyperlink(text.toString(), p -> { if (navigatable != null) { navigatable.navigate(true); } }); }); }); DebuggerUIUtil.invokeLater(() -> { if (errorMessage != null) { view.print("\n\t" + errorMessage, ConsoleViewContentType.SYSTEM_OUTPUT); } view.print("\n", ConsoleViewContentType.SYSTEM_OUTPUT); }); } }); } }