|
155 | 155 | import org.eclipse.ui.IWorkbench; |
156 | 156 | import org.eclipse.ui.IWorkbenchWindow; |
157 | 157 | import org.eclipse.ui.PlatformUI; |
| 158 | +import org.eclipse.ui.console.ConsolePlugin; |
158 | 159 | import org.eclipse.ui.console.IConsole; |
| 160 | +import org.eclipse.ui.console.IConsoleManager; |
159 | 161 | import org.eclipse.ui.console.IHyperlink; |
160 | 162 | import org.eclipse.ui.console.TextConsole; |
161 | 163 | import org.eclipse.ui.internal.console.ConsoleHyperlinkPosition; |
@@ -1432,7 +1434,13 @@ protected Object launchAndWait(ILaunchConfiguration configuration, DebugEventWai |
1432 | 1434 | * if the event is never received. |
1433 | 1435 | */ |
1434 | 1436 | protected Object launchAndWait(ILaunchConfiguration configuration, String mode, DebugEventWaiter waiter, boolean register) throws CoreException { |
1435 | | - ILaunch launch = configuration.launch(mode, new TimeoutMonitor(DEFAULT_TIMEOUT), false, register); |
| 1437 | + ILaunch launch; |
| 1438 | + try { |
| 1439 | + launch = configuration.launch(mode, new TimeoutMonitor(DEFAULT_TIMEOUT), false, register); |
| 1440 | + } catch (Throwable t) { |
| 1441 | + logProcessConsoleContents(); |
| 1442 | + throw t; |
| 1443 | + } |
1436 | 1444 | Object suspendee= waiter.waitForEvent(); |
1437 | 1445 | if (suspendee == null) { |
1438 | 1446 | StringBuilder buf = new StringBuilder(); |
@@ -3146,6 +3154,25 @@ private static void logVMChange(String message, IVMInstall vm) { |
3146 | 3154 | JDIDebugPlugin.log(status); |
3147 | 3155 | } |
3148 | 3156 |
|
| 3157 | + private static void logProcessConsoleContents() { |
| 3158 | + try { |
| 3159 | + StringBuilder buf = new StringBuilder(); |
| 3160 | + IConsoleManager manager = ConsolePlugin.getDefault().getConsoleManager(); |
| 3161 | + for (IConsole console : manager.getConsoles()) { |
| 3162 | + if (console instanceof ProcessConsole) { |
| 3163 | + ProcessConsole processConsole = (ProcessConsole) console; |
| 3164 | + String string = processConsole.getDocument().get(); |
| 3165 | + buf.append("Console output for \"" + processConsole.getName() + "\" follows:\n"); //$NON-NLS-1$ |
| 3166 | + buf.append(string); |
| 3167 | + } |
| 3168 | + } |
| 3169 | + buf.append("\n"); //$NON-NLS-1$ |
| 3170 | + DebugPlugin.log(new Status(IStatus.INFO, "org.eclipse.jdt.debug.ui.tests", buf.toString())); //$NON-NLS-1$ |
| 3171 | + } catch (Throwable t) { |
| 3172 | + DebugPlugin.log(t); |
| 3173 | + } |
| 3174 | + } |
| 3175 | + |
3149 | 3176 | private static class LogVMInstallChanges implements IVMInstallChangedListener { |
3150 | 3177 |
|
3151 | 3178 | @Override |
|
0 commit comments