hotspot/src/share/vm/utilities/vmError.cpp
changeset 8119 81eef1b06988
parent 8114 340b5b8b544b
child 8476 7e34c2d4cf9b
--- a/hotspot/src/share/vm/utilities/vmError.cpp	Tue Feb 08 22:27:57 2011 -0800
+++ b/hotspot/src/share/vm/utilities/vmError.cpp	Wed Feb 09 11:08:10 2011 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -201,6 +201,15 @@
   out->print_raw_cr("#");
 }
 
+bool VMError::coredump_status;
+char VMError::coredump_message[O_BUFLEN];
+
+void VMError::report_coredump_status(const char* message, bool status) {
+  coredump_status = status;
+  strncpy(coredump_message, message, sizeof(coredump_message));
+  coredump_message[sizeof(coredump_message)-1] = 0;
+}
+
 
 // Return a string to describe the error
 char* VMError::error_string(char* buf, int buflen) {
@@ -454,6 +463,15 @@
        st->cr();
        st->print_cr("#");
      }
+  STEP(63, "(printing core file information)")
+    st->print("# ");
+    if (coredump_status) {
+      st->print("Core dump written. Default location: %s", coredump_message);
+    } else {
+      st->print("Failed to write core dump. %s", coredump_message);
+    }
+    st->print_cr("");
+    st->print_cr("#");
 
   STEP(65, "(printing bug submit message)")
 
@@ -792,6 +810,9 @@
       ShowMessageBoxOnError = false;
     }
 
+    // Write a minidump on Windows, check core dump limits on Linux/Solaris
+    os::check_or_create_dump(_siginfo, _context, buffer, sizeof(buffer));
+
     // reset signal handlers or exception filter; make sure recursive crashes
     // are handled properly.
     reset_signal_handlers();