changeset 34648:b7ea5d095ef5

8144192: Enhancements-to-print_siginfo-windows Summary: some small enhancement to os::print_siginfo for Windows Reviewed-by: dholmes
author stuefe
date Sat, 05 Dec 2015 05:15:35 -0500
parents fafb32d71489
children 0c719dcb4507 07b1cc0f6040
files hotspot/src/os/windows/vm/os_windows.cpp
diffstat 1 files changed, 19 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Mon Nov 16 10:58:14 2015 +0100
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Sat Dec 05 05:15:35 2015 -0500
@@ -1801,24 +1801,32 @@
 void os::print_siginfo(outputStream *st, void *siginfo) {
   EXCEPTION_RECORD* er = (EXCEPTION_RECORD*)siginfo;
   st->print("siginfo:");
-  st->print(" ExceptionCode=0x%x", er->ExceptionCode);
-
-  if (er->ExceptionCode == EXCEPTION_ACCESS_VIOLATION &&
-      er->NumberParameters >= 2) {
+
+  char tmp[64];
+  if (os::exception_name(er->ExceptionCode, tmp, sizeof(tmp)) == NULL) {
+    strcpy(tmp, "EXCEPTION_??");
+  }
+  st->print(" %s (0x%x)", tmp, er->ExceptionCode);
+
+  if ((er->ExceptionCode == EXCEPTION_ACCESS_VIOLATION ||
+       er->ExceptionCode == EXCEPTION_IN_PAGE_ERROR) &&
+       er->NumberParameters >= 2) {
     switch (er->ExceptionInformation[0]) {
     case 0: st->print(", reading address"); break;
     case 1: st->print(", writing address"); break;
+    case 8: st->print(", data execution prevention violation at address"); break;
     default: st->print(", ExceptionInformation=" INTPTR_FORMAT,
                        er->ExceptionInformation[0]);
     }
     st->print(" " INTPTR_FORMAT, er->ExceptionInformation[1]);
-  } else if (er->ExceptionCode == EXCEPTION_IN_PAGE_ERROR &&
-             er->NumberParameters >= 2 && UseSharedSpaces) {
-    FileMapInfo* mapinfo = FileMapInfo::current_info();
-    if (mapinfo->is_in_shared_space((void*)er->ExceptionInformation[1])) {
-      st->print("\n\nError accessing class data sharing archive."       \
-                " Mapped file inaccessible during execution, "          \
-                " possible disk/network problem.");
+
+    if (er->ExceptionCode == EXCEPTION_IN_PAGE_ERROR && UseSharedSpaces) {
+      FileMapInfo* mapinfo = FileMapInfo::current_info();
+      if (mapinfo->is_in_shared_space((void*)er->ExceptionInformation[1])) {
+        st->print("\n\nError accessing class data sharing archive."       \
+                  " Mapped file inaccessible during execution, "          \
+                  " possible disk/network problem.");
+      }
     }
   } else {
     int num = er->NumberParameters;