changeset 26569:5fcbc13c071c

8056930: Output host info under some condition for core dump Summary: Output host name after java crashed for debug version. Reviewed-by: dholmes, ccheung Contributed-by: yumin.qi@oracle.com
author minqi
date Mon, 08 Sep 2014 22:48:09 -0700
parents b8b544832bce
children 8a96177975bc
files hotspot/src/os/posix/vm/os_posix.cpp hotspot/src/os/windows/vm/os_windows.cpp
diffstat 2 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/hotspot/src/os/posix/vm/os_posix.cpp	Mon Sep 08 23:49:39 2014 +0400
+++ b/hotspot/src/os/posix/vm/os_posix.cpp	Mon Sep 08 22:48:09 2014 -0700
@@ -215,6 +215,9 @@
   struct utsname name;
   uname(&name);
   st->print("%s ", name.sysname);
+#ifdef ASSERT
+  st->print("%s ", name.nodename);
+#endif
   st->print("%s ", name.release);
   st->print("%s ", name.version);
   st->print("%s", name.machine);
--- a/hotspot/src/os/windows/vm/os_windows.cpp	Mon Sep 08 23:49:39 2014 +0400
+++ b/hotspot/src/os/windows/vm/os_windows.cpp	Mon Sep 08 22:48:09 2014 -0700
@@ -1588,8 +1588,17 @@
 }
 
 void os::print_os_info(outputStream* st) {
-  st->print("OS:");
-
+#ifdef ASSERT
+  char buffer[1024];
+  DWORD size = sizeof(buffer);
+  st->print(" HostName: ");
+  if (GetComputerNameEx(ComputerNameDnsHostname, buffer, &size)) {
+    st->print("%s", buffer);
+  } else {
+    st->print("N/A");
+  }
+#endif
+  st->print(" OS:");
   os::win32::print_windows_version(st);
 }