NDK调试:NDK-gdb的不拉app_process。谁当创建app_process二进制? [英] NDK debugging: ndk-gdb fails to pull app_process. Who and when creates the app_process binary?
问题描述
在调查与本土code命中断点问题,我决定进去看看NDK-gdb的工作确定。我已经删除app_process,启动Java调试和运行 NDK-gdb的--force
。你猜怎么着,不创建app_process。 NDK-gdb的--verbose
输出有这一行:
While investigating a problem with hitting breakpoints in native code, I decided to check if ndk-gdb works OK. I've deleted app_process, started Java debugging and ran ndk-gdb --force
. Guess what, app_process is not created. ndk-gdb --verbose
output has this line :
## COMMAND: adb_cmd pull /system/bin/app_process obj/local/armeabi-v7a/app_process
remote object '/system/bin/app_process' not a file or directory
Pulled app_process from device/emulator.
我已经卸载从目标设备的应用程序,重新启动设备和反复。仍然没有app_process。所以,我不知道有什么问题就在这里,我也想知道是该文件的创建,以及通过什么程序/脚本时。
I've uninstalled the app from the target device, rebooted the device and repeated. Still no app_process. So, I wonder what's the problem here, and I also wonder when is this file created, and by what process / script.
推荐答案
如前所述,安卓5.0有 /系统/斌/ app_process
作为一个符号链接 /系统/斌/ app_process32
。因为一个符号,不能用亚行拉
拉时, NDK-gdb的
脚本将不能正常工作,是
As mentioned before, Android 5.0 has /system/bin/app_process
as a symlink to /system/bin/app_process32
. Since a symlink cannot be pulled with adb pull
, the ndk-gdb
script will not be able to work as-is.
修改 NDK-gdb的
如下支持api21变化以及向后兼容< api21:
Change ndk-gdb
as follows to support api21 changes as well as backwards compatibility for < api21:
# Get the app_server binary from the device
APP_PROCESS=$APP_OUT/app_process
if [ "$API_LEVEL" -lt "21" ] ; then
run adb_cmd pull /system/bin/app_process `native_path $APP_PROCESS`
log "Pulled app_process from device/emulator to $APP_PROCESS"
else
run adb_cmd pull /system/bin/app_process32 `native_path $APP_PROCESS`
log "Pulled app_process32 from device/emulator to $APP_PROCESS"
fi
编辑:或:
# Get the app_server binary from the device
APP_PROCESS=$APP_OUT/app_process
APP_PROCESS_DEVICE=app_process32
if [ "$API_LEVEL" -lt "21" ] ; then
APP_PROCESS_DEVICE=app_process
fi
run adb_cmd pull /system/bin/$APP_PROCESS_DEVICE `native_path $APP_PROCESS`
log "Pulled $APP_PROCESS_DEVICE from device/emulator to $APP_PROCESS"
原始的修改也正在于此: http://pastebin.com/YfxNs06U 。需要注意的是这种改变重命名 app_process32
到 app_process
时,它被拉到你的开发机支持具有单一的调试配置在月食。
Original Change is also here: http://pastebin.com/YfxNs06U. Note that this change renames app_process32
to app_process
when it is pulled to your development machine to support having a single debugging config in Eclipse.
这篇关于NDK调试:NDK-gdb的不拉app_process。谁当创建app_process二进制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!