src/share/vm/utilities/vmError.hpp

Print this page




   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  *
  23  */
  24 





  25 
  26 class VM_ReportJavaOutOfMemory;
  27 
  28 class VMError : public StackObj {
  29   friend class VM_ReportJavaOutOfMemory;
  30 
  31   enum ErrorType {
  32     internal_error = 0xe0000000,
  33     oom_error      = 0xe0000001
  34   };
  35   int          _id;          // Solaris/Linux signals: 0 - SIGRTMAX
  36                              // Windows exceptions: 0xCxxxxxxx system errors
  37                              //                     0x8xxxxxxx system warnings
  38 
  39   const char * _message;
  40   const char * _detail_msg;
  41 
  42   Thread *     _thread;      // NULL if it's native thread
  43 
  44 


  99   // return a string to describe the error
 100   char *error_string(char* buf, int buflen);
 101 
 102   // main error reporting function
 103   void report_and_die();
 104 
 105   // reporting OutOfMemoryError
 106   void report_java_out_of_memory();
 107 
 108   // returns original flags for signal, if it was resetted, or -1 if
 109   // signal was not changed by error reporter
 110   static int get_resetted_sigflags(int sig);
 111 
 112   // returns original handler for signal, if it was resetted, or NULL if
 113   // signal was not changed by error reporter
 114   static address get_resetted_sighandler(int sig);
 115 
 116   // check to see if fatal error reporting is in progress
 117   static bool fatal_error_in_progress() { return first_error != NULL; }
 118 };




   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  *
  23  */
  24 
  25 #ifndef SHARE_VM_UTILITIES_VMERROR_HPP
  26 #define SHARE_VM_UTILITIES_VMERROR_HPP
  27 
  28 #include "utilities/globalDefinitions.hpp"
  29 
  30 
  31 class VM_ReportJavaOutOfMemory;
  32 
  33 class VMError : public StackObj {
  34   friend class VM_ReportJavaOutOfMemory;
  35 
  36   enum ErrorType {
  37     internal_error = 0xe0000000,
  38     oom_error      = 0xe0000001
  39   };
  40   int          _id;          // Solaris/Linux signals: 0 - SIGRTMAX
  41                              // Windows exceptions: 0xCxxxxxxx system errors
  42                              //                     0x8xxxxxxx system warnings
  43 
  44   const char * _message;
  45   const char * _detail_msg;
  46 
  47   Thread *     _thread;      // NULL if it's native thread
  48 
  49 


 104   // return a string to describe the error
 105   char *error_string(char* buf, int buflen);
 106 
 107   // main error reporting function
 108   void report_and_die();
 109 
 110   // reporting OutOfMemoryError
 111   void report_java_out_of_memory();
 112 
 113   // returns original flags for signal, if it was resetted, or -1 if
 114   // signal was not changed by error reporter
 115   static int get_resetted_sigflags(int sig);
 116 
 117   // returns original handler for signal, if it was resetted, or NULL if
 118   // signal was not changed by error reporter
 119   static address get_resetted_sighandler(int sig);
 120 
 121   // check to see if fatal error reporting is in progress
 122   static bool fatal_error_in_progress() { return first_error != NULL; }
 123 };
 124 
 125 #endif // SHARE_VM_UTILITIES_VMERROR_HPP