src/share/vm/runtime/java.cpp

Print this page
rev 2110 : [mq]: is-debugger-present

*** 541,554 **** --- 541,565 ---- vm_direct_exit(code); } ShouldNotReachHere(); } + void wait_for_key_press(void) { + #ifdef TARGET_OS_FAMILY_windows + // if running in a debugger on windows, we want to pause before the console is closed + if (Arguments::created_by_gamma_launcher() && PauseAtExit && os::is_debugger_attached()) { + fprintf(stderr, "Press any key to continue...\n"); + fgetc(stdin); + } + #endif + } + void notify_vm_shutdown() { // For now, just a dtrace probe. HS_DTRACE_PROBE(hotspot, vm__shutdown); HS_DTRACE_WORKAROUND_TAIL_CALL_BUG(); + wait_for_key_press(); } void vm_direct_exit(int code) { notify_vm_shutdown(); ::exit(code);