Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_34031325
engine
提交
21c98464
E
engine
项目概览
qq_34031325
/
engine
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
21c98464
编写于
11月 11, 2016
作者:
J
Jason Simmons
提交者:
GitHub
11月 11, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update the Flutter GDB script to work with Android N (#3220)
上级
ac479c4f
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
23 addition
and
11 deletion
+23
-11
sky/tools/flutter_gdb
sky/tools/flutter_gdb
+23
-11
未找到文件。
sky/tools/flutter_gdb
浏览文件 @
21c98464
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
import
argparse
import
argparse
import
os
import
os
import
re
import
re
import
shutil
import
subprocess
import
subprocess
import
sys
import
sys
...
@@ -61,9 +62,11 @@ class GdbClient(object):
...
@@ -61,9 +62,11 @@ class GdbClient(object):
parser
.
add_argument
(
'--no-pull-libs'
,
action
=
"store_false"
,
parser
.
add_argument
(
'--no-pull-libs'
,
action
=
"store_false"
,
default
=
True
,
dest
=
"pull_libs"
,
default
=
True
,
dest
=
"pull_libs"
,
help
=
"Do not copy system libraries from the device to the host"
)
help
=
"Do not copy system libraries from the device to the host"
)
parser
.
add_argument
(
'--sysroot'
,
action
=
"store_true"
,
default
=
False
,
help
=
'Create a sysroot tree suitable for debugging on Android N'
)
parser
.
set_defaults
(
func
=
self
.
run
)
parser
.
set_defaults
(
func
=
self
.
run
)
def
_copy_system_libs
(
self
,
adb_path
,
package
):
def
_copy_system_libs
(
self
,
adb_path
,
package
,
sysroot
):
"""Copy libraries used by the Flutter process from the device to the host."""
"""Copy libraries used by the Flutter process from the device to the host."""
package_pid
=
_find_package_pid
(
adb_path
,
package
)
package_pid
=
_find_package_pid
(
adb_path
,
package
)
if
package_pid
is
None
:
if
package_pid
is
None
:
...
@@ -72,18 +75,24 @@ class GdbClient(object):
...
@@ -72,18 +75,24 @@ class GdbClient(object):
# Find library files that are mapped into the process.
# Find library files that are mapped into the process.
proc_maps
=
subprocess
.
check_output
(
proc_maps
=
subprocess
.
check_output
(
[
adb_path
,
'shell'
,
'run-as'
,
package
,
'cat'
,
'/proc/%d/maps'
%
package_pid
])
[
adb_path
,
'shell'
,
'run-as'
,
package
,
'cat'
,
'/proc/%d/maps'
%
package_pid
])
proc_libs
=
re
.
findall
(
'(/system/.*\.
so
)\s*$'
,
proc_maps
,
re
.
MULTILINE
)
proc_libs
=
re
.
findall
(
'(/system/.*\.
(?:so|oat)
)\s*$'
,
proc_maps
,
re
.
MULTILINE
)
device_libs
=
set
(
proc_libs
)
if
sysroot
:
device_libs
.
add
(
'/system/bin/linker'
)
device_libs
=
set
((
lib
,
lib
[
1
:])
for
lib
in
proc_libs
)
device_libs
.
add
((
'/system/bin/linker'
,
'system/bin/linker'
))
device_libs
.
add
((
'/system/bin/app_process32'
,
'system/bin/app_process32'
))
else
:
device_libs
=
set
((
lib
,
os
.
path
.
basename
(
lib
))
for
lib
in
proc_libs
)
device_libs
.
add
((
'/system/bin/linker'
,
'linker'
))
if
not
os
.
path
.
exists
(
GdbClient
.
SYSTEM_LIBS_PATH
):
shutil
.
rmtree
(
GdbClient
.
SYSTEM_LIBS_PATH
)
os
.
makedirs
(
GdbClient
.
SYSTEM_LIBS_PATH
)
dev_null
=
open
(
os
.
devnull
,
'w'
)
dev_null
=
open
(
os
.
devnull
,
'w'
)
for
lib
in
sorted
(
device_libs
):
for
lib
,
local_path
in
sorted
(
device_libs
):
print
'Copying %s'
%
lib
print
'Copying %s'
%
lib
local_path
=
os
.
path
.
join
(
GdbClient
.
SYSTEM_LIBS_PATH
,
os
.
path
.
basename
(
lib
))
local_path
=
os
.
path
.
join
(
GdbClient
.
SYSTEM_LIBS_PATH
,
local_path
)
if
not
os
.
path
.
exists
(
os
.
path
.
dirname
(
local_path
)):
os
.
makedirs
(
os
.
path
.
dirname
(
local_path
))
subprocess
.
check_call
([
adb_path
,
'pull'
,
lib
,
local_path
],
stderr
=
dev_null
)
subprocess
.
check_call
([
adb_path
,
'pull'
,
lib
,
local_path
],
stderr
=
dev_null
)
return
True
return
True
...
@@ -93,20 +102,23 @@ class GdbClient(object):
...
@@ -93,20 +102,23 @@ class GdbClient(object):
adb_path
=
os
.
path
.
join
(
flutter_root
,
ADB_LOCAL_PATH
)
adb_path
=
os
.
path
.
join
(
flutter_root
,
ADB_LOCAL_PATH
)
if
args
.
pull_libs
:
if
args
.
pull_libs
:
if
not
self
.
_copy_system_libs
(
adb_path
,
args
.
package
):
if
not
self
.
_copy_system_libs
(
adb_path
,
args
.
package
,
args
.
sysroot
):
return
1
return
1
subprocess
.
check_call
(
subprocess
.
check_call
(
[
adb_path
,
'forward'
,
'tcp:%d'
%
args
.
gdb_port
,
'tcp:%d'
%
args
.
gdb_port
])
[
adb_path
,
'forward'
,
'tcp:%d'
%
args
.
gdb_port
,
'tcp:%d'
%
args
.
gdb_port
])
eval_commands
=
[
'target remote localhost:%d'
%
args
.
gdb_port
]
debug_out_path
=
os
.
path
.
join
(
flutter_root
,
'out/%s'
%
args
.
local_engine
)
debug_out_path
=
os
.
path
.
join
(
flutter_root
,
'out/%s'
%
args
.
local_engine
)
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
debug_out_path
,
'libsky_shell.so'
)):
if
not
os
.
path
.
exists
(
os
.
path
.
join
(
debug_out_path
,
'libsky_shell.so'
)):
print
'Unable to find libsky_shell.so. Make sure you have completed a %s build'
%
args
.
local_engine
print
'Unable to find libsky_shell.so. Make sure you have completed a %s build'
%
args
.
local_engine
return
1
return
1
eval_commands
=
[]
if
args
.
sysroot
:
eval_commands
.
append
(
'set sysroot %s'
%
GdbClient
.
SYSTEM_LIBS_PATH
)
eval_commands
.
append
(
'set solib-search-path %s:%s'
%
eval_commands
.
append
(
'set solib-search-path %s:%s'
%
(
debug_out_path
,
GdbClient
.
SYSTEM_LIBS_PATH
))
(
debug_out_path
,
GdbClient
.
SYSTEM_LIBS_PATH
))
eval_commands
.
append
(
'target remote localhost:%d'
%
args
.
gdb_port
)
exec_command
=
[
os
.
path
.
join
(
flutter_root
,
self
.
_gdb_local_path
())]
exec_command
=
[
os
.
path
.
join
(
flutter_root
,
self
.
_gdb_local_path
())]
for
command
in
eval_commands
:
for
command
in
eval_commands
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录