Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sxychenjing
engine
提交
c107969e
E
engine
项目概览
sxychenjing
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
E
engine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
c107969e
编写于
2月 05, 2020
作者:
D
Dan Field
提交者:
GitHub
2月 05, 2020
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix build_id logic for fuchsia symbols (#16397)
上级
036c370c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
17 deletion
+20
-17
tools/fuchsia/copy_debug_symbols.py
tools/fuchsia/copy_debug_symbols.py
+20
-17
未找到文件。
tools/fuchsia/copy_debug_symbols.py
浏览文件 @
c107969e
...
...
@@ -11,6 +11,7 @@
"""
import
argparse
import
errno
import
json
import
os
import
re
...
...
@@ -26,10 +27,16 @@ def Touch(fname):
def
GetBuildIdParts
(
exec_path
,
read_elf
):
file_out
=
subprocess
.
check_output
(
[
read_elf
,
'--hex-dump=.note.gnu.build-id'
,
exec_path
])
second_line
=
file_out
.
splitlines
()[
-
1
].
split
()
build_id
=
second_line
[
1
]
+
second_line
[
2
]
sha1_pattern
=
re
.
compile
(
r
'[0-9a-fA-F\-]+'
)
file_out
=
subprocess
.
check_output
([
read_elf
,
'-n'
,
exec_path
])
build_id_line
=
file_out
.
splitlines
()[
-
1
].
split
()
if
(
build_id_line
[
0
]
!=
'Build'
or
build_id_line
[
1
]
!=
'ID:'
or
not
sha1_pattern
.
match
(
build_id_line
[
-
1
])
or
not
len
(
build_id_line
[
-
1
])
>
2
):
raise
Exception
(
'Expected the last line of llvm-readelf to match "Build ID <Hex String>" Got: %s'
%
file_out
)
build_id
=
build_id_line
[
-
1
]
return
{
'build_id'
:
build_id
,
'prefix_dir'
:
build_id
[:
2
],
...
...
@@ -86,19 +93,15 @@ def main():
parts
=
GetBuildIdParts
(
args
.
exec_path
,
args
.
read_elf
)
dbg_prefix_base
=
os
.
path
.
join
(
args
.
dest
,
parts
[
'prefix_dir'
])
success
=
False
for
_
in
range
(
3
):
try
:
if
not
os
.
path
.
exists
(
dbg_prefix_base
):
os
.
makedirs
(
dbg_prefix_base
)
success
=
True
break
except
OSError
as
error
:
print
'Failed to create dir %s, error: %s. sleeping...'
%
(
dbg_prefix_base
,
error
)
time
.
sleep
(
3
)
if
not
success
:
# Multiple processes may be trying to create the same directory.
# TODO(dnfield): use exist_ok when we upgrade to python 3, rather than try
try
:
os
.
makedirs
(
dbg_prefix_base
)
except
OSError
as
e
:
if
e
.
errno
!=
errno
.
EEXIST
:
raise
if
not
os
.
path
.
exists
(
dbg_prefix_base
):
print
'Unable to create directory: %s.'
%
dbg_prefix_base
return
1
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录