# HG changeset patch # User Lukas Stadler # Date 1319546672 -7200 # Node ID 3822c5969a8b154f821f39e85e9ab1bf91ab2b60 # Parent 707bc4847b00256dc27ac1ebad8a435c6f7cba70 better error messages for missing MAXINE env var and exceptions thrown by the compiler diff -r 707bc4847b00 -r 3822c5969a8b src/share/vm/graal/graalVMExits.hpp --- a/src/share/vm/graal/graalVMExits.hpp Thu Oct 20 17:25:50 2011 +0200 +++ b/src/share/vm/graal/graalVMExits.hpp Tue Oct 25 14:44:32 2011 +0200 @@ -101,10 +101,17 @@ if (THREAD->has_pending_exception()) { Handle exception = PENDING_EXCEPTION; CLEAR_PENDING_EXCEPTION; - tty->print_cr("%s", message); - java_lang_Throwable::print(exception, tty); - tty->cr(); - java_lang_Throwable::print_stack_trace(exception(), tty); + + assert(exception->is_a(SystemDictionary::Throwable_klass()), "Throwable instance expected"); + JavaValue result(T_VOID); + JavaCalls::call_virtual(&result, + exception, + KlassHandle(THREAD, + SystemDictionary::Throwable_klass()), + vmSymbols::printStackTrace_name(), + vmSymbols::void_method_signature(), + THREAD); + vm_abort(dump_core); } } diff -r 707bc4847b00 -r 3822c5969a8b src/share/vm/runtime/arguments.cpp --- a/src/share/vm/runtime/arguments.cpp Thu Oct 20 17:25:50 2011 +0200 +++ b/src/share/vm/runtime/arguments.cpp Tue Oct 25 14:44:32 2011 +0200 @@ -2024,38 +2024,39 @@ char maxine_dir[BUFFER_SIZE]; char temp[BUFFER_SIZE]; if (!os::getenv("MAXINE", maxine_dir, sizeof(maxine_dir))) { - fatal("Must set MAXINE environment variable to a Maxine project directory."); + jio_fprintf(defaultStream::output_stream(), "Error while starting Graal VM: The MAXINE environment variable needs to point to a Maxine repository.\n"); + vm_exit(0); } if (PrintVMOptions) tty->print_cr("MAXINE=%s", maxine_dir); - SysClassPath scp_compiler(Arguments::get_sysclasspath()); - sprintf(temp, "%s/com.oracle.max.cri/bin", maxine_dir); - scp_compiler.add_prefix(temp); - sprintf(temp, "%s/com.oracle.max.criutils/bin", maxine_dir); - scp_compiler.add_prefix(temp); - sprintf(temp, "%s/com.oracle.max.base/bin", maxine_dir); - scp_compiler.add_prefix(temp); - sprintf(temp, "%s/com.oracle.max.asmdis/bin", maxine_dir); - scp_compiler.add_prefix(temp); - sprintf(temp, "%s/com.oracle.max.asm/bin", maxine_dir); - scp_compiler.add_prefix(temp); - sprintf(temp, "%s/com.oracle.max.graal.graph/bin", maxine_dir); - scp_compiler.add_prefix(temp); - sprintf(temp, "%s/com.oracle.max.graal.compiler/bin", maxine_dir); - scp_compiler.add_prefix(temp); - sprintf(temp, "%s/com.oracle.max.graal.nodes/bin", maxine_dir); - scp_compiler.add_prefix(temp); - sprintf(temp, "%s/com.oracle.max.graal.snippets/bin", maxine_dir); - scp_compiler.add_prefix(temp); - sprintf(temp, "%s/com.oracle.max.graal.criutils/bin", maxine_dir); - scp_compiler.add_prefix(temp); - sprintf(temp, "%s/com.oracle.max.graal.extensions/bin", maxine_dir); - scp_compiler.add_prefix(temp); - sprintf(temp, "%s/com.oracle.max.graal.hotspot/bin", maxine_dir); - scp_compiler.add_prefix(temp); - sprintf(temp, "%s/com.oracle.max.graal.graphviz/bin", maxine_dir); - scp_compiler.add_prefix(temp); - scp_compiler.expand_endorsed(); - Arguments::set_compilerclasspath(scp_compiler.combined_path()); + SysClassPath scp_compiler(Arguments::get_sysclasspath()); + sprintf(temp, "%s/com.oracle.max.cri/bin", maxine_dir); + scp_compiler.add_prefix(temp); + sprintf(temp, "%s/com.oracle.max.criutils/bin", maxine_dir); + scp_compiler.add_prefix(temp); + sprintf(temp, "%s/com.oracle.max.base/bin", maxine_dir); + scp_compiler.add_prefix(temp); + sprintf(temp, "%s/com.oracle.max.asmdis/bin", maxine_dir); + scp_compiler.add_prefix(temp); + sprintf(temp, "%s/com.oracle.max.asm/bin", maxine_dir); + scp_compiler.add_prefix(temp); + sprintf(temp, "%s/com.oracle.max.graal.graph/bin", maxine_dir); + scp_compiler.add_prefix(temp); + sprintf(temp, "%s/com.oracle.max.graal.compiler/bin", maxine_dir); + scp_compiler.add_prefix(temp); + sprintf(temp, "%s/com.oracle.max.graal.nodes/bin", maxine_dir); + scp_compiler.add_prefix(temp); + sprintf(temp, "%s/com.oracle.max.graal.snippets/bin", maxine_dir); + scp_compiler.add_prefix(temp); + sprintf(temp, "%s/com.oracle.max.graal.criutils/bin", maxine_dir); + scp_compiler.add_prefix(temp); + sprintf(temp, "%s/com.oracle.max.graal.extensions/bin", maxine_dir); + scp_compiler.add_prefix(temp); + sprintf(temp, "%s/com.oracle.max.graal.hotspot/bin", maxine_dir); + scp_compiler.add_prefix(temp); + sprintf(temp, "%s/com.oracle.max.graal.graphviz/bin", maxine_dir); + scp_compiler.add_prefix(temp); + scp_compiler.expand_endorsed(); + Arguments::set_compilerclasspath(scp_compiler.combined_path()); } if (AggressiveOpts) {