mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 22:34:27 +02:00
7022037: Pause when exiting if debugger is attached on windows
Reviewed-by: dsamersoff, kamg, hosterda
This commit is contained in:
parent
52708b0603
commit
cc6f461357
11 changed files with 63 additions and 5 deletions
|
@ -78,6 +78,7 @@ bool Arguments::_xdebug_mode = false;
|
|||
const char* Arguments::_java_vendor_url_bug = DEFAULT_VENDOR_URL_BUG;
|
||||
const char* Arguments::_sun_java_launcher = DEFAULT_JAVA_LAUNCHER;
|
||||
int Arguments::_sun_java_launcher_pid = -1;
|
||||
bool Arguments::_created_by_gamma_launcher = false;
|
||||
|
||||
// These parameters are reset in method parse_vm_init_args(JavaVMInitArgs*)
|
||||
bool Arguments::_AlwaysCompileLoopMethods = AlwaysCompileLoopMethods;
|
||||
|
@ -1656,6 +1657,9 @@ void Arguments::process_java_compiler_argument(char* arg) {
|
|||
|
||||
void Arguments::process_java_launcher_argument(const char* launcher, void* extra_info) {
|
||||
_sun_java_launcher = strdup(launcher);
|
||||
if (strcmp("gamma", _sun_java_launcher) == 0) {
|
||||
_created_by_gamma_launcher = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool Arguments::created_by_java_launcher() {
|
||||
|
@ -1663,6 +1667,10 @@ bool Arguments::created_by_java_launcher() {
|
|||
return strcmp(DEFAULT_JAVA_LAUNCHER, _sun_java_launcher) != 0;
|
||||
}
|
||||
|
||||
bool Arguments::created_by_gamma_launcher() {
|
||||
return _created_by_gamma_launcher;
|
||||
}
|
||||
|
||||
//===========================================================================================================
|
||||
// Parsing of main arguments
|
||||
|
||||
|
@ -3155,6 +3163,16 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
|
|||
}
|
||||
}
|
||||
|
||||
// set PauseAtExit if the gamma launcher was used and a debugger is attached
|
||||
// but only if not already set on the commandline
|
||||
if (Arguments::created_by_gamma_launcher() && os::is_debugger_attached()) {
|
||||
bool set = false;
|
||||
CommandLineFlags::wasSetOnCmdline("PauseAtExit", &set);
|
||||
if (!set) {
|
||||
FLAG_SET_DEFAULT(PauseAtExit, true);
|
||||
}
|
||||
}
|
||||
|
||||
return JNI_OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue