2015-10-06 69 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