2015-10-06 74 views
4

我想用ndk-gdb来调试我的原生android项目。当我运行命令NDK-gdb的我得到的错误ndk-gdb无法找到gdb.setup

Could not find gdb.setup under ./libs/ 

说明

  • 运行MacOSX的,NDK r10e;使用NDK样本圣洛杉矶
  • 其次这里步骤设置本机调试https://developer.android.com/ndk/guides/ndk-gdb.html
  • 基本上我设置的android:可调试=“真”,APP_OPTIM:=调试,并内置本地使用NDK-建立NDK_DEBUG = 1(这3个设置可能多余的,但以防万一)
  • 使用蚂蚁调试,安装adb安装;冉应用程序,应用程序运行正常
  • 运行NDK-GDB --verbose产生

    ndk-gdb --verbose

    的Android NDK安装路径为:

    /Users/hanantha/Documents/Dev/android-ndk-r10e 
    

    使用默认ADB命令:

    /Users/hanantha/Documents/Dev/android-sdk-macosx/platform-tools/adb 
    

    发现ADB版本:Android Debug Bridge版本1.0.32

    Revision eac51f2bb6a8-android 
    

    利用亚行标志:

    使用JDB命令:

    /usr/bin/jdb 
    

    使用自动检测项目路径。

    实测值包名称:com.example.SanAngeles

    的ABI由应用为对象:arm64-V8A armeabi armeabi-V7A armeabi-V7A MIPS MIPS64 86 x86_64的

    设备API等级:19周

    设备CPU的ABI:86

    兼容设备ABI:

    用GDB设置INIT:

    ./libs/armeabi/gdb.setup 
    

    使用工具链前缀:

    /Users/hanantha/Documents/Dev/android-ndk-r10e/toolchains/x86-4.8/prebuilt/darwin-x86_64/bin/i686-linux-android- 
    

    使用应用程序在目录中。/ OBJ /本地/ armeabi

    找到调试的标志:true

    错误:

    Could not find gdb.setup under ./libs/ 
        This usually means you modified your AndroidManifest.xml to set 
        the android:debuggable flag to 'true' but did not rebuild the 
        native binaries. Please call 'ndk-build' to do so, 
        *then* re-install to the device! 
    

回答

5

我刚才已经回答的帖子:https://stackoverflow.com/a/32972182/1617066

我遇到了同样的问题。在最近版本的Android构建工具中似乎有所改变。

的诀窍是:

ERROR: Could not find gdb.setup under ./libs/ 

该公司预计gdb.setup在目录库/ armeabi

所以简单workground是复制gdb.setup和gdbserver从“libs/cpu”改为“libs”,它就像一个魔法!

+1

建档的错误与谷歌https://code.google.com/p/android/issues/detail?id = 188885 – Harkish

+0

有原因的错误:https://code.google.com/p/android/issues/detail?id = 191085 – zombielei