Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_hotspot
提交
2b06608f
D
dragonwell8_hotspot
项目概览
openanolis
/
dragonwell8_hotspot
通知
2
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_hotspot
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2b06608f
编写于
2月 28, 2011
作者:
S
sla
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
7022037: Pause when exiting if debugger is attached on windows
Reviewed-by: dsamersoff, kamg, hosterda
上级
7933877a
变更
11
隐藏空白更改
内联
并排
Showing
11 changed file
with
63 addition
and
5 deletion
+63
-5
src/os/linux/vm/os_linux.cpp
src/os/linux/vm/os_linux.cpp
+1
-1
src/os/posix/vm/os_posix.cpp
src/os/posix/vm/os_posix.cpp
+9
-0
src/os/solaris/vm/os_solaris.cpp
src/os/solaris/vm/os_solaris.cpp
+1
-1
src/os/windows/vm/os_windows.cpp
src/os/windows/vm/os_windows.cpp
+14
-1
src/share/vm/runtime/arguments.cpp
src/share/vm/runtime/arguments.cpp
+18
-0
src/share/vm/runtime/arguments.hpp
src/share/vm/runtime/arguments.hpp
+6
-1
src/share/vm/runtime/globals.hpp
src/share/vm/runtime/globals.hpp
+3
-0
src/share/vm/runtime/java.cpp
src/share/vm/runtime/java.cpp
+3
-0
src/share/vm/runtime/os.hpp
src/share/vm/runtime/os.hpp
+6
-0
src/share/vm/runtime/thread.cpp
src/share/vm/runtime/thread.cpp
+1
-0
src/share/vm/utilities/vmError.cpp
src/share/vm/utilities/vmError.cpp
+1
-1
未找到文件。
src/os/linux/vm/os_linux.cpp
浏览文件 @
2b06608f
...
@@ -2213,7 +2213,7 @@ void os::jvm_path(char *buf, jint buflen) {
...
@@ -2213,7 +2213,7 @@ void os::jvm_path(char *buf, jint buflen) {
if
(
rp
==
NULL
)
if
(
rp
==
NULL
)
return
;
return
;
if
(
strcmp
(
Arguments
::
sun_java_launcher
(),
"gamma"
)
==
0
)
{
if
(
Arguments
::
created_by_gamma_launcher
()
)
{
// Support for the gamma launcher. Typical value for buf is
// Support for the gamma launcher. Typical value for buf is
// "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so". If "/jre/lib/" appears at
// "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so". If "/jre/lib/" appears at
// the right place in the string, then assume we are installed in a JDK and
// the right place in the string, then assume we are installed in a JDK and
...
...
src/os/posix/vm/os_posix.cpp
浏览文件 @
2b06608f
...
@@ -59,3 +59,12 @@ void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char*
...
@@ -59,3 +59,12 @@ void os::check_or_create_dump(void* exceptionRecord, void* contextRecord, char*
VMError
::
report_coredump_status
(
buffer
,
success
);
VMError
::
report_coredump_status
(
buffer
,
success
);
}
}
bool
os
::
is_debugger_attached
()
{
// not implemented
return
false
;
}
void
os
::
wait_for_keypress_at_exit
(
void
)
{
// don't do anything on posix platforms
return
;
}
src/os/solaris/vm/os_solaris.cpp
浏览文件 @
2b06608f
...
@@ -2507,7 +2507,7 @@ void os::jvm_path(char *buf, jint buflen) {
...
@@ -2507,7 +2507,7 @@ void os::jvm_path(char *buf, jint buflen) {
assert
(
ret
!=
0
,
"cannot locate libjvm"
);
assert
(
ret
!=
0
,
"cannot locate libjvm"
);
realpath
((
char
*
)
dlinfo
.
dli_fname
,
buf
);
realpath
((
char
*
)
dlinfo
.
dli_fname
,
buf
);
if
(
strcmp
(
Arguments
::
sun_java_launcher
(),
"gamma"
)
==
0
)
{
if
(
Arguments
::
created_by_gamma_launcher
()
)
{
// Support for the gamma launcher. Typical value for buf is
// Support for the gamma launcher. Typical value for buf is
// "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so". If "/jre/lib/" appears at
// "<JAVA_HOME>/jre/lib/<arch>/<vmtype>/libjvm.so". If "/jre/lib/" appears at
// the right place in the string, then assume we are installed in a JDK and
// the right place in the string, then assume we are installed in a JDK and
...
...
src/os/windows/vm/os_windows.cpp
浏览文件 @
2b06608f
...
@@ -1788,7 +1788,7 @@ void os::jvm_path(char *buf, jint buflen) {
...
@@ -1788,7 +1788,7 @@ void os::jvm_path(char *buf, jint buflen) {
}
}
buf
[
0
]
=
'\0'
;
buf
[
0
]
=
'\0'
;
if
(
strcmp
(
Arguments
::
sun_java_launcher
(),
"gamma"
)
==
0
)
{
if
(
Arguments
::
created_by_gamma_launcher
()
)
{
// Support for the gamma launcher. Check for an
// Support for the gamma launcher. Check for an
// JAVA_HOME environment variable
// JAVA_HOME environment variable
// and fix up the path so it looks like
// and fix up the path so it looks like
...
@@ -3418,6 +3418,19 @@ void os::win32::setmode_streams() {
...
@@ -3418,6 +3418,19 @@ void os::win32::setmode_streams() {
}
}
bool
os
::
is_debugger_attached
()
{
return
IsDebuggerPresent
()
?
true
:
false
;
}
void
os
::
wait_for_keypress_at_exit
(
void
)
{
if
(
PauseAtExit
)
{
fprintf
(
stderr
,
"Press any key to continue...
\n
"
);
fgetc
(
stdin
);
}
}
int
os
::
message_box
(
const
char
*
title
,
const
char
*
message
)
{
int
os
::
message_box
(
const
char
*
title
,
const
char
*
message
)
{
int
result
=
MessageBox
(
NULL
,
message
,
title
,
int
result
=
MessageBox
(
NULL
,
message
,
title
,
MB_YESNO
|
MB_ICONERROR
|
MB_SYSTEMMODAL
|
MB_DEFAULT_DESKTOP_ONLY
);
MB_YESNO
|
MB_ICONERROR
|
MB_SYSTEMMODAL
|
MB_DEFAULT_DESKTOP_ONLY
);
...
...
src/share/vm/runtime/arguments.cpp
浏览文件 @
2b06608f
...
@@ -78,6 +78,7 @@ bool Arguments::_xdebug_mode = false;
...
@@ -78,6 +78,7 @@ bool Arguments::_xdebug_mode = false;
const
char
*
Arguments
::
_java_vendor_url_bug
=
DEFAULT_VENDOR_URL_BUG
;
const
char
*
Arguments
::
_java_vendor_url_bug
=
DEFAULT_VENDOR_URL_BUG
;
const
char
*
Arguments
::
_sun_java_launcher
=
DEFAULT_JAVA_LAUNCHER
;
const
char
*
Arguments
::
_sun_java_launcher
=
DEFAULT_JAVA_LAUNCHER
;
int
Arguments
::
_sun_java_launcher_pid
=
-
1
;
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*)
// These parameters are reset in method parse_vm_init_args(JavaVMInitArgs*)
bool
Arguments
::
_AlwaysCompileLoopMethods
=
AlwaysCompileLoopMethods
;
bool
Arguments
::
_AlwaysCompileLoopMethods
=
AlwaysCompileLoopMethods
;
...
@@ -1656,6 +1657,9 @@ void Arguments::process_java_compiler_argument(char* arg) {
...
@@ -1656,6 +1657,9 @@ void Arguments::process_java_compiler_argument(char* arg) {
void
Arguments
::
process_java_launcher_argument
(
const
char
*
launcher
,
void
*
extra_info
)
{
void
Arguments
::
process_java_launcher_argument
(
const
char
*
launcher
,
void
*
extra_info
)
{
_sun_java_launcher
=
strdup
(
launcher
);
_sun_java_launcher
=
strdup
(
launcher
);
if
(
strcmp
(
"gamma"
,
_sun_java_launcher
)
==
0
)
{
_created_by_gamma_launcher
=
true
;
}
}
}
bool
Arguments
::
created_by_java_launcher
()
{
bool
Arguments
::
created_by_java_launcher
()
{
...
@@ -1663,6 +1667,10 @@ 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
;
return
strcmp
(
DEFAULT_JAVA_LAUNCHER
,
_sun_java_launcher
)
!=
0
;
}
}
bool
Arguments
::
created_by_gamma_launcher
()
{
return
_created_by_gamma_launcher
;
}
//===========================================================================================================
//===========================================================================================================
// Parsing of main arguments
// Parsing of main arguments
...
@@ -3155,6 +3163,16 @@ jint Arguments::parse(const JavaVMInitArgs* args) {
...
@@ -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
;
return
JNI_OK
;
}
}
...
...
src/share/vm/runtime/arguments.hpp
浏览文件 @
2b06608f
/*
/*
* Copyright (c) 1997, 201
0
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 201
1
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -257,6 +257,9 @@ class Arguments : AllStatic {
...
@@ -257,6 +257,9 @@ class Arguments : AllStatic {
// sun.java.launcher.pid, private property
// sun.java.launcher.pid, private property
static
int
_sun_java_launcher_pid
;
static
int
_sun_java_launcher_pid
;
// was this VM created by the gamma launcher
static
bool
_created_by_gamma_launcher
;
// Option flags
// Option flags
static
bool
_has_profile
;
static
bool
_has_profile
;
static
bool
_has_alloc_profile
;
static
bool
_has_alloc_profile
;
...
@@ -444,6 +447,8 @@ class Arguments : AllStatic {
...
@@ -444,6 +447,8 @@ class Arguments : AllStatic {
static
const
char
*
sun_java_launcher
()
{
return
_sun_java_launcher
;
}
static
const
char
*
sun_java_launcher
()
{
return
_sun_java_launcher
;
}
// Was VM created by a Java launcher?
// Was VM created by a Java launcher?
static
bool
created_by_java_launcher
();
static
bool
created_by_java_launcher
();
// Was VM created by the gamma Java launcher?
static
bool
created_by_gamma_launcher
();
// -Dsun.java.launcher.pid
// -Dsun.java.launcher.pid
static
int
sun_java_launcher_pid
()
{
return
_sun_java_launcher_pid
;
}
static
int
sun_java_launcher_pid
()
{
return
_sun_java_launcher_pid
;
}
...
...
src/share/vm/runtime/globals.hpp
浏览文件 @
2b06608f
...
@@ -3730,6 +3730,9 @@ class CommandLineFlags {
...
@@ -3730,6 +3730,9 @@ class CommandLineFlags {
"The file to create and for whose removal to await when pausing " \
"The file to create and for whose removal to await when pausing " \
"at startup. (default: ./vm.paused.<pid>)") \
"at startup. (default: ./vm.paused.<pid>)") \
\
\
diagnostic(bool, PauseAtExit, false, \
"Pause and wait for keypress on exit if a debugger is attached") \
\
product(bool, ExtendedDTraceProbes, false, \
product(bool, ExtendedDTraceProbes, false, \
"Enable performance-impacting dtrace probes") \
"Enable performance-impacting dtrace probes") \
\
\
...
...
src/share/vm/runtime/java.cpp
浏览文件 @
2b06608f
...
@@ -551,6 +551,7 @@ void notify_vm_shutdown() {
...
@@ -551,6 +551,7 @@ void notify_vm_shutdown() {
void
vm_direct_exit
(
int
code
)
{
void
vm_direct_exit
(
int
code
)
{
notify_vm_shutdown
();
notify_vm_shutdown
();
os
::
wait_for_keypress_at_exit
();
::
exit
(
code
);
::
exit
(
code
);
}
}
...
@@ -577,11 +578,13 @@ void vm_perform_shutdown_actions() {
...
@@ -577,11 +578,13 @@ void vm_perform_shutdown_actions() {
void
vm_shutdown
()
void
vm_shutdown
()
{
{
vm_perform_shutdown_actions
();
vm_perform_shutdown_actions
();
os
::
wait_for_keypress_at_exit
();
os
::
shutdown
();
os
::
shutdown
();
}
}
void
vm_abort
(
bool
dump_core
)
{
void
vm_abort
(
bool
dump_core
)
{
vm_perform_shutdown_actions
();
vm_perform_shutdown_actions
();
os
::
wait_for_keypress_at_exit
();
os
::
abort
(
dump_core
);
os
::
abort
(
dump_core
);
ShouldNotReachHere
();
ShouldNotReachHere
();
}
}
...
...
src/share/vm/runtime/os.hpp
浏览文件 @
2b06608f
...
@@ -492,6 +492,12 @@ class os: AllStatic {
...
@@ -492,6 +492,12 @@ class os: AllStatic {
static
void
print_location
(
outputStream
*
st
,
intptr_t
x
,
bool
verbose
=
false
);
static
void
print_location
(
outputStream
*
st
,
intptr_t
x
,
bool
verbose
=
false
);
static
size_t
lasterror
(
char
*
buf
,
size_t
len
);
static
size_t
lasterror
(
char
*
buf
,
size_t
len
);
// Determines whether the calling process is being debugged by a user-mode debugger.
static
bool
is_debugger_attached
();
// wait for a key press if PauseAtExit is set
static
void
wait_for_keypress_at_exit
(
void
);
// The following two functions are used by fatal error handler to trace
// The following two functions are used by fatal error handler to trace
// native (C) frames. They are not part of frame.hpp/frame.cpp because
// native (C) frames. They are not part of frame.hpp/frame.cpp because
// frame.hpp/cpp assume thread is JavaThread, and also because different
// frame.hpp/cpp assume thread is JavaThread, and also because different
...
...
src/share/vm/runtime/thread.cpp
浏览文件 @
2b06608f
...
@@ -3644,6 +3644,7 @@ bool Threads::destroy_vm() {
...
@@ -3644,6 +3644,7 @@ bool Threads::destroy_vm() {
if
(
ShowMessageBoxOnError
&&
is_error_reported
())
{
if
(
ShowMessageBoxOnError
&&
is_error_reported
())
{
os
::
infinite_sleep
();
os
::
infinite_sleep
();
}
}
os
::
wait_for_keypress_at_exit
();
if
(
JDK_Version
::
is_jdk12x_version
())
{
if
(
JDK_Version
::
is_jdk12x_version
())
{
// We are the last thread running, so check if finalizers should be run.
// We are the last thread running, so check if finalizers should be run.
...
...
src/share/vm/utilities/vmError.cpp
浏览文件 @
2b06608f
...
@@ -802,7 +802,7 @@ void VMError::report_and_die() {
...
@@ -802,7 +802,7 @@ void VMError::report_and_die() {
first_error_tid
=
mytid
;
first_error_tid
=
mytid
;
set_error_reported
();
set_error_reported
();
if
(
ShowMessageBoxOnError
)
{
if
(
ShowMessageBoxOnError
||
PauseAtExit
)
{
show_message_box
(
buffer
,
sizeof
(
buffer
));
show_message_box
(
buffer
,
sizeof
(
buffer
));
// User has asked JVM to abort. Reset ShowMessageBoxOnError so the
// User has asked JVM to abort. Reset ShowMessageBoxOnError so the
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录