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