NDK调试:ndk-gdb无法拉动app_process。谁和何时创建app_process二进制文件? [英] NDK debugging: ndk-gdb fails to pull app_process. Who and when creates the app_process binary?

查看:188
本文介绍了NDK调试:ndk-gdb无法拉动app_process。谁和何时创建app_process二进制文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在调查本机代码中遇到断点的问题时,我决定检查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.

推荐答案

>如前所述,Android 5.0具有 / system / bin / app_process32 的符号链接 / system / bin / app_process 。由于不能使用 adb pull 拉出符号链接,所以 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 时,将其拖动到您的开发机器,以支持单个调试配置Eclipse。

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆