From 366a97ca9862d3f2d2cc092943d13070223eea52 Mon Sep 17 00:00:00 2001 From: Eugene Zhuravlev Date: Mon, 14 Feb 2011 17:55:25 +0100 Subject: [PATCH] even more compiler logging --- .../impl/javaCompiler/BackendCompilerWrapper.java | 11 +++++++++-- .../src/com/intellij/rt/compiler/JavacRunner.java | 8 +++++++- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java index 3a324d87aa74..9a25ec6014f8 100644 --- a/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java +++ b/java/compiler/impl/src/com/intellij/compiler/impl/javaCompiler/BackendCompilerWrapper.java @@ -21,11 +21,11 @@ */ package com.intellij.compiler.impl.javaCompiler; -import com.intellij.codeInsight.AnnotationUtil; import com.intellij.codeInsight.NullableNotNullManager; import com.intellij.compiler.*; import com.intellij.compiler.classParsing.AnnotationConstantValue; import com.intellij.compiler.classParsing.MethodInfo; +import com.intellij.compiler.impl.CompileDriver; import com.intellij.compiler.impl.CompilerUtil; import com.intellij.compiler.make.Cache; import com.intellij.compiler.make.CacheCorruptedException; @@ -348,7 +348,7 @@ public class BackendCompilerWrapper { int exitValue = 0; try { - Process process = myCompiler.launchProcess(chunk, outputDir, myCompileContext); + final Process process = myCompiler.launchProcess(chunk, outputDir, myCompileContext); final long compilationStart = System.currentTimeMillis(); final ClassParsingThread classParsingThread = new ClassParsingThread(isJdk6(chunk.getJdk()), outputDir); final Future classParsingThreadFuture = ApplicationManager.getApplication().executeOnPooledThread(classParsingThread); @@ -377,10 +377,17 @@ public class BackendCompilerWrapper { exitValue = process.waitFor(); } catch (InterruptedException e) { + if (CompileDriver.ourDebugMode) { + System.out.println("Compiler interrupted; "); + e.printStackTrace(); + } process.destroy(); exitValue = process.exitValue(); } finally { + if (CompileDriver.ourDebugMode) { + System.out.println("Compiler exit code is " + exitValue); + } if (errorParsingThread != null) { errorParsingThread.setProcessTerminated(true); } diff --git a/java/java-runtime/src/com/intellij/rt/compiler/JavacRunner.java b/java/java-runtime/src/com/intellij/rt/compiler/JavacRunner.java index 4a07ff98f2db..a45414624992 100644 --- a/java/java-runtime/src/com/intellij/rt/compiler/JavacRunner.java +++ b/java/java-runtime/src/com/intellij/rt/compiler/JavacRunner.java @@ -67,7 +67,13 @@ public class JavacRunner { System.arraycopy(args, 2, newArgs, 0, newArgs.length); } expandClasspath(newArgs); - mainMethod.invoke(null, new Object[] {newArgs}); + try { + mainMethod.invoke(null, new Object[] {newArgs}); + } + catch (Throwable e) { + System.err.print(e.getMessage()); + e.printStackTrace(System.err); + } } private static void addFilesToCompile(Vector arguments, String path) throws IOException {