vmError.hpp revision 603
0N/A/*
2085N/A * Copyright 2003-2009 Sun Microsystems, Inc. All Rights Reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
0N/A * published by the Free Software Foundation.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
1472N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
1472N/A * CA 95054 USA or visit www.sun.com if you need additional information or
1472N/A * have any questions.
0N/A *
0N/A */
0N/A
1879N/A
1879N/Aclass VM_ReportJavaOutOfMemory;
1879N/A
1879N/Aclass VMError : public StackObj {
1879N/A friend class VM_ReportJavaOutOfMemory;
3206N/A
0N/A enum ErrorType {
0N/A internal_error = 0xe0000000,
0N/A oom_error = 0xe0000001
0N/A };
3206N/A int _id; // Solaris/Linux signals: 0 - SIGRTMAX
0N/A // Windows exceptions: 0xCxxxxxxx system errors
0N/A // 0x8xxxxxxx system warnings
0N/A
0N/A const char * _message;
0N/A
0N/A Thread * _thread; // NULL if it's native thread
0N/A
0N/A
0N/A // additional info for crashes
0N/A address _pc; // faulting PC
1410N/A void * _siginfo; // ExceptionRecord on Windows,
0N/A // siginfo_t on Solaris/Linux
0N/A void * _context; // ContextRecord on Windows,
0N/A // ucontext_t on Solaris/Linux
0N/A
0N/A // additional info for VM internal errors
0N/A const char * _filename;
0N/A int _lineno;
0N/A
0N/A // used by fatal error handler
0N/A int _current_step;
0N/A const char * _current_step_info;
0N/A int _verbose;
0N/A
603N/A // used by reporting about OOM
0N/A size_t _size;
0N/A
0N/A // set signal handlers on Solaris/Linux or the default exception filter
0N/A // on Windows, to handle recursive crashes.
0N/A void reset_signal_handlers();
1601N/A
1601N/A // handle -XX:+ShowMessageBoxOnError. buf is used to format the message string
1601N/A void show_message_box(char* buf, int buflen);
1601N/A
0N/A // generate an error report
2085N/A void report(outputStream* st);
2085N/A
2085N/A // accessor
2085N/A const char* message() { return _message; }
2085N/A
2085N/Apublic:
2085N/A // Constructor for crashes
2085N/A VMError(Thread* thread, int sig, address pc, void* siginfo, void* context);
0N/A // Constructor for VM internal errors
0N/A VMError(Thread* thread, const char* message, const char* filename, int lineno);
0N/A
0N/A // Constructors for VM OOM errors
0N/A VMError(Thread* thread, size_t size, const char* message, const char* filename, int lineno);
0N/A // Constructor for non-fatal errors
0N/A VMError(const char* message);
0N/A
0N/A // return a string to describe the error
0N/A char *error_string(char* buf, int buflen);
0N/A
0N/A // main error reporting function
0N/A void report_and_die();
1384N/A
1384N/A // reporting OutOfMemoryError
1384N/A void report_java_out_of_memory();
1384N/A
0N/A // returns original flags for signal, if it was resetted, or -1 if
1410N/A // signal was not changed by error reporter
1410N/A static int get_resetted_sigflags(int sig);
1983N/A
0N/A // returns original handler for signal, if it was resetted, or NULL if
0N/A // signal was not changed by error reporter
0N/A static address get_resetted_sighandler(int sig);
1983N/A};
1983N/A