src/os/windows/vm/os_windows.cpp
Print this page
rev 2110 : [mq]: is-debugger-present
*** 1786,1796 ****
strcpy(buf, saved_jvm_path);
return;
}
buf[0] = '\0';
! if (strcmp(Arguments::sun_java_launcher(), "gamma") == 0) {
// Support for the gamma launcher. Check for an
// JAVA_HOME environment variable
// and fix up the path so it looks like
// libjvm.so is installed there (append a fake suffix
// hotspot/libjvm.so).
--- 1786,1796 ----
strcpy(buf, saved_jvm_path);
return;
}
buf[0] = '\0';
! if (Arguments::created_by_gamma_launcher()) {
// Support for the gamma launcher. Check for an
// JAVA_HOME environment variable
// and fix up the path so it looks like
// libjvm.so is installed there (append a fake suffix
// hotspot/libjvm.so).
*** 3416,3425 ****
--- 3416,3439 ----
_setmode(_fileno(stdout), _O_BINARY);
_setmode(_fileno(stderr), _O_BINARY);
}
+ bool os::is_debugger_attached() {
+ return IsDebuggerPresent() ? true : false;
+ }
+
+
+ void os::check_for_debugger_and_wait(void) {
+ // if running in a debugger on windows, we want to pause before the console is closed
+ if (PauseAtExit && os::is_debugger_attached()) {
+ fprintf(stderr, "Press any key to continue...\n");
+ fgetc(stdin);
+ }
+ }
+
+
int os::message_box(const char* title, const char* message) {
int result = MessageBox(NULL, message, title,
MB_YESNO | MB_ICONERROR | MB_SYSTEMMODAL | MB_DEFAULT_DESKTOP_ONLY);
return result == IDYES;
}