1 /*
2 * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
79 // on Windows, to handle recursive crashes.
80 void reset_signal_handlers();
81
82 // handle -XX:+ShowMessageBoxOnError. buf is used to format the message string
83 void show_message_box(char* buf, int buflen);
84
85 // generate an error report
86 void report(outputStream* st);
87
88 // generate a stack trace
89 static void print_stack_trace(outputStream* st, JavaThread* jt,
90 char* buf, int buflen, bool verbose = false);
91
92 // accessor
93 const char* message() const { return _message; }
94 const char* detail_msg() const { return _detail_msg; }
95 bool should_report_bug(unsigned int id) {
96 return (id != OOM_MALLOC_ERROR) && (id != OOM_MMAP_ERROR);
97 }
98
99 public:
100
101 // Constructor for crashes
102 VMError(Thread* thread, unsigned int sig, address pc, void* siginfo,
103 void* context);
104 // Constructor for VM internal errors
105 VMError(Thread* thread, const char* filename, int lineno,
106 const char* message, const char * detail_msg);
107
108 // Constructor for VM OOM errors
109 VMError(Thread* thread, const char* filename, int lineno, size_t size,
110 VMErrorType vm_err_type, const char* message);
111 // Constructor for non-fatal errors
112 VMError(const char* message);
113
114 // return a string to describe the error
115 char *error_string(char* buf, int buflen);
116
117 // Report status of core/minidump
118 static void report_coredump_status(const char* message, bool status);
|
1 /*
2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
79 // on Windows, to handle recursive crashes.
80 void reset_signal_handlers();
81
82 // handle -XX:+ShowMessageBoxOnError. buf is used to format the message string
83 void show_message_box(char* buf, int buflen);
84
85 // generate an error report
86 void report(outputStream* st);
87
88 // generate a stack trace
89 static void print_stack_trace(outputStream* st, JavaThread* jt,
90 char* buf, int buflen, bool verbose = false);
91
92 // accessor
93 const char* message() const { return _message; }
94 const char* detail_msg() const { return _detail_msg; }
95 bool should_report_bug(unsigned int id) {
96 return (id != OOM_MALLOC_ERROR) && (id != OOM_MMAP_ERROR);
97 }
98
99 static fdStream out;
100 static fdStream log; // error log used by VMError::report_and_die()
101
102 public:
103
104 // Constructor for crashes
105 VMError(Thread* thread, unsigned int sig, address pc, void* siginfo,
106 void* context);
107 // Constructor for VM internal errors
108 VMError(Thread* thread, const char* filename, int lineno,
109 const char* message, const char * detail_msg);
110
111 // Constructor for VM OOM errors
112 VMError(Thread* thread, const char* filename, int lineno, size_t size,
113 VMErrorType vm_err_type, const char* message);
114 // Constructor for non-fatal errors
115 VMError(const char* message);
116
117 // return a string to describe the error
118 char *error_string(char* buf, int buflen);
119
120 // Report status of core/minidump
121 static void report_coredump_status(const char* message, bool status);
|