< prev index next >

src/share/vm/utilities/debug.cpp

Print this page




 193     out.print_raw   (base_name);
 194     char buf[16];
 195     jio_snprintf(buf, sizeof(buf), ":%d", line_no);
 196     out.print_raw_cr(buf);
 197   }
 198   return false;
 199 }
 200 
 201 #undef is_token_break
 202 
 203 #else
 204 
 205 // Place-holder for non-existent suppression check:
 206 #define error_is_suppressed(file_name, line_no) (false)
 207 
 208 #endif // !PRODUCT
 209 
 210 void report_vm_error(const char* file, int line, const char* error_msg,
 211                      const char* detail_msg)
 212 {
 213   if (Debugging || error_is_suppressed(file, line)) return;
 214   Thread* const thread = ThreadLocalStorage::get_thread_slow();
 215   VMError err(thread, file, line, error_msg, detail_msg);
 216   err.report_and_die();
 217 }
 218 
 219 void report_fatal(const char* file, int line, const char* message)
 220 {
 221   report_vm_error(file, line, "fatal error", message);
 222 }
 223 
 224 void report_vm_out_of_memory(const char* file, int line, size_t size,
 225                              VMErrorType vm_err_type, const char* message) {
 226   if (Debugging) return;







 227 
 228   Thread* thread = ThreadLocalStorage::get_thread_slow();
 229   VMError(thread, file, line, size, vm_err_type, message).report_and_die();




 230 
 231   // The UseOSErrorReporting option in report_and_die() may allow a return
 232   // to here. If so then we'll have to figure out how to handle it.
 233   guarantee(false, "report_and_die() should not return here");
 234 }
 235 

 236 void report_should_not_call(const char* file, int line) {
 237   report_vm_error(file, line, "ShouldNotCall()");
 238 }
 239 
 240 void report_should_not_reach_here(const char* file, int line) {
 241   report_vm_error(file, line, "ShouldNotReachHere()");
 242 }
 243 
 244 void report_unimplemented(const char* file, int line) {
 245   report_vm_error(file, line, "Unimplemented()");
 246 }
 247 
 248 void report_untested(const char* file, int line, const char* message) {
 249 #ifndef PRODUCT
 250   warning("Untested: %s in %s: %d\n", message, file, line);
 251 #endif // !PRODUCT
 252 }
 253 
 254 void report_out_of_shared_space(SharedSpaceType shared_space) {
 255   static const char* name[] = {
 256     "shared read only space",
 257     "shared read write space",
 258     "shared miscellaneous data space",
 259     "shared miscellaneous code space"
 260   };
 261   static const char* flag[] = {




 193     out.print_raw   (base_name);
 194     char buf[16];
 195     jio_snprintf(buf, sizeof(buf), ":%d", line_no);
 196     out.print_raw_cr(buf);
 197   }
 198   return false;
 199 }
 200 
 201 #undef is_token_break
 202 
 203 #else
 204 
 205 // Place-holder for non-existent suppression check:
 206 #define error_is_suppressed(file_name, line_no) (false)
 207 
 208 #endif // !PRODUCT
 209 
 210 void report_vm_error(const char* file, int line, const char* error_msg,
 211                      const char* detail_msg)
 212 {
 213   if (!Debugging && !error_is_suppressed(file, line)) {
 214     Thread* const thread = ThreadLocalStorage::get_thread_slow();
 215     VMError err(thread, file, line, error_msg, detail_msg);
 216     err.report_and_die();
 217   }
 218   BREAKPOINT;



 219 }
 220 
 221 void report_vm_out_of_memory(const char* file, int line, size_t size,
 222                              VMErrorType vm_err_type, const char* message) {
 223   if (!Debugging) {
 224     Thread* const thread = ThreadLocalStorage::get_thread_slow();
 225     VMError err(thread, file, line, size, vm_err_type, message);
 226     err.report_and_die();
 227   }
 228   BREAKPOINT;
 229   noreturn_function();
 230 }
 231 
 232 void report_vm_error_noreturn(const char* file, int line, const char* error_msg,
 233                               const char* detail_msg)
 234 {
 235   report_vm_error(file, line, error_msg, detail_msg);
 236   noreturn_function();
 237 }
 238 
 239 void report_fatal(const char* file, int line, const char* message)
 240 {
 241   report_vm_error_noreturn(file, line, "fatal error", message);
 242 }
 243 
 244 
 245 void report_should_not_call(const char* file, int line) {
 246   report_vm_error_noreturn(file, line, "ShouldNotCall()");
 247 }
 248 
 249 void report_should_not_reach_here(const char* file, int line) {
 250   report_vm_error_noreturn(file, line, "ShouldNotReachHere()");
 251 }
 252 
 253 void report_unimplemented(const char* file, int line) {
 254   report_vm_error(file, line, "Unimplemented()");
 255 }
 256 
 257 void report_untested(const char* file, int line, const char* message) {
 258 #ifndef PRODUCT
 259   warning("Untested: %s in %s: %d\n", message, file, line);
 260 #endif // !PRODUCT
 261 }
 262 
 263 void report_out_of_shared_space(SharedSpaceType shared_space) {
 264   static const char* name[] = {
 265     "shared read only space",
 266     "shared read write space",
 267     "shared miscellaneous data space",
 268     "shared miscellaneous code space"
 269   };
 270   static const char* flag[] = {


< prev index next >