Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
6e17f9b1
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6e17f9b1
编写于
4月 25, 2019
作者:
K
kaddepalli
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8219914: Change the environment variable for Java Access Bridge logging to have a directory.
Reviewed-by: prr
上级
2dc1cabf
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
22 addition
and
32 deletion
+22
-32
src/windows/native/sun/bridge/AccessBridgeDebug.cpp
src/windows/native/sun/bridge/AccessBridgeDebug.cpp
+16
-26
src/windows/native/sun/bridge/AccessBridgeDebug.h
src/windows/native/sun/bridge/AccessBridgeDebug.h
+2
-2
src/windows/native/sun/bridge/JavaAccessBridge.cpp
src/windows/native/sun/bridge/JavaAccessBridge.cpp
+2
-2
src/windows/native/sun/bridge/WinAccessBridge.cpp
src/windows/native/sun/bridge/WinAccessBridge.cpp
+2
-2
未找到文件。
src/windows/native/sun/bridge/AccessBridgeDebug.cpp
浏览文件 @
6e17f9b1
/*
/*
* Copyright (c) 2005, 201
3
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
9
, 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
...
@@ -40,34 +40,24 @@ extern "C" {
...
@@ -40,34 +40,24 @@ extern "C" {
static
FILE
*
logFP
=
nullptr
;
static
FILE
*
logFP
=
nullptr
;
void
initializeFileLogger
(
char
*
suffix
)
{
void
initializeFileLogger
(
char
*
fileName
)
{
auto
var
=
"JAVA_ACCESSBRIDGE_LOG
FILE
"
;
auto
var
=
"JAVA_ACCESSBRIDGE_LOG
DIR
"
;
const
auto
envfilePath
=
getenv
(
var
);
const
auto
envfilePath
=
getenv
(
var
);
if
(
envfilePath
!=
nullptr
)
{
if
(
envfilePath
!=
nullptr
&&
fileName
!=
nullptr
)
{
auto
ext
=
const_cast
<
char
*>
(
strrchr
(
envfilePath
,
'.'
));
auto
envFilePathLength
=
strlen
(
envfilePath
);
auto
filePath
=
static_cast
<
char
*>
(
nullptr
);
auto
fileNameLength
=
strlen
(
fileName
);
auto
len
=
strlen
(
envfilePath
);
auto
filePathSize
=
envFilePathLength
+
1
+
fileNameLength
+
5
;
//1 for "/", 5 for ".log" and 0;
auto
suffixlen
=
suffix
!=
nullptr
?
strlen
(
suffix
)
:
(
decltype
(
strlen
(
nullptr
)))
0
;
auto
filePath
=
new
char
[
filePathSize
];
memset
(
filePath
,
0
,
filePathSize
*
sizeof
(
char
));
if
(
ext
==
nullptr
)
{
memcpy
(
filePath
,
envfilePath
,
envFilePathLength
*
sizeof
(
char
));
filePath
=
new
char
[
len
+
suffixlen
+
5
];
filePath
[
envFilePathLength
]
=
'/'
;
memset
(
filePath
,
0
,
len
+
suffixlen
+
5
);
memcpy
(
filePath
+
envFilePathLength
+
1
,
fileName
,
fileNameLength
*
sizeof
(
char
));
memcpy
(
filePath
,
envfilePath
,
len
);
memcpy
(
filePath
+
envFilePathLength
+
1
+
fileNameLength
,
".log"
,
4
*
sizeof
(
char
));
memcpy
(
filePath
+
len
,
suffix
,
suffixlen
);
memcpy
(
filePath
+
len
+
suffixlen
,
".log"
,
4
);
}
else
{
auto
extLen
=
strlen
(
ext
);
filePath
=
new
char
[
len
+
suffixlen
+
1
];
memset
(
filePath
,
0
,
len
+
suffixlen
+
1
);
memcpy
(
filePath
,
envfilePath
,
len
-
extLen
);
memcpy
(
filePath
+
len
-
extLen
,
suffix
,
suffixlen
);
memcpy
(
filePath
+
len
+
suffixlen
-
extLen
,
ext
,
extLen
);
}
logFP
=
fopen
(
filePath
,
"w"
);
logFP
=
fopen
(
filePath
,
"w"
);
if
(
logFP
==
nullptr
)
{
if
(
logFP
==
nullptr
)
{
PrintDebugString
(
"couldnot open file %s"
,
filePath
);
printf
(
"
\n
%s
\n
"
,
filePath
);
PrintDebugString
(
"Could not open file %s"
,
filePath
);
}
}
delete
[]
filePath
;
delete
[]
filePath
;
...
@@ -114,7 +104,7 @@ auto getTimeStamp() -> long long {
...
@@ -114,7 +104,7 @@ auto getTimeStamp() -> long long {
#endif
#endif
#endif
#endif
if
(
logFP
)
{
if
(
logFP
)
{
fprintf
(
logFP
,
"[%ll
d
u] "
,
getTimeStamp
());
fprintf
(
logFP
,
"[%llu] "
,
getTimeStamp
());
va_list
args
;
va_list
args
;
va_start
(
args
,
msg
);
va_start
(
args
,
msg
);
vfprintf
(
logFP
,
msg
,
args
);
vfprintf
(
logFP
,
msg
,
args
);
...
...
src/windows/native/sun/bridge/AccessBridgeDebug.h
浏览文件 @
6e17f9b1
/*
/*
* Copyright (c) 2005, 201
4
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
9
, 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
...
@@ -53,7 +53,7 @@ extern "C" {
...
@@ -53,7 +53,7 @@ extern "C" {
void
PrintJavaDebugString
(
char
*
msg
,
...);
void
PrintJavaDebugString
(
char
*
msg
,
...);
void
wPrintJavaDebugString
(
wchar_t
*
msg
,
...);
void
wPrintJavaDebugString
(
wchar_t
*
msg
,
...);
void
wPrintDebugString
(
wchar_t
*
msg
,
...);
void
wPrintDebugString
(
wchar_t
*
msg
,
...);
void
initializeFileLogger
(
char
*
suffix
);
void
initializeFileLogger
(
char
*
fileName
);
void
finalizeFileLogger
();
void
finalizeFileLogger
();
#ifdef __cplusplus
#ifdef __cplusplus
...
...
src/windows/native/sun/bridge/JavaAccessBridge.cpp
浏览文件 @
6e17f9b1
/*
/*
* Copyright (c) 2005, 201
5
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
9
, 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
...
@@ -167,7 +167,7 @@ extern "C" {
...
@@ -167,7 +167,7 @@ extern "C" {
JavaAccessBridge
::
JavaAccessBridge
(
HINSTANCE
hInstance
)
{
JavaAccessBridge
::
JavaAccessBridge
(
HINSTANCE
hInstance
)
{
windowsInstance
=
hInstance
;
windowsInstance
=
hInstance
;
ATs
=
(
AccessBridgeATInstance
*
)
0
;
ATs
=
(
AccessBridgeATInstance
*
)
0
;
initializeFileLogger
(
"
_
java_access_bridge"
);
initializeFileLogger
(
"java_access_bridge"
);
initBroadcastMessageIDs
();
// get the unique to us broadcast msg. IDs
initBroadcastMessageIDs
();
// get the unique to us broadcast msg. IDs
}
}
...
...
src/windows/native/sun/bridge/WinAccessBridge.cpp
浏览文件 @
6e17f9b1
/*
/*
* Copyright (c) 2005, 201
6
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 201
9
, 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
...
@@ -130,7 +130,7 @@ extern "C" {
...
@@ -130,7 +130,7 @@ extern "C" {
switch
(
fdwReason
)
{
switch
(
fdwReason
)
{
case
DLL_PROCESS_ATTACH
:
// A Windows executable loaded us
case
DLL_PROCESS_ATTACH
:
// A Windows executable loaded us
initializeFileLogger
(
"
_
windows_access_bridge"
);
initializeFileLogger
(
"windows_access_bridge"
);
PrintDebugString
(
"[INFO]: DLL_PROCESS_ATTACH"
);
PrintDebugString
(
"[INFO]: DLL_PROCESS_ATTACH"
);
theWindowsAccessBridge
=
new
WinAccessBridge
(
hinstDll
);
theWindowsAccessBridge
=
new
WinAccessBridge
(
hinstDll
);
break
;
break
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录